/*
 * PlaneWise SGS operational interface
 * This file is intentionally loaded after styles.css. It consolidates the
 * product shell and shared components without changing business behavior.
 */

:root {
  --page: #eef3f6;
  --page-2: #f7f9fb;
  --rail: #10232c;
  --rail-soft: #193640;
  --surface: #ffffff;
  --surface-2: #f4f7f9;
  --surface-3: #eaf3f4;
  --field: #ffffff;
  --ink: #122330;
  --muted: #657985;
  --soft: #344a58;
  --line: #d6e0e5;
  --line-strong: #b8c8d0;
  --brand: #078b91;
  --brand-strong: #056a73;
  --violet: #606db5;
  --cobalt: #3b6fb6;
  --danger: #c74b43;
  --warning: #b87916;
  --success: #21845d;
  --shadow: 0 8px 24px rgba(18, 45, 60, 0.07);
  --shadow-soft: 0 4px 14px rgba(18, 45, 60, 0.055);
  --shadow-raised: 0 24px 64px rgba(15, 35, 46, 0.22);
  --focus-ring: 0 0 0 3px rgba(7, 139, 145, 0.17);
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
}

html {
  background: var(--page);
}

body {
  min-width: 320px;
  background: var(--page);
  font-family: "Segoe UI Variable", "Aptos", "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  text-rendering: optimizeLegibility;
}

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

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

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

.side-rail {
  z-index: 40;
  gap: 12px;
  padding: 16px 13px 13px;
  color: #f8fbfc;
  background: var(--rail);
  border-right: 1px solid #29434e;
  box-shadow: 8px 0 30px rgba(15, 35, 44, 0.08);
}

.brand-block {
  min-height: 52px;
  padding: 0 6px 12px;
  border-bottom: 1px solid rgba(216, 232, 236, 0.14);
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-color: rgba(135, 224, 220, 0.4);
  border-radius: 7px;
  background: #15515c;
  box-shadow: 0 8px 20px rgba(2, 20, 27, 0.2);
  font-size: 0.82rem;
}

.brand-block strong {
  font-size: 0.98rem;
}

.brand-block span,
.tenant-card span {
  color: #aebfc5;
  font-size: 0.7rem;
}

.rail-close-button,
.mobile-nav-button,
.nav-scrim {
  display: none;
}

.module-nav {
  min-height: 0;
  gap: 3px;
  overflow-y: auto;
  padding: 0 3px 4px;
  scrollbar-color: #425b65 transparent;
  scrollbar-width: thin;
}

.nav-section-label {
  display: block;
  margin: 13px 9px 5px;
  color: #82979f;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-section-label:first-child {
  margin-top: 2px;
}

.module-link {
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 8px;
  min-height: 40px;
  border-radius: 6px;
  padding: 0 9px;
  color: #d8e3e7;
  font-size: 0.84rem;
  font-weight: 700;
  transition:
    color 160ms ease,
    background 160ms ease,
    border-color 160ms ease,
    transform 160ms var(--ease-out);
}

.module-link:not(.disabled):hover {
  transform: translateX(2px);
  border-color: rgba(137, 203, 203, 0.2);
  background: var(--rail-soft);
  color: #ffffff;
}

.module-link.active {
  border-color: #416b76;
  background: #21434d;
  color: #ffffff;
  box-shadow: inset 3px 0 #66d2ce, 0 6px 18px rgba(2, 18, 24, 0.12);
}

.nav-glyph {
  width: 26px;
  height: 26px;
  border: 1px solid rgba(202, 224, 229, 0.1);
  border-radius: 6px;
  background: #21363e;
  color: #9fdedb;
  font-size: 0.62rem;
}

.nav-glyph img {
  width: 15px;
  height: 15px;
  filter: invert(86%) sepia(16%) saturate(772%) hue-rotate(127deg);
}

.module-link.active .nav-glyph {
  border-color: rgba(133, 223, 218, 0.3);
  background: #1b565d;
  color: #ffffff;
  transform: translateX(1px);
}

.module-link.active .nav-glyph img {
  filter: brightness(0) invert(1);
}

