/*
 * PlaneWise light cockpit, 2026 polish layer.
 * Loaded after the legacy styles so business hooks and markup stay intact.
 */

:root {
  --pw-page: #edf3f6;
  --pw-page-deep: #e6eef2;
  --pw-surface: #ffffff;
  --pw-surface-soft: #f6f9fa;
  --pw-surface-tint: #edf7f7;
  --pw-ink: #102632;
  --pw-ink-soft: #314a57;
  --pw-muted: #687c86;
  --pw-line: #d5e0e5;
  --pw-line-strong: #b8cbd2;
  --pw-rail: #102731;
  --pw-rail-hover: #193943;
  --pw-brand: #087f85;
  --pw-brand-strong: #06646b;
  --pw-brand-soft: #dff2f2;
  --pw-blue: #416fb5;
  --pw-blue-soft: #eaf0fb;
  --pw-success: #23805b;
  --pw-success-soft: #e7f4ed;
  --pw-warning: #ae7416;
  --pw-warning-soft: #fff3d9;
  --pw-danger: #bd4b43;
  --pw-danger-soft: #fcedea;
  --pw-shadow-xs: 0 1px 2px rgba(20, 48, 60, 0.04);
  --pw-shadow-sm: 0 7px 22px rgba(18, 49, 62, 0.065);
  --pw-shadow-md: 0 18px 46px rgba(18, 49, 62, 0.11);
  --pw-shadow-dialog: 0 30px 90px rgba(8, 28, 38, 0.25);
  --pw-radius: 8px;
  --pw-radius-sm: 6px;
  --pw-ease: cubic-bezier(0.22, 0.8, 0.25, 1);
}

/* Reports registry --------------------------------------------------------- */

.report-registry-surface {
  border-color: #d4e0e4;
  box-shadow: 0 12px 30px rgba(20, 49, 61, 0.055);
}

.report-registry-surface > .report-registry-head {
  min-height: 78px;
  align-items: center;
  padding: 16px 18px;
  background: #fbfdfd;
}

.report-registry-title {
  display: grid;
  gap: 4px;
}

.report-registry-title h2 {
  font-size: 1.05rem;
}

.registry-export-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.registry-export-actions .export-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 39px;
  padding-inline: 13px;
}

.registry-export-actions .export-button img {
  width: 16px;
  height: 16px;
  opacity: 0.72;
}

.registry-filter-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 16px;
  min-height: 74px;
  padding: 13px 18px 14px;
  border-top: 1px solid #edf2f3;
  border-bottom: 1px solid var(--pw-line-strong);
  background: #f5f9f9;
}

.report-registry-surface .registry-tools {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 160px 150px;
  gap: 10px;
  width: min(760px, 100%);
}

.report-registry-surface .search-control input,
.report-registry-surface .select-control select {
  min-height: 41px;
  background-color: #ffffff;
}

