.mx-workspace {
  --mx-bg: #f4f6f8;
  --mx-panel: #ffffff;
  --mx-panel-soft: #eef3f7;
  --mx-ink: #15212e;
  --mx-muted: #627182;
  --mx-line: #d5dde6;
  --mx-orange: #f97316;
  --mx-blue: #2563eb;
  --mx-green: #15803d;
  --mx-red: #b42318;
  --mx-amber: #b45309;
  --mx-teal: #0f766e;
  --mx-purple: #6d28d9;
  --mx-shadow: 0 20px 48px rgba(15, 23, 42, .16);
  width: 100%;
  max-width: 1450px;
  margin: 0 auto 48px;
  color: var(--mx-ink);
}

.mx-workspace * {
  box-sizing: border-box;
}

.mx-workspace button,
.mx-workspace input,
.mx-workspace select,
.mx-workspace textarea {
  font: inherit;
}

.mx-shell {
  min-height: calc(100vh - 130px);
  overflow: hidden;
  background: var(--mx-bg);
  border: 1px solid var(--mx-line);
  border-radius: 8px;
  box-shadow: var(--mx-shadow);
}

.mx-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 18px 20px 16px;
  background: linear-gradient(180deg, #ffffff, #edf3f8);
  border-bottom: 1px solid var(--mx-line);
}

.mx-back {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin-bottom: 11px;
  padding: 7px 11px;
  color: var(--mx-ink);
  background: #fff;
  border: 1px solid var(--mx-line);
  border-radius: 6px;
  font-weight: 900;
  cursor: pointer;
}

.mx-back:hover {
  background: var(--mx-panel-soft);
}

.mx-kicker {
  margin: 0 0 3px;
  color: #9a3412;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.mx-header h1 {
  margin: 0;
  color: var(--mx-ink);
  font-size: 28px;
  letter-spacing: 0;
}

.mx-header p {
  max-width: 780px;
  margin: 6px 0 0;
  color: var(--mx-muted);
}

.mx-shift-panel {
  align-self: stretch;
  min-width: 275px;
  padding: 13px;
  background: #fff;
  border: 1px solid var(--mx-line);
  border-radius: 8px;
}

.mx-shift-panel b,
.mx-shift-panel span {
  display: block;
}

.mx-shift-panel b {
  color: var(--mx-ink);
}

.mx-shift-panel span {
  margin-top: 3px;
  color: var(--mx-muted);
  font-size: 12px;
}

.mx-tabs {
  display: flex;
  gap: 1px;
  overflow-x: auto;
  background: var(--mx-line);
  border-bottom: 1px solid var(--mx-line);
}

.mx-tab {
  min-height: 44px;
  padding: 10px 15px;
  color: var(--mx-muted);
  background: #f9fbfd;
  border: 0;
  cursor: pointer;
  font-weight: 900;
  white-space: nowrap;
}

.mx-tab.active {
  color: #fff;
  background: var(--mx-orange);
}

.mx-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  background: var(--mx-line);
  border-bottom: 1px solid var(--mx-line);
}

.mx-metric {
  min-width: 0;
  padding: 13px 15px;
  background: #fff;
}

.mx-metric b {
  display: block;
  color: #0563c1;
  font-size: 25px;
}

.mx-metric span {
  display: block;
  margin-top: 2px;
  color: var(--mx-muted);
  font-size: 12px;
  font-weight: 800;
}

.mx-body {
  padding: 16px;
}

.mx-panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) 330px;
  gap: 16px;
  align-items: start;
}

.mx-panel-grid + .mx-card {
  margin-top: 16px;
}

.mx-card,
.mx-side-panel,
.mx-board-col,
.mx-list-row,
.mx-asset-card,
.mx-part-card {
  background: var(--mx-panel);
  border: 1px solid var(--mx-line);
  border-radius: 8px;
}

.mx-card,
.mx-side-panel {
  padding: 16px;
}

.mx-card h2,
.mx-side-panel h2 {
  margin: 0 0 5px;
  color: var(--mx-ink);
  font-size: 21px;
  letter-spacing: 0;
}