.module-link.disabled {
  margin-top: 10px;
  border-top: 1px solid rgba(216, 232, 236, 0.12);
  border-radius: 0;
  padding-top: 8px;
  opacity: 0.46;
}

.tenant-card {
  border-color: rgba(191, 218, 224, 0.16);
  border-radius: 8px;
  padding: 12px;
  background: #17313a;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.03);
}

.tenant-card strong {
  margin-top: 4px;
  font-size: 0.82rem;
  line-height: 1.35;
}

.tenant-account-link {
  margin-top: 10px;
  color: #86d8d4;
  font-size: 0.72rem;
}

.tenant-legal-links {
  margin-top: 7px;
  font-size: 0.62rem;
}

.workspace {
  min-height: 100vh;
  padding: 26px clamp(20px, 2.4vw, 40px) 44px;
}

.workspace-header {
  position: sticky;
  top: 0;
  z-index: 18;
  align-items: center;
  margin: -26px 0 22px;
  padding: 21px 0 15px;
  border-bottom: 1px solid rgba(183, 199, 204, 0.75);
  background: rgba(238, 243, 246, 0.92);
  box-shadow: 0 8px 18px rgba(27, 55, 67, 0.025);
  backdrop-filter: blur(18px) saturate(130%);
}

.workspace-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.title-stack {
  min-width: 0;
}

.eyebrow {
  margin-bottom: 5px;
  color: var(--brand-strong);
  font-size: 0.66rem;
  letter-spacing: 0;
}

h1 {
  color: #102734;
  font-size: 1.92rem;
  font-weight: 760;
  line-height: 1.12;
}

h2 {
  font-size: 1.05rem;
  font-weight: 740;
}

h3 {
  font-size: 0.96rem;
}

.header-actions {
  flex: 0 0 auto;
}

.environment-pill {
  min-height: 32px;
  border-color: rgba(80, 98, 169, 0.25);
  padding: 0 11px;
  color: #42518e;
  background: #f1f3fb;
  font-size: 0.75rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.secondary-button,
.primary-button,
.danger-button {
  min-height: 40px;
  border-radius: 7px;
  padding: 0 14px;
  font-size: 0.82rem;
  font-weight: 750;
  box-shadow: none;
  transition:
    color 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    transform 160ms var(--ease-out);
}

.secondary-button {
  border-color: var(--line-strong);
  background: #ffffff;
}

.primary-button {
  border-color: var(--brand-strong);
  background: var(--brand);
  box-shadow: 0 5px 14px rgba(7, 139, 145, 0.17);
}

.danger-button {
  border-color: rgba(189, 67, 61, 0.34);
  background: #fff8f7;
}

.secondary-button:hover,
.primary-button:hover,
.danger-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(24, 50, 60, 0.1);
}

.secondary-button:active,
.primary-button:active,
.danger-button:active {
  transform: translateY(0);
}

.secondary-button:hover {
  border-color: #829aa2;
  background: #f8fafb;
}

.primary-button:hover {
  border-color: var(--brand-strong);
  background: var(--brand-strong);
}

.dashboard-overview-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 16px;
}

.dashboard-overview-head .eyebrow {
  margin-bottom: 3px;
}

.dashboard-overview-head h2 {
  color: #0f2936;
  font-size: 1.38rem;
}

.dashboard-overview-actions,
.dashboard-head-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.dashboard-new-report {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.dashboard-new-report img {
  width: 16px;
  height: 16px;
  filter: brightness(0) invert(1);
}

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

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

.metric-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  width: 100%;
  min-height: 130px;
  overflow: hidden;
  border: 1px solid #dbe4e7;
  border-top-width: 1px;
  border-radius: 8px;
  padding: 18px 17px;
  background: #ffffff;
  color: inherit;
  font: inherit;
  text-align: left;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  animation: metric-card-in 280ms var(--ease-out) both;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: #c7d8dc;
  box-shadow: 0 13px 28px rgba(24, 50, 60, 0.095);
}

.metric-card:focus-visible {
  outline: 3px solid rgba(17, 136, 143, 0.28);
  outline-offset: 2px;
  border-color: #58aeb2;
}

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

