/* Shared overview and task schedule canvas. Editors retain their own layout. */
body[data-active-view="maintenance"]:not(.auth-locked) {
  --maintenance-canvas-space: clamp(18px, 2vw, 32px);
  & .workspace-global-header { background: #fff; box-shadow: none; }
  & .workspace-global-title h1 { font-size: clamp(28px, 2.6vw, 40px); line-height: 1.2; letter-spacing: -0.025em; }
  & .workspace-global-title p { color: #526777; line-height: 1.5; }
}

/* Match the bounded application shell without disabling content scrolling. */
body[data-active-view="maintenance"]:not(.auth-locked) .view-panel.active[data-view-panel="maintenance"] {
  height: 100% !important;
  min-height: 0 !important;
  padding: var(--maintenance-canvas-space) !important;
  border: 0;
  border-radius: 0 !important;
  background: #fff !important;
  box-shadow: none !important;
}
body[data-active-view="maintenance"]:not(.auth-locked).modal-open .view-panel.active[data-view-panel="maintenance"] { overflow: hidden !important; }

body[data-active-view="maintenance"]:not(.auth-locked) .maintenance-section[data-view-panel="maintenance"] {
  & .maintenance-workspace-shell { gap: 22px; min-width: 0; }
  & .maintenance-workspace-nav { gap: 16px; padding: 0 0 8px; border-bottom: 1px solid #e2eaee; background: #fff; box-shadow: none; }
  & .maintenance-subnav { gap: 4px; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
  & .maintenance-subtab {
    min-height: 48px; padding: 10px 16px; border: 0; border-bottom: 2px solid transparent;
    border-radius: 0; background: transparent; box-shadow: none; color: #526777; font-size: 15px;
  }
  & .maintenance-subtab.active { color: #007c8e; border-bottom-color: #007c8e; background: transparent; box-shadow: none; }
  & .maintenance-quick-actions .primary-button {
    min-height: 44px; padding: 10px 18px; border-radius: 8px; background: #007c8e; box-shadow: none; font-size: 15px;
  }
  & .maintenance-subtab:focus-visible { outline: 2px solid #007c8e; outline-offset: 3px; }
}

body[data-active-view="maintenance"]:not(.auth-locked) .maintenance-section[data-view-panel="maintenance"] .maintenance-workspace-panel:is([data-maintenance-panel="overview"], [data-maintenance-panel="tasks"]) {
  gap: 24px;
  color: #193343;
  & :is(.maintenance-summary-card, .maintenance-command-card, .maintenance-system-board-shell, .maintenance-overview-spotlight, .maintenance-setup-state) {
    padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; min-height: 0;
  }
  & .maintenance-health-bar { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; padding: 4px 0 22px; border-bottom: 1px solid #e2eaee; }
  & .maintenance-summary-card { grid-template-columns: 32px minmax(0, 1fr); gap: 14px; align-items: start; }
  & .maintenance-summary-content { gap: 8px; }
  & .maintenance-summary-content .metric-label { font-size: 14px; letter-spacing: 0; text-transform: none; color: #526777; }
  & .maintenance-summary-value { font-size: 30px; line-height: 1.1; font-variant-numeric: tabular-nums; }
  & .maintenance-summary-copy { display: block; margin: 0; font-size: 14px; line-height: 1.4; color: #526777; }
  & :is(.maintenance-summary-icon, .maintenance-system-icon, .maintenance-system-board-icon, .maintenance-system-board-task-icon, .maintenance-activity-avatar, .maintenance-activity-empty-icon, .maintenance-setup-icon) {
    width: 32px; min-width: 32px; height: 32px; margin: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none;
  }
  & :is(.maintenance-summary-icon, .maintenance-system-icon, .maintenance-system-board-icon, .maintenance-system-board-task-icon, .maintenance-activity-avatar, .maintenance-activity-empty-icon, .maintenance-setup-icon) svg {
    width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
  }
  & .maintenance-command-grid { grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); grid-template-areas: "systems systems" "schedule activity"; gap: 28px 36px; }
  & .maintenance-command-grid:has(.maintenance-system-board-group[open]) { grid-template-columns: 1fr; grid-template-areas: "systems" "schedule" "activity"; }
  & :is(.maintenance-command-card-head, .maintenance-system-board-head) { gap: 16px; margin: 0 0 16px; flex-wrap: wrap; }
  & :is(.maintenance-command-card-head, .maintenance-system-board-head) .eyebrow { display: none; }
  & :is(.maintenance-command-card-head, .maintenance-system-board-head) h3 { margin: 0; font-size: 20px; line-height: 1.4; letter-spacing: -0.015em; }
  & :is(.text-button, .maintenance-system-action-button) { min-height: 44px; font-size: 15px; box-shadow: none; }
  & .maintenance-command-card-head .text-button { display: inline-flex; align-items: center; padding: 8px 0; border: 0; border-radius: 4px; background: transparent; text-decoration: none; color: #007c8e; }
  & .maintenance-system-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 28px; }
  & .maintenance-system-row { grid-template-columns: 32px minmax(0, 1fr) auto; gap: 6px 12px; min-height: 84px; padding: 12px 0; border: 0; border-bottom: 1px solid #e2eaee; border-radius: 0; background: transparent; box-shadow: none; }
  & .maintenance-system-copy strong { font-size: 16px; line-height: 1.4; }
  & .maintenance-system-icon { grid-column: 1; grid-row: 1 / span 2; }
  & .maintenance-system-copy { grid-column: 2; grid-row: 1; }
  & .maintenance-system-copy span { font-size: 14px; line-height: 1.4; color: #526777; }
  & .maintenance-system-status { grid-column: 3; grid-row: 1; min-height: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; font-size: 13px; white-space: normal; }
  & .maintenance-system-progress { grid-column: 2 / -1; grid-row: 2; height: 3px; }
  & .maintenance-system-board-shell { content-visibility: visible; contain-intrinsic-size: none; gap: 0; }
  & .maintenance-system-board-guidance { margin: -8px 0 12px; color: #526777; font-size: 14px; line-height: 1.5; }
  & .maintenance-system-board-group { margin: 0; border: 0; border-bottom: 1px solid #e2eaee; border-radius: 0; background: transparent; box-shadow: none; }
  & .maintenance-system-board-summary { min-height: 76px; gap: 12px; padding: 12px 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
  & .maintenance-system-board-title strong { font-size: 16px; line-height: 1.4; }
  & .maintenance-system-board-title small { font-size: 14px; line-height: 1.4; color: #526777; }
  & .maintenance-system-board-chip { font-size: 13px; min-height: 26px; border: 0; box-shadow: none; }
  & .maintenance-system-board-chip:not(.is-danger):not(.is-warn) { background: transparent; color: #526777; }
  & .maintenance-system-board-groups { gap: 0; }
  & .maintenance-system-board-table { border: 0; border-radius: 0; }
  & .maintenance-system-board-header { font-size: 13px; color: #526777; background: #f5f9fa; }
  & .maintenance-system-board-row { border: 0; border-bottom: 1px solid #e2eaee; border-radius: 0; background: #fff; box-shadow: none; }
  & .maintenance-system-board-task-copy strong { font-size: 16px; line-height: 1.4; white-space: normal; }
  & .maintenance-system-board-task-copy small { font-size: 14px; line-height: 1.5; white-space: normal; }
  & .maintenance-system-board-cell { overflow-wrap: anywhere; }
  & .maintenance-system-board-actions:has(.maintenance-inline-copy) { grid-template-columns: minmax(0, 1fr); grid-auto-flow: row; grid-auto-columns: auto; }
  & .maintenance-system-board-actions .maintenance-inline-copy { min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
  & .maintenance-system-board-cell :is(small, strong, span:not([class])) { font-size: 14px; line-height: 1.5; }
  & :is(.maintenance-system-board-empty, .maintenance-command-empty) { min-height: 96px; padding: 16px 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
  & .maintenance-system-board-empty { display: grid; align-content: start; gap: 8px; }
  & .maintenance-system-board-empty span { color: #526777; font-size: 14px; line-height: 1.5; }
  & .maintenance-activity-row { grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; min-height: 80px; padding: 12px 0; border: 0; border-bottom: 1px solid #e2eaee; border-radius: 0; background: transparent; box-shadow: none; }
  & .maintenance-activity-row strong { font-size: 16px; line-height: 1.4; }
  & :is(.maintenance-activity-row span, .maintenance-activity-time, .maintenance-command-empty span) { font-size: 14px; line-height: 1.5; color: #526777; }
  & .maintenance-activity-empty { grid-template-columns: 32px minmax(0, 1fr); gap: 12px; }
  & .maintenance-setup-intro { grid-template-columns: 32px minmax(0, 1fr); gap: 16px; }
  & .maintenance-setup-intro h3 { font-size: 24px; line-height: 1.3; }
  & .maintenance-setup-intro p:not(.eyebrow) { display: block; max-width: 65ch; font-size: 16px; line-height: 1.6; color: #526777; }
  & .maintenance-setup-steps { gap: 24px; padding: 24px 0; }
  & .maintenance-setup-steps li { padding: 0; border: 0; }
  & .maintenance-setup-steps strong { font-size: 16px; line-height: 1.4; }
  & .maintenance-setup-steps small { display: block; font-size: 14px; line-height: 1.5; color: #526777; }
  & :is(button, a, summary, [tabindex="0"]):focus-visible { outline: 2px solid #007c8e; outline-offset: 3px; }
  & :is(.maintenance-system-board-summary, .maintenance-system-board-row):hover { background: #f5f9fa; }
  & :is(.maintenance-system-copy, .maintenance-system-board-title, .maintenance-activity-row > div) { min-width: 0; overflow-wrap: anywhere; }
}

@media (max-width: 1180px) {
  body[data-active-view="maintenance"]:not(.auth-locked) .maintenance-section[data-view-panel="maintenance"] .maintenance-workspace-panel:is([data-maintenance-panel="overview"], [data-maintenance-panel="tasks"]) {
    & .maintenance-command-grid { grid-template-columns: 1fr; grid-template-areas: "systems" "schedule" "activity"; }
    & .maintenance-system-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
}
@media (max-width: 760px) {
  body[data-active-view="maintenance"]:not(.auth-locked) .view-panel.active[data-view-panel="maintenance"] { padding-bottom: calc(80px + var(--safe-area-bottom, 0px)) !important; }
  body[data-active-view="maintenance"]:not(.auth-locked) .maintenance-section[data-view-panel="maintenance"] {
    & .maintenance-workspace-nav { flex-wrap: wrap; }
    & .maintenance-subnav { width: 100%; display: flex; flex-wrap: wrap; }
    & .maintenance-subtab { flex: 1 1 auto; padding-inline: 8px; font-size: 14px; }
    & .maintenance-quick-actions { flex-wrap: wrap; }
    & .maintenance-workspace-panel:is([data-maintenance-panel="overview"], [data-maintenance-panel="tasks"]) {
      & .maintenance-health-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; }
      & .maintenance-summary-card { grid-template-columns: 1fr; gap: 8px; align-content: start; }
      & .maintenance-summary-copy { display: block; }
      & .maintenance-system-list { grid-template-columns: 1fr; }
      & .maintenance-system-board-summary { display: grid; grid-template-columns: 32px minmax(0, 1fr) 24px; }
      & .maintenance-system-board-summary-chips { grid-column: 2; grid-row: 2; justify-content: start; }
      & .maintenance-system-board-chevron { grid-column: 3; grid-row: 1; }
      & .maintenance-activity-row { grid-template-columns: 32px minmax(0, 1fr); }
      & .maintenance-activity-time { grid-column: 2; }
      & .maintenance-setup-steps { grid-template-columns: 1fr; gap: 20px; }
      & .maintenance-setup-steps li { border: 0; padding: 0; text-align: left; justify-items: start; }
    }
  }
}