.registry-result-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  min-height: 32px;
  border: 1px solid #d4e1e4;
  border-radius: 999px;
  padding: 5px 11px;
  color: #36545e;
  background: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.report-registry-table-wrap {
  max-height: min(62vh, 720px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.report-registry-table {
  min-width: 880px;
}

.report-registry-table .report-reference-column {
  width: 18%;
}

.report-registry-table .report-date-column {
  width: 12%;
}

.report-registry-table .report-division-column {
  width: 15%;
}

.report-registry-table .report-event-column {
  width: 29%;
}

.report-registry-table .report-risk-column {
  width: 10%;
}

.report-registry-table .report-status-column {
  width: 13%;
}

.report-registry-table .report-open-column {
  width: 42px;
}

.report-registry-table thead th {
  top: 0;
  height: 44px;
  padding: 9px 14px;
  background: #eef4f5;
  box-shadow: 0 1px 0 rgba(20, 48, 60, 0.04);
}

.report-registry-table .table-sort-button {
  gap: 6px;
  min-height: 25px;
  border-radius: 5px;
  padding: 2px 0;
}

.report-registry-table .sort-indicator {
  min-width: 20px;
  min-height: 20px;
  border: 0;
  border-radius: 5px;
  padding: 0;
  color: #667d86;
  background: transparent;
  font-size: 0.72rem;
}

.report-registry-table .sort-indicator::before {
  content: "\2195";
}

.report-registry-table .table-sort-button:hover .sort-indicator {
  color: var(--pw-brand-strong);
  background: #dfecee;
}

.report-registry-table .table-sort-button.is-active .sort-indicator {
  color: #ffffff;
  background: var(--pw-brand);
}

.report-registry-table .table-sort-button.is-active.asc .sort-indicator::before {
  content: "\2191";
}

.report-registry-table .table-sort-button.is-active.desc .sort-indicator::before {
  content: "\2193";
}

.report-registry-table tbody td {
  height: 66px;
  padding: 12px 14px;
}

.report-registry-table tbody tr {
  position: relative;
}

.report-registry-table tbody tr:focus-visible {
  outline: 3px solid rgba(8, 127, 133, 0.22);
  outline-offset: -3px;
  background: #f1f8f8;
}

.report-registry-table .reference-cell {
  color: #12333d;
  font-size: 0.88rem;
  font-weight: 850;
}

.report-registry-table .report-date-cell,
.report-registry-table .report-division-cell {
  color: #36505a;
  font-variant-numeric: tabular-nums;
}

.report-registry-table .report-event-cell {
  color: #183741;
  line-height: 1.28;
}

.report-registry-table .report-event-cell .muted {
  margin-top: 2px;
  color: #6c7f87;
  font-size: 0.75rem;
}

.report-registry-table .report-risk-cell,
.report-registry-table .report-status-cell {
  vertical-align: middle;
}

.report-registry-table .status-pill,
.report-registry-table .risk-badge {
  min-height: 27px;
  line-height: 1;
  white-space: nowrap;
}

.report-open-cell {
  padding-inline: 4px 10px !important;
  text-align: right;
}

.report-row-open {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: #4e6972;
  background: transparent;
  transition:
    transform 160ms var(--pw-ease),
    background-color 160ms ease;
}

.report-row-open img {
  width: 16px;
  height: 16px;
  opacity: 0.72;
}

.report-registry-table tbody tr:hover .report-row-open,
.report-registry-table tbody tr:focus-visible .report-row-open {
  transform: translateX(2px);
  background: #dfecee;
}

.report-registry-surface .registry-pagination {
  border-top-color: var(--pw-line-strong);
  background: #fbfdfd;
}

@media (max-width: 1180px) {
  .report-registry-surface .registry-tools {
    grid-template-columns: minmax(220px, 1fr) 150px 140px;
  }
}

@media (max-width: 760px) {
  .report-registry-surface > .report-registry-head {
    align-items: flex-start;
    gap: 14px;
  }

  .registry-export-actions {
    width: 100%;
  }

  .registry-export-actions .export-button {
    flex: 1;
  }

  .registry-filter-bar {
    grid-template-columns: 1fr;
    gap: 11px;
    padding: 13px;
  }

  .report-registry-surface .registry-tools {
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .report-registry-surface .registry-tools > :first-child {
    grid-column: 1 / -1;
  }

  .registry-result-count {
    justify-self: start;
  }

  .report-registry-table-wrap {
    max-height: none;
    overflow: visible;
    padding: 10px;
    background: #f1f6f7;
  }

  .report-registry-table {
    display: block;
    min-width: 0;
  }

  .report-registry-table colgroup,
  .report-registry-table thead {
    display: none;
  }

  .report-registry-table tbody {
    display: grid;
    gap: 9px;
  }

  .report-registry-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 7px 10px;
    min-width: 0;
    border: 1px solid #d5e1e4;
    border-radius: 8px;
    padding: 13px;
    background: #ffffff;
    box-shadow: 0 5px 14px rgba(20, 49, 61, 0.04);
  }

  .report-registry-table tbody td {
    display: block;
    width: auto;
    height: auto;
    min-height: 0;
    border: 0;
    padding: 0;
  }

  .report-registry-table .reference-cell {
    grid-column: 1 / 3;
    align-self: center;
  }

  .report-registry-table .report-date-cell {
    grid-column: 3;
    color: #667b84;
    font-size: 0.72rem;
    text-align: right;
  }

  .report-registry-table .report-division-cell {
    grid-column: 1 / -1;
    color: #587079;
    font-size: 0.72rem;
  }

  .report-registry-table .report-event-cell {
    grid-column: 1 / -1;
    padding-block: 3px 5px;
  }

  .report-registry-table .report-risk-cell {
    grid-column: 1;
  }

  .report-registry-table .report-status-cell {
    grid-column: 2;
  }

  .report-registry-table .report-open-cell {
    grid-column: 3;
    padding: 0 !important;
  }
}

/* Report draft feedback and compact risk evaluation --------------------- */

.editor-summary-meta .editor-draft-status.is-saving {
  border-color: #ead3a2;
  background: #fff8e8;
  color: #7f570e;
}

.editor-summary-meta .editor-draft-status.is-saved {
  border-color: #b7ddcd;
  background: #eef9f3;
  color: #176b4c;
}

.report-form > .editor-panel[data-editor-panel="evaluation"] {
  min-height: 220px;
}

.report-form > .editor-panel[data-editor-panel="evaluation"] > .risk-grid {
  align-self: start;
  align-items: end;
  gap: 14px;
}

.report-form > .editor-panel[data-editor-panel="evaluation"] > .risk-grid label {
  align-self: start;
}

.report-form > .editor-panel[data-editor-panel="evaluation"] > .risk-grid select {
  width: 100%;
  height: 44px;
  min-height: 44px;
  padding-top: 0;
  padding-bottom: 0;
}

/* Guided report editor -------------------------------------------------- */

.editor-view .editor-surface {
  max-width: 1220px;
}

.editor-surface-head {
  min-height: 74px;
  align-items: center;
  padding: 15px 20px;
}

.editor-title-block,
.editor-mode-badge,
.editor-progress-copy,
.editor-step-actions,
.editor-save-actions {
  display: flex;
  align-items: center;
}

.editor-title-block {
  gap: 12px;
  min-width: 0;
}

.editor-title-icon,
.editor-section-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #c8dcdf;
  border-radius: 8px;
  background: #edf7f7;
}

.editor-title-icon {
  width: 40px;
  height: 40px;
}

.editor-title-icon img {
  width: 20px;
  height: 20px;
}

.editor-mode-badge {
  gap: 6px;
  border: 1px solid #d5e2e5;
  border-radius: 999px;
  padding: 7px 10px;
  color: #45606b;
  background: #f7fafb;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.editor-mode-badge img {
  width: 15px;
  height: 15px;
}

.editor-context {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  border-bottom: 1px solid #d5e1e4;
  background: #f7fafb;
}

.editor-context .editor-summary {
  min-height: 0;
  border: 0;
  padding: 14px 20px;
  background: transparent;
}

.editor-progress {
  display: grid;
  align-content: center;
  gap: 10px;
  border-left: 1px solid #d5e1e4;
  padding: 14px 20px;
}

.editor-progress-copy {
  justify-content: space-between;
  gap: 12px;
}

.editor-progress-copy span {
  color: #637983;
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
}

.editor-progress-copy strong {
  overflow: hidden;
  color: #153442;
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-progress-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #dce7e9;
}

.editor-progress-bar {
  display: block;
  width: 16.666%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2c8588, #4eb3b3);
  transition: width 220ms ease;
}

.editor-tabs {
  position: relative;
  top: auto;
  gap: 8px;
  border-bottom: 1px solid #d5e1e4;
  padding: 10px 18px;
  background: #ffffff;
  box-shadow: none;
}

.editor-tab {
  display: flex;
  flex: 1 0 150px;
  align-items: center;
  gap: 9px;
  min-height: 58px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 8px 10px;
  text-align: left;
}

.editor-tab::after {
  display: none;
}

.editor-tab:hover {
  border-color: #d4e1e4;
  background: #f7fafb;
}

.editor-tab-index {
  display: grid;
  flex: 0 0 auto;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 1px solid #cbdadd;
  border-radius: 50%;
  color: #58707a;
  background: #ffffff;
  font-size: 0.68rem;
  font-weight: 850;
}

.editor-tab-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.editor-tab-copy strong {
  overflow: hidden;
  color: #263f4b;
  font-size: 0.73rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-tab-copy small {
  overflow: hidden;
  color: #74878f;
  font-size: 0.61rem;
  font-weight: 650;
  letter-spacing: 0;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}

.editor-tab.is-active {
  border-color: #aed3d4;
  color: #153442;
  background: #eaf6f6;
}

.editor-tab.is-active .editor-tab-index {
  border-color: #267b7f;
  color: #ffffff;
  background: #267b7f;
}

.editor-tab.is-active .editor-tab-copy strong {
  color: #125f63;
}

.report-form > .editor-panel {
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 22px;
  min-height: 320px;
  padding: 22px 20px 26px;
}

.report-form > .editor-panel:focus-within {
  box-shadow: inset 3px 0 0 rgba(43, 133, 136, 0.45);
}

.report-form > .editor-panel > .editor-section-heading {
  position: sticky;
  top: 24px;
  display: flex;
  align-self: start;
  align-items: flex-start;
  gap: 10px;
  border-left: 0;
  padding: 0;
  color: #153442;
  text-transform: none;
}

.editor-section-icon {
  width: 36px;
  height: 36px;
}

.editor-section-icon img {
  width: 18px;
  height: 18px;
}

.editor-section-heading > span:last-child {
  display: grid;
  min-width: 0;
  gap: 3px;
  padding-top: 2px;
}

.editor-section-heading strong {
  color: #173541;
  font-size: 0.78rem;
  letter-spacing: 0;
}

.editor-section-heading small {
  color: #71858e;
  font-size: 0.64rem;
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.35;
  text-transform: none;
}

.editor-view .form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
}

.editor-step-actions,
.editor-save-actions {
  gap: 8px;
}

.editor-save-actions {
  margin-left: auto;
}

.editor-step-button:not([hidden]) {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.editor-step-button img {
  width: 15px;
  height: 15px;
}

@media (max-width: 900px) {
  .editor-context {
    grid-template-columns: 1fr;
  }

  .editor-progress {
    border-top: 1px solid #d5e1e4;
    border-left: 0;
  }

  .report-form > .editor-panel {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .report-form > .editor-panel > .editor-section-heading {
    position: static;
  }
}

@media (max-width: 700px) {
  .editor-surface-head {
    align-items: flex-start;
    gap: 12px;
  }

  .editor-mode-badge {
    padding-inline: 8px;
  }

  .editor-tabs {
    padding: 8px 12px;
  }

  .editor-tab {
    flex-basis: 136px;
    min-height: 52px;
  }

  .report-form > .editor-panel {
    padding: 18px 13px 22px;
  }

  .editor-view .form-actions {
    flex-wrap: wrap;
    padding: 12px 13px;
  }

  .editor-step-actions,
  .editor-save-actions {
    width: 100%;
  }

  .editor-save-actions {
    margin-left: 0;
  }

  .editor-step-actions > button,
  .editor-save-actions > button {
    flex: 1 1 0;
  }

  .editor-view .form-actions > .danger-button:not([hidden]) {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .editor-title-icon,
  .editor-mode-badge {
    display: none;
  }

  .editor-tab-copy small {
    display: none;
  }

  .editor-tab {
    flex-basis: 118px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .editor-progress-bar {
    transition: none;
  }
}

@media (max-width: 440px) {
  .registry-export-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .report-registry-surface .registry-tools {
    grid-template-columns: 1fr;
  }

  .report-registry-surface .registry-tools > * {
    grid-column: auto !important;
  }
}

html {
  color-scheme: light;
  background: var(--pw-page);
}

body {
  color: var(--pw-ink);
  background: var(--pw-page);
  font-family: "Segoe UI Variable Text", "Aptos", "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.46;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.product-shell {
  grid-template-columns: 252px minmax(0, 1fr);
  background: var(--pw-page);
}

.side-rail {
  z-index: 50;
  gap: 14px;
  padding: 18px 14px 14px;
  color: #f6fbfc;
  background: var(--pw-rail);
  border-right: 1px solid #284650;
  box-shadow: 10px 0 34px rgba(8, 31, 40, 0.08);
}

.brand-block {
  min-height: 58px;
  gap: 11px;
  padding: 0 7px 14px;
  border-bottom-color: rgba(220, 237, 240, 0.15);
}

.brand-mark {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(139, 221, 218, 0.42);
  border-radius: var(--pw-radius);
  background: #16525c;
  box-shadow: 0 9px 22px rgba(4, 24, 32, 0.2);
  font-size: 0.84rem;
}

.brand-block strong {
  font-size: 1rem;
  line-height: 1.1;
}

.brand-block span {
  margin-top: 4px;
  color: #a9bec5;
  font-size: 0.7rem;
}

.brand-block [data-environment-label] {
  display: none;
}

.module-nav {
  gap: 4px;
  padding-inline: 2px;
}

.nav-section-label {
  margin: 14px 10px 6px;
  color: #88a0a8;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0;
}

.module-link {
  grid-template-columns: 32px minmax(0, 1fr);
  min-height: 43px;
  border: 1px solid transparent;
  border-radius: var(--pw-radius-sm);
  padding: 0 10px;
  color: #d9e5e8;
  font-size: 0.85rem;
  transition:
    transform 160ms var(--pw-ease),
    color 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease;
}

.module-link:not(.disabled):hover {
  transform: translateX(2px);
  border-color: rgba(142, 205, 207, 0.13);
  background: var(--pw-rail-hover);
}

.module-link.active {
  border-color: #48717c;
  background: #21464f;
  box-shadow: inset 3px 0 #71d1cf, 0 8px 20px rgba(4, 25, 33, 0.16);
}

.nav-glyph {
  width: 27px;
  height: 27px;
  border-color: rgba(201, 226, 231, 0.12);
  border-radius: 6px;
  background: #203b44;
}

.module-link.active .nav-glyph {
  border-color: rgba(149, 226, 223, 0.28);
  background: #155b62;
}

.tenant-card {
  border: 1px solid rgba(188, 219, 224, 0.19);
  border-radius: var(--pw-radius);
  padding: 12px;
  background: linear-gradient(180deg, #18343e 0%, #152f38 100%);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.04);
}

.tenant-account-link {
  color: #91ddda;
}

.tenant-card .tenant-account-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 10px;
  border-top: 1px solid rgba(188, 219, 224, 0.13);
  padding: 9px 2px 0;
  color: #9edbd8;
  font-size: 0.67rem;
  font-weight: 750;
}

.tenant-card .tenant-account-link::after {
  content: "›";
  color: #b7dfe0;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1;
}

.tenant-card .tenant-account-link:hover,
.tenant-card .tenant-account-link:focus-visible {
  color: #ffffff;
}

.tenant-card {
  position: relative;
}

.tenant-card .tenant-card-label {
  margin: 0 0 8px 2px;
  color: #9fb8bf;
  font-size: 0.61rem;
  font-weight: 800;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.tenant-switcher-trigger {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 54px;
  border: 1px solid rgba(166, 216, 220, 0.16);
  border-radius: var(--pw-radius-sm);
  padding: 8px;
  color: #f8fcfd;
  background: rgba(7, 27, 35, 0.3);
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms var(--pw-ease), background-color 160ms var(--pw-ease), box-shadow 160ms var(--pw-ease), transform 160ms var(--pw-ease);
}

.tenant-switcher-trigger:not(:disabled):hover,
.tenant-switcher-trigger[aria-expanded="true"] {
  border-color: rgba(145, 221, 218, 0.46);
  background: rgba(7, 27, 35, 0.54);
}

.tenant-switcher-trigger:not(:disabled):active {
  transform: translateY(1px);
}

.tenant-switcher-trigger:focus-visible {
  outline: 0;
  border-color: #91ddda;
  box-shadow: 0 0 0 3px rgba(145, 221, 218, 0.18);
}

.tenant-switcher-trigger.is-static {
  grid-template-columns: 34px minmax(0, 1fr);
  border-color: rgba(166, 216, 220, 0.1);
  background: rgba(7, 27, 35, 0.18);
  cursor: default;
  opacity: 1;
}

.tenant-switcher-trigger.is-loading {
  opacity: 0.68;
}

.tenant-switcher-current,
.tenant-switcher-option-copy {
  min-width: 0;
}

.tenant-switcher-avatar,
.tenant-switcher-option-avatar {
  display: grid !important;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(145, 221, 218, 0.26);
  border-radius: 8px;
  color: #dff8f6 !important;
  background: #24505a;
  font-size: 0.67rem !important;
  font-weight: 850;
  letter-spacing: 0.02em;
}

.tenant-switcher-current strong,
.tenant-switcher-option-copy strong {
  display: block;
  overflow: hidden;
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tenant-switcher-current small,
.tenant-switcher-option-copy small {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  margin-top: 4px;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 0.61rem;
  font-weight: 750;
  line-height: 1.2;
}

.tenant-switcher-current small {
  color: #c6dddf;
  background: rgba(174, 215, 217, 0.12);
}

.tenant-switcher-chevron {
  width: 14px;
  height: 14px;
  margin: auto;
  filter: brightness(0) invert(1);
  opacity: 0.7;
  transform: rotate(90deg);
  transition: transform 160ms var(--pw-ease);
}

.tenant-switcher-trigger[aria-expanded="true"] .tenant-switcher-chevron {
  transform: rotate(-90deg);
}

.tenant-switcher-trigger.is-static .tenant-switcher-chevron {
  display: none;
}

.tenant-switcher-menu {
  position: absolute;
  z-index: 90;
  bottom: calc(100% + 7px);
  left: 0;
  width: 100%;
  max-height: min(310px, 48vh);
  overflow-y: auto;
  border: 1px solid rgba(176, 218, 221, 0.24);
  border-radius: var(--pw-radius-sm);
  padding: 7px;
  color: #f6fbfc;
  background: #142c35;
  box-shadow: 0 18px 42px rgba(2, 17, 23, 0.4);
  scrollbar-gutter: stable;
}

.tenant-switcher-menu[hidden] {
  display: none;
}

.tenant-switcher-menu-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 34px;
  margin: 0 2px 5px;
  border-bottom: 1px solid rgba(188, 219, 224, 0.13);
  padding: 2px 5px 7px;
}

.tenant-switcher-menu-heading strong {
  margin: 0;
  color: #eef9fa;
  font-size: 0.68rem;
  line-height: 1.25;
}

.tenant-switcher-menu-heading span {
  color: #93adb4;
  font-size: 0.59rem;
  white-space: nowrap;
}

.tenant-switcher-option {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 54px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 7px;
  color: #f5fafb;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms var(--pw-ease), background-color 150ms var(--pw-ease);
}

.tenant-switcher-option + .tenant-switcher-option {
  margin-top: 3px;
}

.tenant-switcher-option:hover,
.tenant-switcher-option:focus-visible {
  outline: 0;
  border-color: rgba(145, 221, 218, 0.19);
  background: #1b3a44;
}

.tenant-switcher-option[aria-checked="true"] {
  border-color: rgba(145, 221, 218, 0.22);
  color: #f8fdfd;
  background: #1d414b;
  cursor: default;
  opacity: 1;
}

.tenant-switcher-option-avatar {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  background: #214b55;
}

.tenant-switcher-option-copy strong {
  color: inherit;
  font-size: 0.69rem;
}

.tenant-switcher-option-copy small {
  color: #b7ced2;
  background: rgba(174, 215, 217, 0.1);
}

.tenant-switcher-option-check {
  display: grid !important;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: #c9f3ef !important;
  background: rgba(21, 108, 112, 0.34);
  font-size: 0.72rem !important;
  font-weight: 900;
  text-align: center;
}

.tenant-switcher-option:not([aria-checked="true"]) .tenant-switcher-option-check {
  background: transparent;
}

.tenant-switch-dialog {
  width: min(590px, calc(100vw - 28px));
}

.tenant-switch-dialog-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
}

.tenant-switch-dialog-content {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 13px;
  padding: 20px;
}

.tenant-switch-warning-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid #eccb89;
  border-radius: 50%;
  color: #8c5a09;
  background: #fff6df;
  font-size: 1rem;
  font-weight: 900;
}

.tenant-switch-dialog-content p {
  margin: 0;
  color: var(--pw-ink);
  line-height: 1.5;
}

.tenant-switch-dialog-content ul {
  display: grid;
  gap: 7px;
  margin: 12px 0;
  padding-left: 19px;
  color: #9a3c2f;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.4;
}

.tenant-switch-dialog-content .tenant-switch-dialog-note {
  color: var(--pw-muted);
  font-size: 0.79rem;
}

@media (max-width: 760px) {
  .tenant-switcher-menu {
    width: 100%;
  }

  .tenant-switch-dialog {
    width: calc(100vw - 14px);
    height: auto;
    max-height: calc(100dvh - 14px);
    border-radius: var(--pw-radius-sm);
  }

  .tenant-switch-dialog-content {
    grid-template-columns: 1fr;
    padding: 16px 13px;
  }
}

.workspace {
  min-width: 0;
  padding: 30px clamp(22px, 2.8vw, 48px) 56px;
}

.workspace-header {
  position: sticky;
  top: 0;
  z-index: 24;
  min-height: 82px;
  margin: -30px 0 24px;
  padding: 20px 0 15px;
  border-bottom: 1px solid rgba(178, 197, 205, 0.76);
  background: rgba(237, 243, 246, 0.94);
  box-shadow: none;
  backdrop-filter: blur(16px) saturate(125%);
  transition:
    background-color 180ms ease,
    box-shadow 180ms ease;
}

.workspace-header.is-condensed {
  background: rgba(237, 243, 246, 0.98);
  box-shadow: 0 10px 24px rgba(18, 45, 58, 0.08);
}

.workspace-header h1 {
  color: var(--pw-ink);
  font-size: 2rem;
  font-weight: 760;
  line-height: 1.08;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--pw-brand-strong);
  font-size: 0.66rem;
  font-weight: 830;
  letter-spacing: 0;
  line-height: 1.2;
  text-transform: uppercase;
}

.header-actions {
  gap: 9px;
}

.environment-pill {
  min-height: 32px;
  border: 1px solid #b7c8e1;
  border-radius: 999px;
  padding: 6px 11px;
  color: #355897;
  background: #f4f7fd;
  font-size: 0.72rem;
  font-weight: 800;
}

.primary-button,
.secondary-button,
.danger-button,
.dashboard-section-link {
  min-height: 38px;
  border-radius: var(--pw-radius-sm);
  font-weight: 760;
  transition:
    transform 150ms var(--pw-ease),
    box-shadow 150ms ease,
    border-color 150ms ease,
    background-color 150ms ease;
}

.primary-button {
  border-color: var(--pw-brand-strong);
  background: var(--pw-brand);
  box-shadow: 0 7px 16px rgba(7, 112, 118, 0.16);
}

.primary-button:hover {
  transform: translateY(-1px);
  background: var(--pw-brand-strong);
  box-shadow: 0 10px 22px rgba(7, 112, 118, 0.22);
}

.secondary-button {
  border-color: var(--pw-line-strong);
  color: var(--pw-ink);
  background: var(--pw-surface);
  box-shadow: var(--pw-shadow-xs);
}

.secondary-button:hover {
  transform: translateY(-1px);
  border-color: #8caab4;
  background: #fbfdfd;
  box-shadow: var(--pw-shadow-sm);
}

.view-panel.is-active {
  animation: pw-panel-in 220ms var(--pw-ease) both;
}

.dashboard-overview-head {
  align-items: center;
  margin-bottom: 14px;
  padding-top: 2px;
}

.dashboard-overview-head h2 {
  color: var(--pw-ink);
  font-size: 1.48rem;
  line-height: 1.15;
}

.dashboard-overview-actions {
  gap: 9px;
}

.dashboard-overview-actions .primary-button,
.dashboard-overview-actions .secondary-button {
  min-height: 42px;
}

.metric-strip {
  gap: 12px;
  margin-bottom: 16px;
}

.dashboard-metrics {
  grid-template-columns: repeat(5, minmax(148px, 1fr));
}

.metric-card {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 13px;
  align-items: center;
  min-height: 122px;
  overflow: hidden;
  border: 1px solid var(--pw-line);
  border-top: 2px solid currentColor;
  border-radius: var(--pw-radius);
  padding: 17px 16px;
  color: var(--pw-brand);
  background: var(--pw-surface);
  box-shadow: var(--pw-shadow-sm);
  text-align: left;
  isolation: isolate;
  transition:
    transform 180ms var(--pw-ease),
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.metric-card::after {
  position: absolute;
  top: 11px;
  right: 10px;
  width: 18px;
  height: 18px;
  content: "";
  background: currentColor;
  opacity: 0.2;
  pointer-events: none;
  -webkit-mask: url("/icons/chevron-right.svg") center / 14px no-repeat;
  mask: url("/icons/chevron-right.svg") center / 14px no-repeat;
  transition: opacity 160ms ease, transform 160ms ease;
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: #bdd0d6;
  box-shadow: 0 13px 28px rgba(18, 49, 62, 0.10);
}

.metric-card:hover::after,
.metric-card:focus-visible::after {
  opacity: 0.58;
  transform: translateX(2px);
}

.metric-card:focus-visible,
.dashboard-work-item:focus-visible,
.dashboard-deadline-item:focus-visible,
.dashboard-recent-item:focus-visible,
.dashboard-section-link:focus-visible {
  outline: 3px solid rgba(8, 127, 133, 0.24);
  outline-offset: 2px;
}

.metric-card:active {
  transform: translateY(-1px);
}

.metric-card .metric-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(37, 111, 119, 0.09);
  border-radius: var(--pw-radius);
  background: var(--pw-brand-soft);
  box-shadow: none;
}

.metric-card .metric-icon img {
  width: 21px;
  height: 21px;
}

.metric-card .metric-content {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 5px;
  min-width: 0;
}

.metric-card .metric-label {
  color: #576b75;
  font-size: 0.68rem;
  font-weight: 830;
  line-height: 1.18;
  text-transform: uppercase;
}

.metric-card strong {
  color: var(--pw-ink);
  font-size: 2.12rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.metric-card small {
  align-self: end;
  color: var(--pw-muted);
  font-size: 0.68rem;
  font-weight: 650;
  line-height: 1.22;
}

.metric-card.total {
  color: var(--pw-brand);
}

.metric-card.open {
  color: #168f93;
}

.metric-card.risk {
  color: var(--pw-danger);
}

.metric-card.overdue {
  color: var(--pw-warning);
}

.metric-card.audit {
  color: var(--pw-blue);
}

.metric-card.closed {
  color: var(--pw-success);
}

.surface {
  overflow: hidden;
  border: 1px solid var(--pw-line);
  border-radius: var(--pw-radius);
  background: var(--pw-surface);
  box-shadow: var(--pw-shadow-sm);
}

.surface-head,
.chart-card-head {
  min-height: 66px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--pw-line);
  background: var(--pw-surface);
}

.surface-head h2,
.chart-card-head h2 {
  color: var(--pw-ink);
  font-size: 1.02rem;
  line-height: 1.24;
}

.dashboard-action-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.92fr) minmax(340px, 0.98fr);
  grid-template-areas:
    "priorities deadlines"
    "trend recent";
  gap: 15px;
  align-items: start;
}

.dashboard-main-stack,
.dashboard-side-stack {
  display: contents;
}

.dashboard-priorities,
.dashboard-trend,
.dashboard-deadlines,
.dashboard-recent {
  min-width: 0;
}

.dashboard-priorities {
  grid-area: priorities;
}

.dashboard-deadlines {
  grid-area: deadlines;
}

.dashboard-trend {
  grid-area: trend;
}

.dashboard-recent {
  grid-area: recent;
}

.dashboard-head-actions {
  gap: 11px;
}

.dashboard-count {
  min-height: 28px;
  border: 1px solid #dbe5e8;
  padding: 5px 10px;
  color: var(--pw-ink-soft);
  background: var(--pw-surface-soft);
}

.dashboard-section-link {
  gap: 4px;
  color: var(--pw-brand-strong);
  background: transparent;
}

.dashboard-section-link:hover img {
  transform: translateX(2px);
}

.dashboard-work-columns,
.dashboard-work-item {
  grid-template-columns: minmax(220px, 1fr) 108px 112px 104px 22px;
}

.dashboard-work-columns {
  align-items: center;
  min-height: 42px;
  padding: 8px 18px;
  border-bottom: 1px solid var(--pw-line);
  color: #687b84;
  background: var(--pw-surface-soft);
  font-size: 0.65rem;
  font-weight: 820;
  text-transform: uppercase;
}

.dashboard-work-item {
  min-height: 76px;
  padding: 11px 17px;
  border-bottom: 1px solid #e1e9ec;
  background: var(--pw-surface);
  transition:
    background-color 150ms ease,
    box-shadow 150ms ease,
    transform 150ms var(--pw-ease);
}

.dashboard-work-item:hover {
  position: relative;
  z-index: 1;
  background: #f4f9f9;
  box-shadow: inset 3px 0 var(--pw-brand);
}

.dashboard-work-main {
  gap: 2px;
}

.dashboard-work-main strong {
  color: var(--pw-ink);
  font-size: 0.87rem;
}

.dashboard-work-summary {
  color: var(--pw-ink-soft);
  font-size: 0.75rem;
  line-height: 1.35;
}

.dashboard-work-main small,
.dashboard-work-deadline {
  color: var(--pw-muted);
  font-size: 0.67rem;
}

.dashboard-priority-badge,
.status-badge {
  min-height: 27px;
  border-radius: 999px;
  font-size: 0.67rem;
  font-weight: 760;
}

.dashboard-action-summary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 14px;
}