.mx-card p,
.mx-side-panel p {
  margin: 4px 0 0;
  color: var(--mx-muted);
}

.mx-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 15px;
}

.mx-label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--mx-ink);
  font-size: 12px;
  font-weight: 900;
}

.mx-label.full {
  grid-column: 1 / -1;
}

.mx-label .required {
  color: var(--mx-orange);
}

.mx-input,
.mx-select,
.mx-textarea {
  width: 100%;
  min-width: 0;
  color: var(--mx-ink);
  background: #fff;
  border: 1px solid var(--mx-line);
  border-radius: 6px;
  padding: 10px 11px;
  outline: 0;
}

.mx-input:focus,
.mx-select:focus,
.mx-textarea:focus {
  border-color: var(--mx-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}

.mx-textarea {
  min-height: 122px;
  resize: vertical;
}

.mx-textarea.compact {
  min-height: 82px;
}

.mx-check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.mx-check {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 38px;
  padding: 8px 10px;
  color: var(--mx-ink);
  background: var(--mx-panel-soft);
  border: 1px solid var(--mx-line);
  border-radius: 6px;
  font-weight: 800;
}

.mx-actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 14px;
}

.mx-actions.compact {
  margin-top: 0;
}

.mx-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 39px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 9px 12px;
  color: #fff;
  background: var(--mx-orange);
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.mx-button:hover {
  filter: brightness(.95);
}

.mx-button.secondary {
  color: var(--mx-ink);
  background: #fff;
  border-color: var(--mx-line);
}

.mx-button.blue {
  background: var(--mx-blue);
}

.mx-button.green {
  background: var(--mx-green);
}

.mx-button.red {
  background: var(--mx-red);
}

.mx-button:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.mx-manager-note {
  margin: 10px 0 0;
  color: var(--mx-muted);
  font-size: 12px;
  font-weight: 800;
}

.mx-side-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.mx-rule {
  padding: 11px;
  background: #f8fafc;
  border: 1px solid var(--mx-line);
  border-radius: 8px;
}

.mx-rule b,
.mx-rule span {
  display: block;
}

.mx-rule span {
  margin-top: 2px;
  color: var(--mx-muted);
  font-size: 12px;
}

.mx-chip,
.mx-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 5px 8px;
  color: var(--mx-muted);
  background: #eef2f7;
  border: 1px solid #d9e2ec;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.mx-status.critical,
.mx-status.emergency,
.mx-status.overdue {
  color: var(--mx-red);
  background: #fff0ed;
}

.mx-status.high,
.mx-status.needs-triage {
  color: var(--mx-amber);
  background: #fff7ed;
}

.mx-status.normal,
.mx-status.assigned {
  color: #174ea6;
  background: #e8f1ff;
}

.mx-status.approved,
.mx-status.ready,
.mx-status.complete,
.mx-status.completed {
  color: var(--mx-green);
  background: #eaf7ef;
}

.mx-status.in-progress {
  color: var(--mx-purple);
  background: #f3e8ff;
}

.mx-split {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(360px, 1.05fr);
  gap: 16px;
}

.mx-list {
  display: grid;
  gap: 8px;
}

.mx-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 72px;
  padding: 11px;
  color: var(--mx-ink);
  text-align: left;
  cursor: pointer;
}

.mx-list-row.active,
.mx-list-row:hover {
  border-color: var(--mx-blue);
  background: #eef6ff;
}

.mx-list-row b,
.mx-list-row span,
.mx-list-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mx-list-row small,
.mx-detail-meta {
  color: var(--mx-muted);
  font-size: 12px;
}

.mx-detail {
  min-height: 430px;
}

.mx-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--mx-line);
}

.mx-detail-head h2 {
  margin: 5px 0 0;
}

