/* SAP SPRO-style MDGIMG path widget — theme-independent (always light SAP GUI look) */
.mdgimg-path-widget {
  --mdgimg-bg: #e8f0f8;
  --mdgimg-header-bg: #dce6f0;
  --mdgimg-border: #a8b8c8;
  --mdgimg-text: #000000;
  --mdgimg-path-bg: #fff5be;
  --mdgimg-target-bg: #ffe566;
  --mdgimg-arrow: #e53935;
  --mdgimg-grid: #c5d3e0;
  color-scheme: only light;
  margin: 14px 0 18px;
  border: 1px solid var(--mdgimg-border);
  border-radius: 2px;
  background: var(--mdgimg-bg) !important;
  color: var(--mdgimg-text) !important;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.mdgimg-path-header {
  padding: 6px 10px;
  border-bottom: 1px solid var(--mdgimg-border);
  background: var(--mdgimg-header-bg) !important;
  color: var(--mdgimg-text) !important;
  font: 700 12px/1.2 Tahoma, "Segoe UI", sans-serif;
}

.mdgimg-path-tcode {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--mdgimg-border);
  background: #eef2f6 !important;
  color: #1a1a1a !important;
  font: 12px/1.2 Tahoma, "Segoe UI", sans-serif;
}

.sap-tcode-ok {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #7dff8a 0%, #22c55e 45%, #15803d 100%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15), 0 1px 1px rgba(0, 0, 0, 0.12);
  position: relative;
}

.sap-tcode-ok::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 3px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.sap-tcode-field {
  display: inline-flex;
  align-items: center;
  min-width: 120px;
  max-width: 220px;
  height: 22px;
  padding: 0 4px 0 6px;
  border: 1px solid #8fa0b0;
  border-radius: 2px;
  background: #ffffff !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.sap-tcode-value,
.mdgimg-path-tcode code {
  flex: 1 1 auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent !important;
  color: #0b2f6b !important;
  font: 700 12px/22px Tahoma, "Segoe UI", sans-serif !important;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.sap-tcode-caret {
  flex: 0 0 auto;
  width: 0;
  height: 0;
  margin-left: 6px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #1e3a5f;
}

.sap-tcode-collapse {
  flex: 0 0 auto;
  color: #6b7280;
  font: 700 14px/1 Tahoma, "Segoe UI", sans-serif;
}

.sap-tcode-collapse::before {
  content: "«";
}

/* Inline TCode / transaction mentions in chat answers */
.sap-tcode-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 2px;
  vertical-align: middle;
  color-scheme: only light;
}

/* SAP Performance Assistant-style descriptive lists (knowledge + chat) */
.structured-list-wrap.sap-help-list {
  margin: 10px 0 14px;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid #d6d0a8;
  border-radius: 4px;
  padding: 12px 16px 14px;
  background: #ffffe1 !important;
  color: #000 !important;
  font-family: Tahoma, "Segoe UI", sans-serif;
  color-scheme: only light;
}

.sap-help-list-section {
  margin: 0 0 12px;
}

.sap-help-list-section:last-child {
  margin-bottom: 0;
}

.sap-help-list-heading {
  margin: 0 0 6px;
  color: #000 !important;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.sap-help-list-items {
  margin: 0;
  padding-left: 22px;
  list-style: disc;
}

.sap-help-list-items li {
  margin: 0 0 4px;
  padding-left: 2px;
  color: #0000ee !important;
}

.sap-help-list-link {
  color: #0000ee !important;
  font-size: 13.5px;
  font-weight: 400;
  line-height: 1.45;
  text-decoration: none;
}

/* Knowledge / chat data tables */
.table-scroll-wrap.knowledge-data-table,
.knowledge-data-table {
  margin: 10px 0 14px;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid #c9c6df;
  border-radius: 8px;
  background: #f7f8fc;
  color-scheme: only light;
}

.knowledge-data-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.knowledge-data-table th,
.knowledge-data-table td {
  padding: 8px 12px;
  border: 1px solid #c9c6df;
  text-align: left;
  vertical-align: top;
}

.knowledge-data-table th {
  background: #e8eaf8;
  color: #1e293b;
  font-weight: 700;
}

.knowledge-data-table td {
  background: #fff;
  color: #334155;
}

.knowledge-data-table td code {
  color: #0f172a !important;
  background: #eef2f7 !important;
  border: 1px solid #c5ced8;
  border-radius: 4px;
  padding: 1px 5px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.92em;
}

.mdgimg-path-tree {
  padding: 4px 0 6px;
  font: 12px/1.25 Tahoma, "Segoe UI", sans-serif;
  color: var(--mdgimg-text) !important;
  background: var(--mdgimg-bg) !important;
}

.mdgimg-path-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 22px;
  margin: 0;
  padding: 2px 8px 2px 6px;
  border-bottom: 1px solid var(--mdgimg-grid);
  background: transparent;
  color: var(--mdgimg-text) !important;
}