.dashboard-action-stat {
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  min-height: 94px;
  border: 1px solid var(--pw-line);
  border-left: 3px solid currentColor;
  border-radius: var(--pw-radius);
  padding: 12px;
  background: var(--pw-surface-soft);
}

.dashboard-action-stat:first-child,
.dashboard-action-stat:last-child {
  padding-inline: 12px;
}

.dashboard-action-stat + .dashboard-action-stat {
  border-left-color: currentColor;
}

.dashboard-action-stat.is-late {
  color: var(--pw-danger);
}

.dashboard-action-stat.is-week {
  color: var(--pw-warning);
}

.dashboard-action-stat-icon {
  width: 38px;
  height: 38px;
  border-radius: 7px;
}

.dashboard-action-stat-copy {
  gap: 3px;
}

.dashboard-action-stat-copy > span {
  color: #60737c;
  font-size: 0.63rem;
}

.dashboard-action-stat strong {
  color: var(--pw-ink);
  font-size: 1.55rem;
}

.dashboard-action-stat small {
  color: var(--pw-muted);
  font-size: 0.64rem;
  white-space: normal;
}

.dashboard-deadline-list,
.dashboard-recent-list {
  padding: 0 14px 14px;
}

.dashboard-deadline-item,
.dashboard-recent-item {
  border: 1px solid transparent;
  border-top-color: #e1e9ec;
  border-radius: var(--pw-radius-sm);
  transition:
    transform 150ms var(--pw-ease),
    background-color 150ms ease,
    border-color 150ms ease;
}