.metric-card::after {
  right: 14px;
  bottom: 0;
  left: auto;
  width: 54px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  opacity: 0.8;
}

.metric-card .metric-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin: 0;
  border-radius: 8px;
  border: 1px solid rgba(48, 121, 128, 0.08);
  background: #e9f6f6;
  transition:
    transform 180ms var(--ease-out),
    box-shadow 180ms ease;
}

.metric-card .metric-icon img {
  width: 21px;
  height: 21px;
  transition: transform 180ms ease;
}

.metric-card:hover .metric-icon {
  transform: translateY(-2px);
  box-shadow: 0 7px 15px rgba(24, 50, 60, 0.08);
}

.metric-card:hover .metric-icon img {
  transform: scale(1.06);
}

.metric-card .metric-content {
  display: grid;
  gap: 4px;
  min-width: 0;
  margin: 0;
}

.metric-card .metric-label {
  margin: 0;
  color: #617179;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.25;
  text-transform: uppercase;
}

.metric-card strong {
  color: #102a36;
  font-size: 1.9rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.08;
}

.metric-card small {
  color: #738188;
  font-size: 0.7rem;
  line-height: 1.25;
}

.metric-card.open {
  color: #159ca1;
}

.metric-card.risk {
  color: #d5604e;
}

.metric-card.overdue {
  color: #d59122;
}

.metric-card.audit {
  color: #507cc2;
}

.metric-card.closed {
  color: #2d9468;
}

.metric-card.open .metric-icon {
  background: #e5f6f6;
}

.metric-card.risk .metric-icon {
  background: #fff0ed;
}

.metric-card.overdue .metric-icon {
  background: #fff5df;
}

.metric-card.audit .metric-icon {
  background: #edf3fc;
}

.metric-card.closed .metric-icon {
  background: #e8f6ef;
}

.metric-card .metric-icon img {
  filter: invert(48%) sepia(54%) saturate(1000%) hue-rotate(134deg);
}

.metric-card.risk .metric-icon img {
  filter: invert(49%) sepia(73%) saturate(749%) hue-rotate(322deg);
}

.metric-card.overdue .metric-icon img {
  filter: invert(57%) sepia(79%) saturate(531%) hue-rotate(358deg);
}

.metric-card.audit .metric-icon img {
  filter: invert(48%) sepia(32%) saturate(1126%) hue-rotate(176deg);
}

.metric-card.closed .metric-icon img {
  filter: invert(49%) sepia(21%) saturate(1338%) hue-rotate(102deg);
}

.dashboard-action-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-areas: none;
  gap: 14px;
}

.dashboard-priorities,
.dashboard-trend {
  grid-area: auto;
  grid-column: span 8;
}

.dashboard-deadlines,
.dashboard-recent {
  grid-area: auto;
  grid-column: span 4;
}

.surface {
  border-color: #d9e3e7;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.surface-head,
.chart-card-head {
  min-height: 68px;
  padding: 15px 17px;
  background: #ffffff;
}

.surface-head {
  align-items: center;
}

.surface-head .eyebrow,
.chart-card-head .eyebrow {
  margin-bottom: 4px;
}

.dashboard-count {
  min-height: 27px;
  border-radius: 999px;
  padding: 5px 9px;
  color: #53656d;
  background: #eef3f4;
  font-size: 0.68rem;
}

.dashboard-section-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 32px;
  border: 0;
  padding: 0 2px 0 7px;
  color: var(--brand-strong);
  background: transparent;
  font-size: 0.74rem;
  font-weight: 800;
  cursor: pointer;
  transition:
    color 150ms ease,
    transform 150ms var(--ease-out);
}

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

.dashboard-section-link img {
  width: 16px;
  height: 16px;
  filter: invert(36%) sepia(61%) saturate(786%) hue-rotate(134deg);
}

.dashboard-work-columns {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) 104px 118px 122px 20px;
  gap: 12px;
  padding: 9px 16px;
  border-top: 1px solid #e3eaec;
  border-bottom: 1px solid #e3eaec;
  color: #7a898f;
  background: #f8fafb;
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
}

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