.mdgimg-path-row.is-ancestor {
  background: transparent !important;
}

.mdgimg-path-row.is-target {
  background: var(--mdgimg-target-bg) !important;
}

.mdgimg-path-arrow {
  display: none !important;
}

.mdgimg-path-twisty {
  width: 0;
  height: 0;
  margin: 0 2px 0 1px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 6px solid #111;
  flex: 0 0 auto;
}

.mdgimg-path-twisty.is-leaf {
  visibility: hidden;
}

.mdgimg-path-icon {
  flex: 0 0 auto;
  display: inline-block;
  vertical-align: middle;
}

.mdgimg-path-icon-folder {
  width: 16px;
  height: 13px;
  position: relative;
  border-radius: 1px 1px 1px 1px;
  background: linear-gradient(180deg, #ffe082 0%, #f9a825 55%, #f57f17 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 0 0 1px #c68a12;
}

.mdgimg-path-icon-folder::before {
  content: "";
  position: absolute;
  top: -3px;
  left: 1px;
  width: 7px;
  height: 4px;
  border-radius: 1px 1px 0 0;
  background: #f9a825;
  box-shadow: 0 0 0 1px #c68a12;
}

.mdgimg-path-icon-activity {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #fff 0 2px, transparent 2.5px),
    conic-gradient(from 0deg, #111 0 8%, transparent 8% 100%),
    radial-gradient(circle at 50% 50%, #e8f5e9 0 55%, #2e7d32 56% 100%);
  box-shadow: inset 0 0 0 1.5px #1b5e20, 0 0 0 1px #a5d6a7;
  position: relative;
}

.mdgimg-path-icon-activity::before,
.mdgimg-path-icon-activity::after {
  content: "";
  position: absolute;
  background: #111;
  left: 50%;
  top: 50%;
  transform-origin: center bottom;
}

.mdgimg-path-icon-activity::before {
  width: 1.5px;
  height: 4px;
  margin-left: -0.75px;
  margin-top: -4px;
}

.mdgimg-path-icon-activity::after {
  width: 3.5px;
  height: 1.5px;
  margin-left: -0.5px;
  margin-top: -1px;
}

.mdgimg-path-label {
  flex: 0 1 auto;
  max-width: calc(100% - 60px);
  padding: 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #000 !important;
  font-weight: 400;
}

.mdgimg-path-row.is-target .mdgimg-path-label {
  padding: 0 4px;
  border: 1px solid #d32f2f;
  background: transparent;
  font-weight: 400;
  color: #000 !important;
}

/* Force same SAP look under dark / light app themes */
html[data-theme="dark"] .mdgimg-path-widget,
html[data-theme="dark"] .mdgimg-path-widget *,
html:not([data-theme="dark"]) .mdgimg-path-widget,
body .mdgimg-path-widget {
  color-scheme: only light;
}