.mx-detail-body {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.mx-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mx-info {
  padding: 10px;
  background: #f8fafc;
  border: 1px solid var(--mx-line);
  border-radius: 8px;
}

.mx-info span {
  display: block;
  color: var(--mx-muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.mx-info b {
  display: block;
  margin-top: 3px;
}

.mx-board {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.mx-board-col {
  min-width: 0;
  overflow: hidden;
  padding: 11px;
}

.mx-board-col h3 {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 10px;
  color: var(--mx-ink);
  font-size: 14px;
}

.mx-board-items {
  display: grid;
  gap: 8px;
}

.mx-board-card {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 10px;
  color: var(--mx-ink);
  font: inherit;
  text-align: left;
  background: #f8fafc;
  border: 1px solid var(--mx-line);
  border-radius: 6px;
  cursor: pointer;
}

.mx-board-card:hover { border-color: var(--mx-blue); background: #eef6ff; }

.mx-board-card b,
.mx-board-card span,
.mx-board-card small {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mx-board-card span {
  margin-top: 3px;
}

.mx-board-card small {
  margin-top: 5px;
  color: var(--mx-muted);
}

.mx-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.mx-asset-card,
.mx-part-card {
  min-width: 0;
  padding: 13px;
}

.mx-asset-card h3,
.mx-part-card h3 {
  margin: 0 0 6px;
  color: var(--mx-ink);
  font-size: 16px;
}

.mx-progress {
  height: 9px;
  overflow: hidden;
  background: #e2e8f0;
  border-radius: 999px;
}

.mx-progress span {
  display: block;
  height: 100%;
  background: var(--mx-green);
}

.mx-table-wrap {
  overflow: auto;
  background: #fff;
  border: 1px solid var(--mx-line);
  border-radius: 8px;
}

.mx-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--mx-ink);
}

.mx-table th,
.mx-table td {
  padding: 10px 11px;
  border-bottom: 1px solid var(--mx-line);
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  vertical-align: top;
}

.mx-table th {
  color: var(--mx-muted);
  background: var(--mx-panel-soft);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.mx-report-heading {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

.mx-report-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-top: 14px;
  background: var(--mx-line);
  border: 1px solid var(--mx-line);
  border-radius: 8px;
}

.mx-report-metrics > div {
  min-width: 0;
  padding: 13px;
  background: #fff;
}

.mx-report-metrics b,
.mx-report-metrics span {
  display: block;
}

.mx-report-metrics b {
  color: #0563c1;
  font-size: 25px;
}

.mx-report-metrics span {
  margin-top: 2px;
  color: var(--mx-muted);
  font-size: 12px;
  font-weight: 800;
}

.mx-report-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.mx-report-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 14px;
  background: #f8fafc;
  border: 1px solid var(--mx-line);
  border-radius: 8px;
}

.mx-report-card h3 {
  margin: 0;
  color: var(--mx-ink);
  font-size: 16px;
}

.mx-report-card p {
  flex: 1;
}

.mx-report-email {
  margin-top: 16px;
}

.mx-empty {
  padding: 16px;
  color: var(--mx-muted);
  background: #fff;
  border: 1px solid var(--mx-line);
  border-radius: 8px;
}

.mx-ai-box {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 14px;
  color: var(--mx-ink);
  background: #f8fafc;
  border: 1px solid var(--mx-line);
  border-left: 4px solid var(--mx-green);
  border-radius: 8px;
}

.mx-ai-box.blocked {
  border-left-color: var(--mx-red);
  background: #fff7ed;
}

.mx-ai-box b {
  color: var(--mx-ink);
}

.mx-ai-box p,
.mx-ai-box ul {
  margin: 0;
  color: var(--mx-muted);
}

.mx-command-card {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--mx-line);
  border-left: 5px solid var(--mx-orange);
  border-radius: 8px;
}

.mx-command-card h2 { margin: 0; font-size: 22px; }
.mx-command-card p { margin: 4px 0 0; color: var(--mx-muted); }

.mx-today-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.mx-today-lane { padding: 12px; min-width: 0; }
.mx-today-lane h3 { display:flex; justify-content:space-between; gap:8px; margin:0 0 10px; font-size:15px; }
.mx-today-lane h3 span { color:#0563c1; }
.mx-today-items { display:grid; gap:8px; max-height:390px; overflow:auto; }

.mx-today-item,
.mx-resource-row {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 10px;
  color: var(--mx-ink);
  font: inherit;
  text-align: left;
  background: #f8fafc;
  border: 1px solid var(--mx-line);
  border-radius: 6px;
}

button.mx-today-item,
button.mx-resource-row { cursor:pointer; }
button.mx-today-item:hover,
button.mx-resource-row:hover { border-color:var(--mx-blue); background:#eef6ff; }
.mx-today-item small,.mx-resource-row small { color:var(--mx-muted); }
.mx-today-lower { margin-top:12px; }

.mx-resource-resolution-form {
  display: grid;
  grid-template-columns: minmax(120px, 0.55fr) minmax(240px, 1.45fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--mx-line);
}

.mx-resource-resolution-form .mx-textarea.compact { min-height: 44px; }
.mx-resource-resolution-form > .onefsg-required-note,
.mx-form > .onefsg-required-note {
  grid-column: 1 / -1 !important;
  color: var(--mx-muted) !important;
}
.mx-resource-resolution-action { align-self: end; margin: 0; }
.mx-ai-attestation { align-items: flex-start; }
.mx-ai-attestation input { flex: 0 0 auto; margin-top: 2px; }

.mx-inline-alert {
  display: grid;
  gap: 5px;
  padding: 11px 12px;
  color: #713f12;
  background: #fff7ed;
  border: 1px solid #fdba74;
  border-left: 4px solid var(--mx-orange);
  border-radius: 7px;
}
.mx-inline-alert[hidden] { display: none; }
.mx-inline-alert span { overflow-wrap: anywhere; }
.mx-inline-alert .mx-button { justify-self: start; margin-top: 5px; }

.mx-workflow-section {
  padding: 12px;
  background: #fbfcfe;
  border: 1px solid var(--mx-line);
  border-radius: 8px;
}

.mx-workflow-section summary { color:var(--mx-ink); font-weight:900; cursor:pointer; }
.mx-mini-history,.mx-timeline { display:grid; gap:7px; margin-top:12px; }
.mx-mini-history span,.mx-timeline span { display:block; color:var(--mx-muted); font-size:12px; }
.mx-timeline > div { padding:8px 0; border-bottom:1px solid var(--mx-line); }

.mx-period-bar {
  display: grid;
  grid-template-columns: minmax(150px,.8fr) repeat(2,minmax(145px,.7fr)) auto;
  gap: 10px;
  align-items: end;
  margin-top: 14px;
  padding: 12px;
  background: #eef6ff;
  border: 1px solid #c9ddf4;
  border-radius: 8px;
}

.mx-period-note { font-size:12px; }

@media (max-width: 1180px) {
  .mx-header,
  .mx-panel-grid,
  .mx-split {
    grid-template-columns: 1fr;
  }

  .mx-shift-panel {
    min-width: 0;
  }

  .mx-metrics,
  .mx-board,
  .mx-grid-3,
  .mx-report-metrics,
  .mx-report-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mx-board,
  .mx-today-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
}

@media (max-width: 760px) {
  .mx-workspace {
    width: 100%;
    margin-bottom: 36px;
  }

  .mx-body {
    padding: 12px;
  }

  .mx-header h1 {
    font-size: 24px;
  }

  .mx-metrics,
  .mx-form,
  .mx-check-grid,
  .mx-info-grid,
  .mx-board,
  .mx-grid-3,
  .mx-report-metrics,
  .mx-report-grid {
    grid-template-columns: 1fr;
  }

  .mx-command-card { display:grid; }
  .mx-today-grid,
  .mx-period-bar,
  .mx-resource-resolution-form { grid-template-columns:1fr; }

  .mx-list-row,
  .mx-detail-head {
    display: grid;
    grid-template-columns: 1fr;
  }

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

  .mx-button {
    width: 100%;
    padding-right: 7px;
    padding-left: 7px;
    white-space: normal;
  }
}