.dashboard-work-item,
.dashboard-deadline-item,
.dashboard-recent-item {
  animation: dashboard-row-in 340ms both;
  transition:
    background 140ms ease,
    box-shadow 140ms ease;
}

.dashboard-work-item:hover,
.dashboard-deadline-item:hover,
.dashboard-recent-item:hover {
  background: #f3f8f8;
  box-shadow: inset 3px 0 #3d9ba0;
}

.dashboard-work-item:nth-child(2),
.dashboard-deadline-item:nth-child(2),
.dashboard-recent-item:nth-child(2) {
  animation-delay: 45ms;
}

.dashboard-work-item:nth-child(3),
.dashboard-deadline-item:nth-child(3),
.dashboard-recent-item:nth-child(3) {
  animation-delay: 90ms;
}

.dashboard-work-item:nth-child(4),
.dashboard-deadline-item:nth-child(4),
.dashboard-recent-item:nth-child(4) {
  animation-delay: 135ms;
}

.dashboard-work-item:nth-child(5),
.dashboard-deadline-item:nth-child(5),
.dashboard-recent-item:nth-child(5) {
  animation-delay: 180ms;
}

.dashboard-work-item {
  grid-template-columns: minmax(210px, 1fr) 104px 118px 122px 20px;
  gap: 12px;
  min-height: 67px;
  padding: 10px 16px;
}

.dashboard-work-item.is-overdue {
  box-shadow: inset 3px 0 var(--danger);
}

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

.dashboard-work-heading strong {
  color: #17343f;
  font-size: 0.8rem;
}

.dashboard-work-summary {
  overflow: hidden;
  color: #41545c;
  font-size: 0.74rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-work-main small {
  color: #819096;
  font-size: 0.65rem;
}

.dashboard-priority-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: fit-content;
  max-width: 104px;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 0.65rem;
  font-weight: 800;
  white-space: nowrap;
}

.dashboard-priority-badge strong {
  font-size: 0.72rem;
}

.dashboard-work-item .status-badge {
  width: fit-content;
  max-width: 116px;
  overflow: hidden;
  padding: 5px 8px;
  font-size: 0.64rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-work-deadline {
  color: #5f7077;
  font-size: 0.68rem;
  font-weight: 700;
}

.dashboard-work-deadline.is-overdue {
  color: var(--danger);
}

.dashboard-row-arrow {
  display: grid;
  place-items: center;
}

.dashboard-row-arrow img {
  width: 17px;
  height: 17px;
  opacity: 0.45;
  transition:
    opacity 140ms ease,
    transform 140ms ease;
}

.dashboard-work-item:hover .dashboard-row-arrow img,
.dashboard-deadline-item:hover .dashboard-row-arrow img,
.dashboard-recent-item:hover .dashboard-row-arrow img {
  opacity: 0.82;
  transform: translateX(3px);
}

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

.dashboard-action-stat {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 82px;
  border: 1px solid #dce5e8;
  border-radius: 8px;
  padding: 14px;
  background: #f9fbfc;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms var(--ease-out);
}

.dashboard-action-stat:first-child {
  padding-left: 14px;
}

.dashboard-action-stat:last-child {
  padding-right: 14px;
}

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

.dashboard-action-stat:hover {
  transform: translateY(-2px);
  border-color: #c6d7dc;
  box-shadow: var(--shadow-soft);
}

.dashboard-action-stat-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
}

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

.dashboard-action-stat:hover .dashboard-action-stat-icon {
  transform: translateY(-2px);
  box-shadow: 0 7px 15px rgba(24, 50, 60, 0.08);
}