.dashboard-deadline-item {
  column-gap: 14px;
  padding-inline: 14px 10px;
}

.dashboard-deadline-item:hover,
.dashboard-recent-item:hover {
  border-color: #d3e1e5;
  background: #f4f9f9;
}

.dashboard-trend-chart {
  height: 254px;
}

.dashboard-chart-legend {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 11px;
  color: var(--pw-muted);
  font-size: 0.67rem;
}

.line-chart {
  padding: 10px 17px 14px;
}

.dashboard-recent-list .empty-state,
.dashboard-deadline-list .empty-state {
  min-height: 68px;
  display: grid;
  place-items: center;
  border: 1px dashed #cbd9de;
  border-radius: var(--pw-radius);
  color: var(--pw-muted);
  background: var(--pw-surface-soft);
}

.analytics-filter-panel {
  margin-bottom: 14px;
}

.analytics-head {
  display: grid;
  grid-template-columns: minmax(150px, 0.55fr) minmax(640px, 1.45fr);
  gap: 22px;
  align-items: end;
  padding: 17px 18px;
}

.analytics-tools {
  display: grid;
  grid-template-columns: repeat(3, minmax(112px, 0.8fr)) repeat(2, minmax(138px, 1fr));
  gap: 9px;
  align-items: end;
}

.analytics-range-note {
  min-height: 40px;
  padding: 10px 18px;
  border-top: 1px solid var(--pw-line);
  color: var(--pw-ink-soft);
  background: var(--pw-surface-soft);
  font-size: 0.75rem;
  font-weight: 700;
}

.analytics-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.analytics-metrics .metric-card {
  min-height: 104px;
}

.analytics-metrics .metric-card.risk {
  color: var(--pw-danger);
}

.analytics-metrics .metric-card.open {
  color: var(--pw-warning);
}

.analytics-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.analytics-chart-panel {
  min-width: 0;
}

.chart-card-wide {
  grid-column: 1 / -1;
}

.analytics-line-chart {
  min-height: 330px;
  padding: 14px 18px 17px;
}

.line-chart-scroll {
  padding-bottom: 3px;
  scrollbar-color: #93b7bd #e8eff1;
  scrollbar-width: thin;
}

.line-chart-canvas {
  min-height: 292px;
}

.line-chart-svg {
  height: 252px;
}

.line-chart-grid {
  stroke: #dce6e9;
  stroke-dasharray: 4 6;
}

.line-chart-grid-label {
  fill: #71838b;
  font-size: 12px;
  font-weight: 700;
}