.dashboard-action-stat-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.dashboard-action-stat-copy > span {
  color: #6a7a81;
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.dashboard-action-stat strong {
  color: #17343f;
  font-size: 1.55rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.dashboard-action-stat small {
  overflow: hidden;
  color: #74838a;
  font-size: 0.68rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-action-stat.is-late .dashboard-action-stat-icon {
  background: #fff0ed;
}

.dashboard-action-stat.is-late .dashboard-action-stat-icon img {
  filter: invert(48%) sepia(67%) saturate(929%) hue-rotate(322deg);
}

.dashboard-action-stat.is-week .dashboard-action-stat-icon {
  background: #fff5df;
}

.dashboard-action-stat.is-week .dashboard-action-stat-icon img {
  filter: invert(57%) sepia(79%) saturate(531%) hue-rotate(358deg);
}

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

.dashboard-deadline-item {
  padding-inline: 4px;
}

.dashboard-deadline-copy strong,
.dashboard-recent-item strong {
  font-size: 0.8rem;
}

.dashboard-deadline-copy span {
  color: #4d5f66;
  font-size: 0.72rem;
}

.dashboard-chart-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: end;
  gap: 10px;
}

.dashboard-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #64757c;
  font-size: 0.66rem;
  font-weight: 750;
}

.dashboard-chart-legend i {
  width: 15px;
  height: 3px;
  border-radius: 3px;
  background: #149ca0;
}

.dashboard-chart-legend i.is-progress {
  background: #4f77bd;
}

.dashboard-chart-legend i.is-closed {
  background: #32a36f;
}

.dashboard-trend .line-chart {
  position: relative;
  height: 300px;
  overflow: hidden;
  padding: 20px 22px 16px;
}

.metric-card:nth-child(2) {
  animation-delay: 24ms;
}

.metric-card:nth-child(3) {
  animation-delay: 48ms;
}

.metric-card:nth-child(4) {
  animation-delay: 72ms;
}

.metric-card:nth-child(5) {
  animation-delay: 96ms;
}

@keyframes metric-card-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

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

.dashboard-trend-chart {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
}

.dashboard-trend-chart canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

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

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

.dashboard-trend-svg {
  display: block;
  width: 100%;
  aspect-ratio: 4.2 / 1;
  min-height: 205px;
  overflow: visible;
}

.dashboard-trend-grid {
  stroke: #dbe4e7;
  stroke-width: 1;
  stroke-dasharray: 4 7;
  vector-effect: non-scaling-stroke;
}

.dashboard-trend-grid-label {
  fill: #78878d;
  font-size: 12px;
  font-weight: 750;
  text-anchor: end;
}

.dashboard-trend-path {
  fill: none;
  stroke: #149ca0;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.dashboard-trend-path.is-progress {
  stroke: #4f77bd;
}

.dashboard-trend-path.is-closed {
  stroke: #32a36f;
}

.dashboard-trend-point {
  fill: #ffffff;
  stroke: #149ca0;
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}

.dashboard-trend-point.is-progress {
  stroke: #4f77bd;
}

.dashboard-trend-point.is-closed {
  stroke: #32a36f;
}

.dashboard-trend-axis {
  display: grid;
  gap: 8px;
  padding: 2px 18px 0 42px;
}

.dashboard-trend-axis span {
  overflow: hidden;
  color: #75858b;
  font-size: 0.68rem;
  font-weight: 750;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-priority-badge,
.status-badge,
.status-pill,
.risk-badge {
  border-radius: 999px;
}

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

.analytics-head {
  align-items: end;
}

.analytics-tools {
  grid-template-columns: 112px 112px 112px 132px 132px;
}

.analytics-range-note {
  border-top: 0;
  background: #f0f5f6;
  color: #52656d;
}

.analytics-grid {
  gap: 12px;
}

.chart-card-head {
  border-bottom: 1px solid var(--line);
}

.line-chart,
.analytics-line-chart {
  padding: 15px 16px 12px;
}

.distribution-chart {
  padding: 14px 16px 16px;
}

.distribution-legend-row {
  border-bottom-color: #edf1f2;
}

.work-grid {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
  gap: 14px;
}

.surface-head {
  min-height: 70px;
}

.registry-tools {
  grid-template-columns: minmax(210px, 270px) 112px 112px auto auto;
  gap: 8px;
}

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

.search-control span,
.select-control span,
.report-form span,
.section-label {
  color: #5a6b73;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0;
}

.search-control input,
.select-control select,
.report-form input,
.report-form select,
.report-form textarea {
  border-color: var(--line-strong);
  border-radius: 7px;
  padding: 10px 11px;
  background: #ffffff;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease;
}

.search-control input:hover,
.select-control select:hover,
.report-form input:hover,
.report-form select:hover,
.report-form textarea:hover {
  border-color: #91a8b1;
}

.search-control input::placeholder,
.report-form input::placeholder,
.report-form textarea::placeholder {
  color: #8a9ba2;
}

.search-control input:focus,
.select-control select:focus,
.report-form input:focus,
.report-form select:focus,
.report-form textarea:focus {
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}

.table-wrap {
  scrollbar-color: #a8bcc1 #eef3f4;
  scrollbar-width: thin;
}

table {
  font-size: 0.84rem;
}

th,
td {
  padding: 11px 14px;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: #56676f;
  background: #eef3f4;
  font-size: 0.66rem;
  letter-spacing: 0;
}

tbody tr[data-report-id],
tbody tr[data-supplier-audit-id],
tbody tr[data-internal-audit-id],
tbody tr[data-activity-log-id] {
  transition:
    background 140ms ease,
    box-shadow 140ms ease;
}

tbody tr[data-report-id]:hover,
tbody tr[data-supplier-audit-id]:hover,
tbody tr[data-internal-audit-id]:hover,
tbody tr[data-activity-log-id]:hover {
  background: #f0f7f7;
}

tbody tr.is-selected {
  background: #e7f3f3;
  box-shadow: inset 3px 0 var(--brand);
}

.sort-indicator {
  min-width: 24px;
  border-radius: 4px;
  padding: 1px 4px;
  font-size: 0.55rem;
}

.reference-cell {
  color: #15343b;
}

.registry-pagination {
  min-height: 52px;
  padding: 9px 14px;
  background: #fbfcfc;
}

.pagination-icon-button,
.dialog-close-button,
.danger-icon-button {
  border-radius: 6px;
}

.report-detail-dialog,
.workspace-dialog {
  border: 1px solid rgba(205, 219, 225, 0.9);
  border-radius: 8px;
  box-shadow: var(--shadow-raised);
}

.workspace-dialog::backdrop,
.report-detail-dialog::backdrop {
  background: rgba(12, 27, 34, 0.58);
  backdrop-filter: blur(3px);
}

.workspace-dialog[open],
.report-detail-dialog[open] {
  animation: dialog-enter 220ms var(--ease-out) both;
}

.workspace-dialog[open]::backdrop,
.report-detail-dialog[open]::backdrop {
  animation: dialog-backdrop-enter 180ms ease both;
}

.report-detail-heading,
.dialog-heading,
.dialog-actions {
  padding: 14px 16px;
}

.report-detail-heading {
  background: #fbfcfc;
}

.detail-grid div {
  padding: 12px 16px;
}

.detail-grid dt {
  font-size: 0.66rem;
  letter-spacing: 0;
}

.detail-grid dd {
  color: #2e424a;
  font-size: 0.86rem;
}

.history-panel,
.activity-log-dialog-content,
.dialog-scroll-area {
  background: #f4f7f8;
}

.history-item,
.activity-log-detail-list,
.activity-log-metadata-list,
.internal-audit-form-panel,
.internal-review-area,
.internal-question-card,
.internal-finding-card {
  border-radius: 6px;
  box-shadow: none;
}

.supplier-audit-layout {
  gap: 14px;
}

.supplier-invitation-panel,
.supplier-audit-section,
.internal-audit-detail-section,
.reference-admin-surface {
  border-color: var(--line);
}

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

.editor-summary {
  padding: 12px 16px;
  background: #fbfcfc;
}

.editor-tabs {
  gap: 6px;
  padding: 10px 16px;
  background: rgba(247, 249, 250, 0.96);
}

.editor-tab {
  min-height: 35px;
  border-radius: 6px;
  font-size: 0.72rem;
  transition:
    color 150ms ease,
    border-color 150ms ease,
    background 150ms ease,
    transform 150ms var(--ease-out);
}

.editor-tab:not(.is-active):hover {
  transform: translateY(-1px);
  border-color: #a9bec5;
  background: #ffffff;
}

.editor-tab.is-active {
  border-color: var(--brand);
  background: var(--brand);
  box-shadow: none;
}

.form-section {
  gap: 11px;
  padding: 16px;
}

.form-actions {
  padding: 12px 16px;
}

.form-status {
  border-radius: 6px;
}

.attachment-item,
.aircraft-group,
.aircraft-report-card,
.internal-finding-detail-list article {
  border-radius: 6px;
}

.reference-group-tabs,
.internal-audit-tabs {
  scrollbar-color: #a8bcc1 transparent;
  scrollbar-width: thin;
}

.activity-log-filters {
  gap: 8px;
}

.activity-log-filters input[type="date"] {
  min-width: 132px;
}

.empty-state {
  color: var(--muted);
}

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

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

@keyframes view-enter {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

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

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

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

@keyframes dialog-backdrop-enter {
  from {
    background: rgba(12, 27, 34, 0);
    backdrop-filter: blur(0);
  }

  to {
    background: rgba(12, 27, 34, 0.58);
    backdrop-filter: blur(3px);
  }
}

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

  .analytics-tools {
    grid-template-columns: repeat(3, minmax(112px, 1fr));
  }

  .registry-tools {
    grid-template-columns: minmax(200px, 1fr) 112px 112px;
  }

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

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

  .side-rail {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    grid-template-columns: none;
    align-items: stretch;
  }

  .module-nav {
    grid-template-columns: 1fr;
  }

  .tenant-card {
    margin-top: auto;
  }

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

  .dashboard-priorities,
  .dashboard-trend {
    grid-column: 1 / -1;
  }

  .dashboard-deadlines,
  .dashboard-recent {
    grid-column: auto;
  }
}

@media (max-width: 900px) {
  body.nav-open {
    overflow: hidden;
  }

  .product-shell {
    display: block;
  }

  .side-rail {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(290px, calc(100vw - 48px));
    height: 100dvh;
    transform: translateX(-102%);
    transition: transform 190ms ease;
    box-shadow: var(--shadow-raised);
  }

  body.nav-open .side-rail {
    transform: translateX(0);
  }

  .rail-close-button,
  .mobile-nav-button {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    color: var(--ink);
    background: #ffffff;
    font-size: 1.15rem;
    line-height: 1;
  }

  .rail-close-button {
    margin-left: auto;
    border-color: rgba(218, 232, 236, 0.2);
    color: #dce8eb;
    background: #20353d;
  }

  .nav-scrim {
    position: fixed;
    inset: 0;
    z-index: 35;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(12, 27, 34, 0.48);
  }

  body.nav-open .nav-scrim {
    display: block;
  }

  .workspace {
    padding: 20px 18px 34px;
  }

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

  .work-grid,
  .supplier-audit-layout {
    grid-template-columns: 1fr;
  }

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

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

  .workspace-header {
    align-items: center;
    flex-direction: row;
    gap: 10px;
    margin-bottom: 14px;
  }

  .workspace-title-group {
    flex: 1 1 auto;
  }

  .title-stack .eyebrow {
    display: none;
  }

  h1 {
    overflow: hidden;
    font-size: 1.3rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .header-actions {
    gap: 6px;
  }

  .environment-pill {
    display: none;
  }

  .header-actions .secondary-button {
    min-width: 38px;
    width: 38px;
    padding: 0;
    overflow: hidden;
    color: transparent;
    white-space: nowrap;
  }

  .header-actions .secondary-button::before {
    content: "\21BB";
    display: grid;
    place-items: center;
    color: var(--ink);
    font-size: 1.08rem;
  }

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

  .metric-card {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 9px;
    min-height: 102px;
    padding: 13px 11px;
  }

  .metric-card .metric-icon {
    width: 34px;
    height: 34px;
    margin: 0;
  }

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

  .metric-card .metric-content {
    gap: 3px;
    margin: 0;
  }

  .metric-card .metric-label {
    margin: 0;
    font-size: 0.58rem;
  }

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

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

  .dashboard-overview-head {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .dashboard-overview-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .dashboard-overview-actions button {
    justify-content: center;
    width: 100%;
  }

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

  .dashboard-priorities,
  .dashboard-trend,
  .dashboard-deadlines,
  .dashboard-recent {
    grid-column: auto;
  }

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

  .dashboard-work-item {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "main arrow"
      "priority status"
      "deadline deadline";
    row-gap: 8px;
    min-height: 0;
    padding: 13px 14px;
  }

  .dashboard-work-main {
    grid-area: main;
  }

  .dashboard-priority-badge {
    grid-area: priority;
  }

  .dashboard-work-item .status-badge {
    grid-area: status;
    justify-self: end;
  }

  .dashboard-work-deadline {
    grid-area: deadline;
  }

  .dashboard-row-arrow {
    grid-area: arrow;
  }

  .dashboard-trend .line-chart {
    height: 260px;
    overflow: hidden;
    padding: 14px 12px 12px;
  }

  .dashboard-chart-legend {
    justify-content: start;
  }

  .surface-head,
  .analytics-head {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .analytics-tools,
  .registry-tools,
  .aircraft-tools,
  .supplier-audit-tools,
  .internal-audit-tools,
  .activity-log-filters {
    grid-template-columns: 1fr 1fr;
  }

  .analytics-tools > :first-child,
  .registry-tools > :first-child,
  .aircraft-tools > :first-child,
  .supplier-audit-tools > :first-child,
  .internal-audit-tools > :first-child,
  .activity-log-filters > :first-child {
    grid-column: 1 / -1;
  }

  .registry-tools .export-button,
  .activity-log-filters button {
    width: 100%;
  }

  .table-wrap {
    margin-inline: -1px;
  }

  th,
  td {
    padding: 10px 12px;
  }

  .editor-tabs,
  .internal-audit-tabs {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }

  .editor-tab,
  .internal-audit-tabs .editor-tab {
    flex: 0 0 auto;
    min-width: 132px;
    scroll-snap-align: start;
  }

  .report-detail-dialog,
  .workspace-dialog {
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .report-detail-actions {
    grid-template-columns: 1fr 1fr 36px 36px;
  }

  .audit-detail-dialog .report-detail-heading {
    position: relative;
  }

  .audit-detail-dialog .report-detail-heading > div:first-child {
    padding-right: 48px;
  }

  .audit-detail-dialog .report-detail-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .audit-detail-dialog .report-detail-actions .dialog-close-button {
    position: absolute;
    top: 14px;
    right: 14px;
  }

  .detail-grid,
  .form-grid,
  .risk-grid {
    grid-template-columns: 1fr;
  }

  .detail-grid div:nth-child(odd) {
    border-right: 0;
  }

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

  .form-actions .danger-button {
    margin-right: auto;
  }
}

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

  .dashboard-metrics .metric-card:last-child {
    grid-column: 1 / -1;
  }

  .dashboard-action-summary {
    margin-inline: 14px;
  }

  .dashboard-action-stat {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 8px;
    padding-inline: 10px;
  }

  .dashboard-action-stat:first-child {
    padding-left: 10px;
  }

  .dashboard-action-stat:last-child {
    padding-right: 10px;
  }

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

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

  .dashboard-action-stat strong {
    font-size: 1.35rem;
  }

  .dashboard-action-stat small {
    font-size: 0.61rem;
  }

  .analytics-tools,
  .registry-tools,
  .aircraft-tools,
  .supplier-audit-tools,
  .internal-audit-tools,
  .activity-log-filters {
    grid-template-columns: 1fr;
  }

  .analytics-tools > :first-child,
  .registry-tools > :first-child,
  .aircraft-tools > :first-child,
  .supplier-audit-tools > :first-child,
  .internal-audit-tools > :first-child,
  .activity-log-filters > :first-child {
    grid-column: auto;
  }

  .report-detail-actions {
    grid-template-columns: 1fr 1fr;
  }

  .audit-detail-dialog .report-detail-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-detail-actions .risk-badge,
  .report-detail-actions .dialog-close-button {
    justify-self: end;
  }
}

@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;
  }
}