.line-chart-path {
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.line-chart-area {
  opacity: 0.52;
}

.line-chart-point {
  stroke-width: 3;
  transition: r 150ms ease;
}

.line-chart-point:hover {
  r: 7;
}

.line-chart-axis {
  gap: 0;
  padding: 9px 24px 0 58px;
}

.line-chart-axis-item {
  display: grid;
  justify-items: center;
  gap: 2px;
  min-width: 0;
  color: var(--pw-muted);
  text-align: center;
}

.line-chart-axis-item strong {
  color: var(--pw-ink-soft);
  font-size: 0.72rem;
}

.line-chart-axis-item span {
  color: var(--pw-ink);
  font-size: 0.74rem;
  font-weight: 800;
}

.line-chart-axis-item small {
  max-width: 82px;
  overflow: hidden;
  color: var(--pw-muted);
  font-size: 0.62rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.distribution-chart {
  min-height: 230px;
  padding: 18px;
}

.distribution-visual {
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 21px;
  align-items: center;
}

.distribution-donut {
  width: 142px;
  height: 142px;
  border: 8px solid #f4f7f8;
  box-shadow: inset 0 0 0 1px rgba(18, 45, 58, 0.08);
}

.distribution-center {
  width: 76px;
  height: 76px;
  border: 1px solid #dce6e9;
  background: var(--pw-surface);
  box-shadow: var(--pw-shadow-xs);
}

.distribution-center strong {
  font-size: 1.48rem;
}

.distribution-center span {
  color: var(--pw-muted);
  font-size: 0.6rem;
  font-weight: 800;
}

.distribution-legend {
  min-width: 0;
}

.distribution-legend-row {
  grid-template-columns: 10px minmax(0, 1fr) 30px 38px;
  gap: 9px;
  min-height: 37px;
  border-bottom: 1px solid #e8eef0;
}

.distribution-swatch {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.distribution-label {
  color: var(--pw-ink-soft);
  font-size: 0.74rem;
}

.distribution-legend-row strong,
.distribution-legend-row small {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.distribution-legend-row small {
  color: var(--pw-muted);
}

.registry-surface,
.activity-log-surface {
  overflow: visible;
}

.registry-surface > .surface-head,
.activity-log-surface > .surface-head {
  position: relative;
  z-index: 3;
  min-height: 84px;
  align-items: end;
}

.registry-tools {
  grid-template-columns: minmax(230px, 1fr) 112px 112px auto auto;
  gap: 9px;
  align-items: end;
}

.search-control,
.select-control,
.report-form label {
  gap: 5px;
}

.search-control > span,
.select-control > span,
.report-form label > span {
  color: #536873;
  font-size: 0.68rem;
  font-weight: 780;
}

input,
select,
textarea {
  border: 1px solid var(--pw-line-strong);
  border-radius: var(--pw-radius-sm);
  color: var(--pw-ink);
  background: var(--pw-surface);
  box-shadow: inset 0 1px 2px rgba(20, 48, 60, 0.025);
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    background-color 150ms ease;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #94aeb7;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--pw-brand);
  box-shadow: 0 0 0 3px rgba(8, 127, 133, 0.13);
}

.registry-table {
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.registry-table thead th {
  position: sticky;
  top: 65px;
  z-index: 2;
  height: 41px;
  border-bottom: 1px solid var(--pw-line-strong);
  padding: 8px 14px;
  color: #5f737d;
  background: #f1f6f7;
  box-shadow: 0 1px 0 rgba(18, 49, 62, 0.025);
  font-size: 0.65rem;
  font-weight: 830;
  text-transform: uppercase;
}

.registry-table tbody td {
  min-height: 58px;
  border-bottom: 1px solid #dfe8eb;
  padding: 12px 14px;
  color: var(--pw-ink-soft);
  vertical-align: middle;
}

.registry-table tbody tr {
  background: var(--pw-surface);
  transition:
    background-color 140ms ease,
    box-shadow 140ms ease;
}

.registry-table tbody tr:hover {
  background: #f2f8f8;
  box-shadow: inset 3px 0 var(--pw-brand);
}

.registry-table tbody tr.is-selected,
.registry-table tbody tr.selected {
  background: #e9f4f4;
  box-shadow: inset 3px 0 var(--pw-brand);
}

.sort-indicator {
  border-radius: 4px;
  color: #577078;
  background: #e3ecef;
}

.status-badge {
  color: #19414a;
  background: #e7f0f1;
}

.empty-state.compact {
  color: var(--pw-muted);
  font-size: 0.78rem;
}

.workspace-dialog {
  border: 0;
  border-radius: var(--pw-radius);
  box-shadow: var(--pw-shadow-dialog);
}

.workspace-dialog::backdrop {
  background: rgba(9, 29, 38, 0.56);
  backdrop-filter: blur(4px);
}

.workspace-dialog[open] {
  animation: pw-dialog-in 190ms var(--pw-ease) both;
}

.dialog-heading {
  border-bottom: 1px solid var(--pw-line);
  background: #fbfdfd;
}

.dialog-close-button {
  border-radius: var(--pw-radius-sm);
}

.ui-motion-enabled .pw-reveal {
  opacity: 0;
  transform: translateY(9px);
}

.ui-motion-enabled .pw-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 260ms var(--pw-ease),
    transform 260ms var(--pw-ease);
  transition-delay: var(--pw-reveal-delay, 0ms);
}

.ui-motion-enabled .line-chart-path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: pw-chart-line 850ms var(--pw-ease) forwards;
}

.ui-motion-enabled .line-chart-area {
  opacity: 0;
  animation: pw-chart-area 520ms 250ms ease forwards;
}

.ui-motion-enabled .distribution-donut {
  animation: pw-donut-in 440ms var(--pw-ease) both;
}

@keyframes pw-panel-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pw-dialog-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.992);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes pw-chart-line {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes pw-chart-area {
  to {
    opacity: 0.52;
  }
}

@keyframes pw-donut-in {
  from {
    opacity: 0;
    transform: scale(0.94);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 1440px) {
  .product-shell {
    grid-template-columns: 232px minmax(0, 1fr);
  }

  .workspace {
    padding-inline: 28px;
  }

  .dashboard-metrics {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .dashboard-metrics .metric-card {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 10px;
    min-height: 110px;
    padding: 14px 12px;
  }

  .dashboard-metrics .metric-icon {
    width: 38px;
    height: 38px;
  }

  .dashboard-metrics .metric-card strong {
    font-size: 1.86rem;
  }

  .dashboard-action-grid {
    grid-template-columns: minmax(0, 1.72fr) minmax(310px, 0.9fr);
  }
}

@media (max-width: 1180px) {
  .dashboard-metrics {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .dashboard-metrics .metric-card {
    grid-column: span 2;
  }

  .dashboard-metrics .metric-card:nth-last-child(-n + 2) {
    grid-column: span 3;
  }

  .analytics-head {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .analytics-tools {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .analytics-tools > :nth-last-child(-n + 2) {
    grid-column: span 1;
  }

  .dashboard-action-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "priorities"
      "deadlines"
      "trend"
      "recent";
  }

  .registry-surface > .surface-head {
    align-items: start;
  }

  .registry-tools {
    grid-template-columns: minmax(220px, 1fr) 110px 110px;
    width: 100%;
  }
}

@media (max-width: 900px) {
  .product-shell {
    display: block;
  }

  .workspace {
    padding: 22px 18px 42px;
  }

  .workspace-header {
    margin-top: -22px;
    padding-top: 14px;
  }

  .workspace-header h1 {
    font-size: 1.65rem;
  }

  .dashboard-metrics,
  .analytics-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-metrics .metric-card,
  .dashboard-metrics .metric-card:nth-last-child(-n + 2) {
    grid-column: auto;
  }

  .dashboard-overview-head {
    align-items: flex-end;
  }

  .dashboard-work-columns {
    display: none;
  }

  .dashboard-work-item {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
  }

  .dashboard-work-item .dashboard-work-main {
    grid-column: 1 / -1;
  }

  .dashboard-work-deadline {
    grid-column: 1 / 2;
  }

  .dashboard-row-arrow {
    grid-column: 3;
  }

  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .chart-card-wide {
    grid-column: auto;
  }

  .distribution-visual {
    grid-template-columns: 130px minmax(0, 1fr);
  }

  .distribution-donut {
    width: 124px;
    height: 124px;
  }

  .registry-table thead th {
    top: 60px;
  }
}

@media (max-width: 720px) {
  .workspace {
    padding-inline: 13px;
  }

  .workspace-header {
    margin-bottom: 18px;
  }

  .header-actions {
    gap: 6px;
  }

  .environment-pill {
    display: none;
  }

  .dashboard-overview-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-overview-actions {
    width: 100%;
  }

  .dashboard-overview-actions > * {
    flex: 1;
  }

  .dashboard-metrics,
  .analytics-metrics {
    grid-template-columns: 1fr 1fr;
    gap: 9px;
  }

  .metric-card {
    grid-template-columns: 37px minmax(0, 1fr);
    gap: 9px;
    min-height: 105px;
    padding: 12px;
  }

  .metric-card .metric-icon {
    width: 37px;
    height: 37px;
  }

  .metric-card .metric-icon img {
    width: 18px;
    height: 18px;
  }

  .metric-card strong {
    font-size: 1.7rem;
  }

  .metric-card .metric-label {
    font-size: 0.62rem;
  }

  .metric-card small {
    font-size: 0.62rem;
  }

  .dashboard-side-stack {
    grid-template-columns: 1fr;
  }

  .surface-head,
  .chart-card-head {
    min-height: 62px;
    padding: 13px 14px;
  }

  .dashboard-action-summary {
    padding-inline: 11px;
  }

  .dashboard-action-stat {
    grid-template-columns: 1fr;
    min-height: 105px;
  }

  .dashboard-action-stat-icon {
    width: 34px;
    height: 34px;
  }

  .analytics-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analytics-tools > :first-child {
    grid-column: 1 / -1;
  }

  .analytics-line-chart {
    min-height: 290px;
    padding-inline: 10px;
  }

  .line-chart-svg {
    height: 226px;
  }

  .distribution-visual {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .distribution-legend {
    width: 100%;
  }

  .registry-tools {
    grid-template-columns: 1fr 1fr;
  }

  .registry-tools > :first-child {
    grid-column: 1 / -1;
  }

  .registry-tools > button {
    width: 100%;
  }
}

@media (max-width: 440px) {
  .dashboard-metrics,
  .analytics-metrics {
    grid-template-columns: 1fr;
  }

  .dashboard-metrics .metric-card,
  .dashboard-metrics .metric-card:nth-last-child(-n + 2) {
    grid-column: auto;
  }

  .metric-card {
    min-height: 91px;
  }

  .dashboard-action-summary {
    grid-template-columns: 1fr;
  }

  .analytics-tools,
  .registry-tools {
    grid-template-columns: 1fr;
  }

  .analytics-tools > *,
  .registry-tools > * {
    grid-column: auto !important;
  }

  .dashboard-chart-legend {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .ui-motion-enabled .pw-reveal {
    opacity: 1;
    transform: none;
  }
}

/* Dense operational screens ------------------------------------------------ */

.editor-view .editor-surface,
.supplier-audit-registry,
.supplier-audit-editor,
.internal-audit-surface,
.references-surface,
.activity-log-surface {
  border-color: var(--pw-line);
  box-shadow: var(--pw-shadow-sm);
}

.editor-view .editor-surface,
.references-surface,
.activity-log-surface,
.internal-audit-surface {
  overflow: clip;
}

.editor-view .editor-surface {
  max-width: 1180px;
}

.editor-summary {
  min-height: 66px;
  padding: 13px 18px;
  border-bottom-color: var(--pw-line);
  background: var(--pw-surface-soft);
}

.editor-summary-meta span:not(.risk-badge) {
  min-height: 27px;
  border-color: var(--pw-line);
  border-radius: var(--pw-radius-sm);
  background: var(--pw-surface);
}

.editor-tabs {
  top: auto;
  z-index: 12;
  display: flex;
  gap: 2px;
  overflow-x: auto;
  padding: 0 18px;
  border-bottom: 1px solid var(--pw-line);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 20px rgba(18, 49, 62, 0.045);
  scrollbar-width: none;
}

.editor-tabs::-webkit-scrollbar {
  display: none;
}

.editor-tab {
  position: relative;
  flex: 1 0 132px;
  min-height: 50px;
  border: 0;
  border-radius: 0;
  padding: 0 13px;
  color: var(--pw-muted);
  background: transparent;
  font-size: 0.78rem;
  transition:
    color 160ms ease,
    background-color 160ms ease;
}

.editor-tab::after {
  position: absolute;
  right: 13px;
  bottom: 0;
  left: 13px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--pw-brand);
  content: "";
  opacity: 0;
  transform: scaleX(0.42);
  transition:
    opacity 170ms ease,
    transform 190ms var(--pw-ease);
}

.editor-tab:hover {
  color: var(--pw-ink);
  background: var(--pw-surface-soft);
}

.editor-tab.is-active,
.editor-tab[aria-selected="true"] {
  color: var(--pw-brand-strong);
  background: var(--pw-surface-tint);
  box-shadow: none;
}

.editor-tab.is-active::after,
.editor-tab[aria-selected="true"]::after {
  opacity: 1;
  transform: scaleX(1);
}

.report-form > .form-section,
.dialog-scroll-area > .form-section {
  grid-template-columns: 142px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
  border-bottom: 1px solid var(--pw-line);
  background: var(--pw-surface);
  transition:
    background-color 160ms ease,
    box-shadow 160ms ease;
}

.report-form > .form-section:focus-within,
.dialog-scroll-area > .form-section:focus-within {
  background: #fbfdfd;
  box-shadow: inset 3px 0 var(--pw-brand);
}

.report-form > .form-section > .section-label,
.dialog-scroll-area > .form-section > .section-label {
  position: sticky;
  top: 128px;
  align-self: start;
  grid-column: 1;
  padding: 4px 0 0 11px;
  border-left: 3px solid var(--pw-brand);
  color: var(--pw-brand-strong);
  font-size: 0.69rem;
  line-height: 1.45;
}

.report-form > .form-section > :not(.section-label),
.dialog-scroll-area > .form-section > :not(.section-label) {
  grid-column: 2;
  min-width: 0;
}

.form-grid {
  gap: 13px 14px;
}

.form-grid label,
.field-block,
.risk-grid label {
  gap: 6px;
}

.form-grid label > span,
.field-label,
.risk-grid label > span {
  color: var(--pw-ink-soft);
  font-size: 0.72rem;
  font-weight: 760;
}

.form-grid input,
.form-grid select,
.form-grid textarea,
.risk-grid input,
.risk-grid select,
.risk-grid textarea,
.field-block input,
.field-block select,
.field-block textarea {
  border-color: var(--pw-line-strong);
  border-radius: var(--pw-radius-sm);
  background: #ffffff;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    background-color 150ms ease;
}

.form-grid textarea,
.field-block textarea {
  line-height: 1.5;
}

.form-grid input:hover,
.form-grid select:hover,
.form-grid textarea:hover,
.risk-grid input:hover,
.risk-grid select:hover,
.risk-grid textarea:hover,
.field-block input:hover,
.field-block select:hover,
.field-block textarea:hover {
  border-color: #91aeb8;
}

.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus,
.risk-grid input:focus,
.risk-grid select:focus,
.risk-grid textarea:focus,
.field-block input:focus,
.field-block select:focus,
.field-block textarea:focus {
  border-color: var(--pw-brand);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(8, 127, 133, 0.12);
}

.form-actions,
.dialog-actions {
  gap: 8px;
  padding: 12px 18px;
  border-top-color: var(--pw-line);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 -8px 24px rgba(18, 49, 62, 0.045);
}

.form-status,
.dialog-status,
.activity-log-status,
.reference-status {
  border-radius: var(--pw-radius-sm);
  font-size: 0.84rem;
}

.attachment-tools input[type="file"] {
  border-color: var(--pw-line-strong);
  background: var(--pw-surface-soft);
}

.attachment-item {
  border-color: var(--pw-line);
  background: var(--pw-surface);
}

/* Supplier audits ---------------------------------------------------------- */

.supplier-audit-layout {
  grid-template-columns: minmax(0, 1.55fr) minmax(390px, 0.72fr);
  gap: 16px;
}

.supplier-audit-registry {
  min-width: 0;
  overflow: hidden;
}

.supplier-audit-editor {
  top: 86px;
  max-height: calc(100vh - 106px);
  border-top: 3px solid var(--pw-brand);
}

.supplier-audit-editor .surface-head.compact {
  position: sticky;
  top: 0;
  z-index: 14;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

.supplier-audit-tools {
  grid-template-columns: minmax(210px, 1fr) auto;
}

.supplier-audit-registry .table-wrap {
  max-height: min(52vh, 560px);
  overflow: auto;
}

.supplier-audit-registry table {
  min-width: 840px;
}

.supplier-invitation-panel {
  border-top-color: var(--pw-line);
  background: var(--pw-surface-soft);
}

.supplier-invitation-item {
  border-color: var(--pw-line);
  background: var(--pw-surface);
}

.supplier-audit-meta-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.supplier-audit-meta-card {
  border-color: var(--pw-line);
  border-radius: var(--pw-radius-sm);
  box-shadow: var(--pw-shadow-xs);
}

.supplier-audit-section {
  border: 0;
  border-top: 1px solid var(--pw-line);
  border-radius: 0;
  padding: 15px 0 0;
  background: transparent;
}

.supplier-checklist-list article {
  border-color: var(--pw-line);
  border-radius: var(--pw-radius-sm);
  background: var(--pw-surface);
}

/* Internal audits and templates ------------------------------------------ */

.internal-audit-surface .table-wrap {
  max-height: min(64vh, 650px);
  overflow: auto;
}

.internal-audit-surface table {
  min-width: 930px;
}

.workspace-dialog {
  border-color: var(--pw-line-strong);
  border-radius: var(--pw-radius);
  box-shadow: var(--pw-shadow-dialog);
}

.workspace-dialog::backdrop {
  background: rgba(7, 29, 38, 0.58);
  backdrop-filter: blur(4px);
}

.dialog-heading {
  min-height: 70px;
  padding: 14px 18px;
  border-bottom-color: var(--pw-line);
}

.dialog-heading h2 {
  font-size: 1.28rem;
}

.dialog-scroll-area {
  background: var(--pw-page);
  scrollbar-gutter: stable;
}

.internal-audit-tabs {
  top: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  padding-inline: 18px;
}

.internal-audit-form-panel {
  margin: 0;
  border: 0;
  border-bottom: 1px solid var(--pw-line);
  border-radius: 0;
  background: var(--pw-surface);
  overflow: visible;
}

.internal-audit-form-panel:focus-within {
  border-color: var(--pw-line);
}

.internal-audit-identification-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.internal-audit-source-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 0;
}

.internal-audit-source-grid fieldset {
  border-color: var(--pw-line);
  border-radius: var(--pw-radius-sm);
  background: var(--pw-surface-soft);
}

.internal-audit-checklist,
.internal-audit-findings {
  padding: 0;
}

.internal-review-area,
.internal-question-card,
.internal-finding-card,
.template-area-card,
.template-question-row {
  border-color: var(--pw-line);
  border-radius: var(--pw-radius-sm);
  box-shadow: var(--pw-shadow-xs);
}

.internal-review-area summary {
  min-height: 54px;
  background: var(--pw-surface-soft);
}

.internal-review-area[open] summary {
  border-bottom: 1px solid var(--pw-line);
  color: var(--pw-brand-strong);
}

.template-dialog-layout {
  grid-template-columns: 250px minmax(0, 1fr);
  background: var(--pw-surface);
}

.template-list-panel {
  border-right-color: var(--pw-line);
  background: var(--pw-surface-soft);
}

.template-list-item {
  position: relative;
  border-color: var(--pw-line);
  border-radius: var(--pw-radius-sm);
  box-shadow: var(--pw-shadow-xs);
}

.template-list-item:hover {
  transform: translateY(-1px);
  border-color: var(--pw-brand);
}

.template-list-item.is-selected,
.template-list-item[aria-current="true"] {
  border-color: rgba(8, 127, 133, 0.38);
  background: var(--pw-surface-tint);
  box-shadow: inset 3px 0 var(--pw-brand);
}

.template-builder-panel {
  padding: 20px;
}

.template-area-card {
  background: var(--pw-surface-soft);
}

/* References -------------------------------------------------------------- */

.references-surface > .surface-head {
  align-items: flex-start;
}

.reference-surface-head .surface-description {
  max-width: 720px;
  margin: 7px 0 0;
  color: var(--pw-muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.reference-layout {
  grid-template-columns: 264px minmax(0, 1fr);
  gap: 0;
  padding: 0;
  border-top: 1px solid var(--pw-line);
}

.reference-group-tabs {
  gap: 4px;
  padding: 16px;
  border-right: 1px solid var(--pw-line);
  background: var(--pw-surface-soft);
}

.reference-group-tab {
  position: relative;
  min-height: 44px;
  border-color: transparent;
  border-radius: var(--pw-radius-sm);
  background: transparent;
}

.reference-group-tab:hover {
  border-color: var(--pw-line);
  background: var(--pw-surface);
}

.reference-group-tab.is-active {
  border-color: rgba(8, 127, 133, 0.28);
  color: var(--pw-brand-strong);
  background: var(--pw-surface-tint);
  box-shadow: inset 3px 0 var(--pw-brand);
  transform: none;
}

.reference-group-tab:focus-visible {
  outline: 2px solid var(--pw-brand);
  outline-offset: 2px;
}

.reference-group-tab span {
  overflow: visible;
  line-height: 1.3;
  text-overflow: clip;
  white-space: normal;
}

.reference-workspace {
  min-width: 0;
  background: var(--pw-surface);
}

.reference-workspace-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 18px 15px;
}

.reference-workspace-head h3 {
  margin: 3px 0 0;
  color: var(--pw-ink);
  font-size: 1.12rem;
}

.reference-workspace-head > div > p:last-child {
  max-width: 760px;
  margin: 6px 0 0;
  color: var(--pw-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.reference-group-count {
  flex: 0 0 auto;
  border: 1px solid var(--pw-line);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--pw-ink-soft);
  background: var(--pw-surface-soft);
  font-size: 0.76rem;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
}

.reference-add-form {
  grid-template-columns: minmax(260px, 1fr) auto auto;
  align-items: end;
  min-width: 0;
  margin: 0 18px;
  border: 1px solid var(--pw-line);
  border-radius: var(--pw-radius);
  padding: 13px 14px;
  background: var(--pw-surface-soft);
}

.reference-add-value {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.reference-add-value > span:first-child {
  color: var(--pw-ink-soft);
  font-size: 0.76rem;
  font-weight: 760;
}

.reference-add-value small {
  color: var(--pw-muted);
  font-size: 0.7rem;
}

.reference-add-form .reference-active-check {
  min-height: 40px;
  border: 1px solid var(--pw-line);
  border-radius: var(--pw-radius-sm);
  padding: 0 12px;
  background: var(--pw-surface);
}

.reference-add-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
}

.reference-add-button img {
  width: 16px;
  height: 16px;
  filter: brightness(0) invert(1);
}

.reference-status {
  margin: 12px 18px 0;
}

.reference-admin-list {
  gap: 0;
  padding: 6px 18px 18px;
}

.reference-item {
  display: block;
  border: 0;
  border-bottom: 1px solid var(--pw-line);
  border-radius: 0;
  padding: 13px 0;
  background: transparent;
  transition: background-color 150ms ease, box-shadow 150ms ease;
}

.reference-item:hover {
  background: #fbfdfd;
}

.reference-item.is-inactive,
.reference-item.is-pending-inactive {
  opacity: 1;
  background: #fafbfb;
}

.reference-item.is-dirty {
  background: #fffbf2;
  box-shadow: inset 3px 0 var(--pw-warning);
}

.reference-item-fields {
  grid-template-columns: minmax(260px, 1fr) minmax(150px, auto) auto;
  align-items: end;
  gap: 12px;
  padding-inline: 12px;
}

.reference-value-field {
  min-width: 0;
}

.reference-item-state {
  display: grid;
  align-content: end;
  gap: 4px;
  min-height: 40px;
}

.reference-item-state .reference-toggle {
  min-height: 24px;
  margin: 0;
}

.reference-item-state .reference-toggle span {
  margin: 0;
}

.reference-unsaved-badge {
  color: #8a5a0e;
  font-size: 0.7rem;
  font-weight: 760;
  white-space: nowrap;
}

.reference-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.reference-item-actions button {
  min-height: 40px;
}

.reference-save:disabled {
  cursor: default;
  opacity: 0.5;
}

/* Activity journal -------------------------------------------------------- */

.activity-log-surface > .surface-head {
  display: grid;
  width: 100%;
  min-height: 0;
  padding: 0;
  gap: 0;
  align-items: stretch;
  justify-content: stretch;
  background: var(--pw-surface);
}

.activity-log-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 18px 18px;
}

.activity-log-heading h2 {
  margin-top: 2px;
}

.activity-log-description {
  max-width: 680px;
  margin: 5px 0 0;
  color: var(--pw-muted);
  font-size: 0.88rem;
}

.activity-log-result-count {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: auto auto;
  align-items: baseline;
  gap: 7px;
  min-width: 170px;
  padding: 9px 12px;
  border: 1px solid var(--pw-line);
  border-radius: var(--pw-radius-sm);
  background: var(--pw-surface-soft);
  color: var(--pw-muted);
}

.activity-log-result-count strong {
  color: var(--pw-ink);
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
}

.activity-log-result-count span {
  font-size: 0.76rem;
  font-weight: 700;
}

.activity-log-filters {
  grid-template-columns:
    minmax(220px, 1.5fr)
    minmax(120px, 0.7fr)
    minmax(150px, 0.9fr)
    minmax(148px, 0.8fr)
    minmax(148px, 0.8fr)
    auto;
  gap: 10px;
  padding: 14px 18px 16px;
  border-top: 1px solid var(--pw-line);
  background: var(--pw-surface-soft);
}

.activity-log-filters .search-control,
.activity-log-filters label {
  min-width: 0;
}

.activity-log-filters input,
.activity-log-filters select {
  width: 100%;
  min-width: 0;
}

.activity-log-filter-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.activity-log-filter-actions button {
  min-height: 40px;
}

.activity-log-table-wrap {
  border-top: 0;
}

.activity-log-table {
  min-width: 1120px;
  table-layout: fixed;
}

.activity-log-table th:first-child {
  width: 150px;
}

.activity-log-table th:nth-child(2) {
  width: 210px;
}

.activity-log-table th:nth-child(3) {
  width: 260px;
}

.activity-log-table th:nth-child(4) {
  width: 190px;
}

.activity-log-table tbody tr {
  cursor: pointer;
  transition: background-color 140ms ease;
}

.activity-log-table tbody tr:hover {
  background: #f7fafb;
}

.activity-log-table tbody tr:focus-visible {
  position: relative;
  z-index: 1;
  outline: 2px solid var(--pw-brand);
  outline-offset: -2px;
}

.activity-log-table td {
  height: 66px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.activity-log-date time {
  display: grid;
  gap: 2px;
}

.activity-log-date time strong {
  color: var(--pw-ink);
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
}

.activity-log-date time span {
  color: var(--pw-muted);
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
}

.activity-actor {
  display: flex !important;
  align-items: center;
  gap: 9px;
}

.activity-actor-avatar {
  display: inline-grid !important;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid #b9d8dd;
  border-radius: 50%;
  background: #e9f5f6;
  color: var(--pw-brand-strong);
  font-size: 0.66rem;
  font-weight: 800;
}

.activity-actor-avatar.is-system {
  border-color: #cad6dc;
  background: #eff3f5;
  color: var(--pw-ink-soft);
}

.activity-actor-copy {
  display: grid !important;
  min-width: 0;
  gap: 2px;
}

.activity-actor-copy strong,
.activity-actor-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-actor-copy span {
  color: var(--pw-muted);
  font-size: 0.73rem;
}

.activity-action-label,
.activity-entity-label {
  line-height: 1.35;
}

.activity-entity-id {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-log-summary {
  max-width: none;
}

.activity-summary-item {
  display: grid !important;
  grid-template-columns: minmax(105px, 0.42fr) minmax(0, 1fr);
  align-items: baseline;
  gap: 8px;
}

.activity-summary-item + .activity-summary-item {
  margin-top: 5px;
}

.activity-summary-key {
  color: var(--pw-muted);
  font-size: 0.7rem;
  font-weight: 750;
}

.activity-summary-value {
  min-width: 0;
  overflow: hidden;
  color: var(--pw-ink-soft);
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-summary-empty {
  color: var(--pw-muted);
  font-size: 0.8rem;
}

.activity-log-dialog-content {
  background: var(--pw-page);
}

.activity-log-detail-list,
.activity-log-metadata-list {
  border-color: var(--pw-line);
  border-radius: var(--pw-radius-sm);
  box-shadow: var(--pw-shadow-xs);
}

.activity-technical-value {
  display: inline-block;
  max-width: 100%;
  padding: 3px 6px;
  border-radius: 4px;
  background: #edf2f4;
  color: var(--pw-ink-soft);
  font-family: ui-monospace, "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.activity-log-retention-note {
  margin: 14px 0 0;
  color: var(--pw-muted);
  font-size: 0.76rem;
}

/* Scroll feedback --------------------------------------------------------- */

.table-wrap,
.dialog-scroll-area,
.audit-detail-scroll,
.supplier-audit-editor {
  position: relative;
}

.pw-scroll-region {
  background: var(--pw-surface);
}

.pw-scroll-region.is-scrolled-start {
  box-shadow: inset 12px 0 12px -12px rgba(16, 39, 49, 0.2);
}

.pw-scroll-region.has-scroll-end {
  box-shadow: inset -12px 0 12px -12px rgba(16, 39, 49, 0.2);
}

.pw-scroll-region.is-scrolled-start.has-scroll-end {
  box-shadow:
    inset 12px 0 12px -12px rgba(16, 39, 49, 0.2),
    inset -12px 0 12px -12px rgba(16, 39, 49, 0.2);
}

.pw-scroll-y.is-scrolled-top {
  box-shadow: inset 0 12px 12px -12px rgba(16, 39, 49, 0.2);
}

.pw-scroll-y.has-scroll-bottom {
  box-shadow: inset 0 -12px 12px -12px rgba(16, 39, 49, 0.2);
}

.pw-scroll-y.is-scrolled-top.has-scroll-bottom {
  box-shadow:
    inset 0 12px 12px -12px rgba(16, 39, 49, 0.2),
    inset 0 -12px 12px -12px rgba(16, 39, 49, 0.2);
}

.pw-scroll-region.pw-scroll-y.is-scrolled-start.has-scroll-end.is-scrolled-top.has-scroll-bottom {
  box-shadow:
    inset 12px 0 12px -12px rgba(16, 39, 49, 0.2),
    inset -12px 0 12px -12px rgba(16, 39, 49, 0.2),
    inset 0 12px 12px -12px rgba(16, 39, 49, 0.2),
    inset 0 -12px 12px -12px rgba(16, 39, 49, 0.2);
}

@media (max-width: 1320px) {
  .supplier-audit-layout {
    grid-template-columns: minmax(0, 1fr) minmax(370px, 0.7fr);
  }

  .internal-audit-identification-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .activity-log-filters {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .activity-log-filters > :first-child {
    grid-column: span 2;
  }
}

@media (max-width: 1180px) {
  .supplier-audit-layout {
    grid-template-columns: 1fr;
  }

  .supplier-audit-editor {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .supplier-audit-editor .surface-head.compact {
    position: static;
  }

  .reference-item {
    grid-template-columns: 1fr;
  }

  .activity-log-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .report-form > .form-section,
  .dialog-scroll-area > .form-section {
    grid-template-columns: 1fr;
    gap: 11px;
    padding: 15px;
  }

  .report-form > .form-section > .section-label,
  .dialog-scroll-area > .form-section > .section-label {
    position: static;
    grid-column: 1;
    padding-left: 9px;
  }

  .report-form > .form-section > :not(.section-label),
  .dialog-scroll-area > .form-section > :not(.section-label) {
    grid-column: 1;
  }

  .internal-audit-tabs {
    display: flex;
    padding-inline: 10px;
  }

  .internal-audit-identification-grid,
  .internal-audit-source-grid {
    grid-template-columns: 1fr;
  }

  .template-dialog-layout {
    grid-template-columns: 1fr;
  }

  .template-list-panel {
    max-height: 200px;
    border-right: 0;
    border-bottom: 1px solid var(--pw-line);
  }

  .template-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reference-layout {
    grid-template-columns: 1fr;
  }

  .reference-group-tabs {
    display: flex;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--pw-line);
    scrollbar-width: thin;
  }

  .reference-group-tab {
    flex: 0 0 220px;
  }

  .activity-log-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .activity-log-filters > :first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  .editor-tabs {
    top: auto;
    padding-inline: 8px;
  }

  .editor-tab {
    flex-basis: 118px;
    min-height: 46px;
  }

  .form-grid,
  .risk-grid,
  .supplier-audit-meta-grid,
  .internal-audit-answer-summary,
  .reference-add-form,
  .reference-item-fields,
  .activity-log-filters,
  .template-list,
  .template-area-fields,
  .template-question-row {
    grid-template-columns: 1fr;
  }

  .reference-add-form,
  .reference-item-fields {
    align-items: stretch;
  }

  .reference-workspace-head {
    align-items: flex-start;
    flex-direction: column;
    padding-inline: 13px;
  }

  .reference-add-form {
    margin-inline: 13px;
  }

  .reference-status {
    margin-inline: 13px;
  }

  .reference-admin-list {
    padding-inline: 13px;
  }

  .reference-item-fields {
    padding-inline: 5px;
  }

  .reference-item-state {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .reference-item-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reference-add-form button,
  .reference-item-fields button {
    width: 100%;
  }

  .activity-log-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
    padding: 16px 13px 14px;
  }

  .activity-log-description {
    font-size: 0.82rem;
  }

  .activity-log-result-count {
    width: 100%;
    min-width: 0;
    grid-template-columns: auto 1fr;
  }

  .activity-log-filters {
    padding: 13px;
  }

  .activity-log-filter-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .activity-log-filter-actions button {
    width: 100%;
  }

  .activity-log-status {
    margin-inline: 13px;
  }

  .activity-log-table-wrap {
    overflow: visible;
    padding: 12px;
    background: var(--pw-surface-soft);
  }

  .activity-log-table {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .activity-log-table thead {
    display: none;
  }

  .activity-log-table tbody {
    display: grid;
    gap: 10px;
  }

  .activity-log-table tbody tr {
    display: grid;
    overflow: hidden;
    border: 1px solid var(--pw-line);
    border-radius: var(--pw-radius-sm);
    background: var(--pw-surface);
    box-shadow: var(--pw-shadow-xs);
  }

  .activity-log-table td {
    display: grid;
    width: 100%;
    height: auto;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 10px;
    padding: 10px 11px;
    border-bottom: 1px solid var(--pw-line);
    white-space: normal;
  }

  .activity-log-table td:last-child {
    border-bottom: 0;
  }

  .activity-log-table td::before {
    content: attr(data-label);
    align-self: start;
    color: var(--pw-muted);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.025em;
    text-transform: uppercase;
  }

  .activity-log-table .activity-log-empty-row td {
    display: block;
    padding: 0;
  }

  .activity-log-table .activity-log-empty-row td::before {
    display: none;
  }

  .activity-log-date time,
  .activity-actor,
  .activity-log-table .activity-domain-badge,
  .activity-log-table .activity-action-label,
  .activity-log-table .activity-entity-label,
  .activity-log-table .activity-entity-id,
  .activity-log-summary > * {
    grid-column: 2;
  }

  .activity-summary-item {
    grid-template-columns: 1fr;
    gap: 1px;
  }

  .activity-summary-value {
    white-space: normal;
  }

  .activity-log-surface .registry-pagination {
    padding-inline: 13px;
  }

  .workspace-dialog {
    width: calc(100vw - 14px);
    max-height: calc(100vh - 14px);
  }

  .dialog-form,
  .activity-log-dialog-shell {
    max-height: calc(100vh - 16px);
  }

  .dialog-heading,
  .dialog-actions {
    padding-inline: 13px;
  }

  .dialog-actions {
    flex-wrap: wrap;
  }

  .dialog-actions > button {
    flex: 1 1 130px;
  }
}

/* Reports registry cascade consolidation --------------------------------- */

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.view-panel .report-registry-surface > .report-registry-head {
  min-height: 78px;
  align-items: center;
}

.view-panel .report-registry-surface .report-registry-table thead th {
  top: 0;
  height: 44px;
  padding: 9px 14px;
  background: #eef4f5;
}

.view-panel .report-registry-surface .report-registry-table tbody td {
  height: 66px;
  padding: 12px 14px;
}

@media (max-width: 760px) {
  .view-panel .report-registry-surface > .report-registry-head {
    align-items: flex-start;
  }

  .view-panel .report-registry-surface .report-registry-table-wrap {
    max-height: none;
    overflow: visible;
    padding: 10px;
    background: #f1f6f7;
  }

  .view-panel .report-registry-surface .report-registry-table {
    display: block;
    min-width: 0;
  }

  .view-panel .report-registry-surface .report-registry-table colgroup,
  .view-panel .report-registry-surface .report-registry-table thead {
    display: none;
  }

  .view-panel .report-registry-surface .report-registry-table tbody {
    display: grid;
    gap: 9px;
  }

  .view-panel .report-registry-surface .report-registry-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 7px 10px;
    min-width: 0;
    border: 1px solid #d5e1e4;
    border-radius: 8px;
    padding: 13px;
    background: #ffffff;
    box-shadow: 0 5px 14px rgba(20, 49, 61, 0.04);
  }

  .view-panel .report-registry-surface .report-registry-table tbody td {
    display: block;
    width: auto;
    height: auto;
    min-height: 0;
    border: 0;
    padding: 0;
  }
}
