/* SAP-lite screens. Arve style direction: white surfaces, dark navy header, blue accents. */
:root {
  /* SAP Fiori (Belize/Quartz light) inspired palette. */
  --navy: #354a5f;
  --navy-2: #2b3d4f;
  --blue: #0a6ed1;
  --blue-dark: #0854a0;
  --blue-soft: #e5f0fa;
  --bg: #eff1f2;
  --surface: #ffffff;
  --border: #d9d9d9;
  --border-strong: #89919a;
  --text: #32363a;
  --muted: #6a6d70;
  --ok: #107e3e;
  --ok-bg: #f1fdf6;
  --warn: #b55b00;
  --warn-bg: #fef7f1;
  --bad: #bb0000;
  --bad-bg: #ffebeb;
  --info: #0a6ed1;
  --info-bg: #f5faff;
  --purple: #6a3fb5;
  --purple-bg: #f1ebfb;
  --alv-head: #e5eaef;
  --alv-zebra: #f7f9fa;
  --alv-total: #fdf3d0;
  --alv-subtotal: #fef9e7;
  --alv-select: #e5f0fa;
  --radius: 4px;
  --shadow: 0 0 0 1px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.08);
  --font: '72', 'Segoe UI', system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
}
body {
  font: 13px/1.45 var(--font);
  color: var(--text);
  background: var(--bg);
}
[hidden] {
  display: none !important;
}
a {
  color: var(--blue);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
code,
.mono {
  font-family: var(--mono);
  font-size: 0.92em;
}
h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
}
h1 {
  font-size: 22px;
}
h2 {
  font-size: 15px;
}
h3 {
  font-size: 13px;
  margin: 18px 0 8px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 12px;
}
.nowrap {
  white-space: nowrap;
}
.break {
  word-break: break-all;
}

/* ---------- Brand ---------- */
.logo {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.01em;
}
.tag {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #c8d6ea;
  white-space: nowrap;
}

/* ---------- Sign-in ---------- */
.signin {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(180deg, var(--navy) 0 38%, var(--bg) 38%);
}
.signin-card {
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 10px 30px rgba(11, 31, 58, 0.15);
  display: grid;
  gap: 10px;
}
.signin-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--navy);
}
.signin-brand .tag {
  background: var(--blue-soft);
  color: var(--blue-dark);
}
.signin-card h1 {
  margin-top: 6px;
}
.signin-card p {
  margin: 0;
}

/* ---------- Shell (SAP GUI for HTML / Fiori shell bar) ---------- */
.shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  grid-template-rows: 44px auto auto minmax(0, 1fr) auto;
  grid-template-areas: 'top top' 'title title' 'tools tools' 'side main' 'status status';
  height: 100%;
}
.topbar {
  grid-area: top;
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 12px;
  min-width: 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: #fff;
  flex: 0 0 auto;
}
.brand:hover {
  text-decoration: none;
}
.menu-btn {
  display: none;
  background: none;
  border: 0;
  color: #fff;
  font-size: 20px;
  line-height: 1;
  padding: 4px 6px;
  cursor: pointer;
  border-radius: 4px;
}
.menu-btn:hover,
.menu-btn:focus-visible {
  background: rgba(255, 255, 255, 0.15);
}
.okcode {
  display: flex;
  align-items: center;
  flex: 0 1 280px;
  min-width: 0;
  position: relative;
}
.okcode input {
  flex: 1 1 auto;
  min-width: 0;
  height: 28px;
  border-radius: 4px 0 0 4px;
  border: 1px solid #6c7f93;
  background: #fff;
  font-family: var(--mono);
  font-size: 13px;
  text-transform: uppercase;
  padding: 3px 8px;
}
.okcode input::placeholder {
  text-transform: none;
  font-family: var(--font);
  color: #8696a9;
}
.okcode-go {
  height: 28px;
  width: 30px;
  border: 1px solid #6c7f93;
  border-left: 0;
  border-radius: 0 4px 4px 0;
  background: #4c6074;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
}
.okcode-go:hover {
  background: #5a7187;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  margin-left: auto;
}
.system-info {
  color: #d1dbe5;
  font-size: 12px;
  white-space: nowrap;
}
.top-link {
  color: #fff;
  background: none;
  border: 0;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 2px;
  white-space: nowrap;
}
.top-link:hover {
  text-decoration: underline;
}
.fault-banner {
  background: #ffb020;
  color: #3a2500;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

/* Title bar with the transaction title, then the application toolbar. */
.titlebar {
  grid-area: title;
  background: var(--surface);
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 8px 16px 6px;
  min-width: 0;
  border-bottom: 1px solid #e5e5e5;
}
.tx-title {
  font-size: 18px;
  font-weight: 400;
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tx-code {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 6px;
  white-space: nowrap;
}
.guitoolbar {
  grid-area: tools;
  background: #f7f7f7;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px 10px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}
.tx-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
}
.tb-sep {
  width: 1px;
  align-self: stretch;
  background: var(--border);
  margin: 3px 6px;
  flex: 0 0 auto;
}
.tb-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: inherit;
  font-size: 13px;
  color: var(--blue-dark);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 3px 8px;
  cursor: pointer;
  white-space: nowrap;
  flex: 0 0 auto;
  line-height: 20px;
}
.tb-btn:hover:not(:disabled) {
  background: #ebf5fe;
  border-color: #c4dcf4;
  text-decoration: none;
}
.tb-btn:focus-visible {
  outline: 1px dotted #000;
  outline-offset: -3px;
}
.tb-btn:disabled {
  color: #a0a4a8;
  cursor: not-allowed;
}
.tb-btn kbd {
  font: 10px var(--mono);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0 3px;
  background: #fff;
}
.ico {
  font-size: 12px;
  width: 14px;
  text-align: center;
  display: inline-block;
}
.ico-back {
  color: #2b7d2b;
}
.ico-exit {
  color: #d08014;
}
.ico-cancel {
  color: var(--bad);
  font-weight: 700;
}
.ico-exec {
  color: #2b7d2b;
}
.ico-save {
  color: #2b7d2b;
}
.tb-mini {
  display: inline-block;
  padding: 0 6px;
  font-size: 11px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: #fff;
}

.sidebar {
  grid-area: side;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-y: auto;
}
.sidebar nav {
  padding: 6px 6px 12px;
  display: flex;
  flex-direction: column;
}
.nav-group {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 12px 10px 4px;
}
.sidebar nav a {
  color: var(--text);
  padding: 5px 10px;
  border-radius: 3px;
  border-left: 3px solid transparent;
}
.sidebar nav a:hover {
  background: #f2f2f2;
  text-decoration: none;
}
.sidebar nav a.active {
  background: var(--blue-soft);
  color: var(--blue-dark);
  border-left-color: var(--blue);
  font-weight: 600;
}
.nav-code {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  display: inline-block;
  min-width: 44px;
}
.side-foot {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  display: grid;
  gap: 3px;
}
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22a06b;
  margin-right: 7px;
}

.main {
  grid-area: main;
  overflow-y: auto;
  padding: 14px 18px 32px;
  outline: none;
  min-width: 0;
}

/* Status bar (SAP GUI): message on the left, system / client / transaction on the right. */
.statusbar {
  grid-area: status;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #f2f2f2;
  border-top: 1px solid var(--border);
  font-size: 12px;
  padding: 3px 12px;
  min-height: 26px;
  min-width: 0;
}
.status-msg {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.msg-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.msg-ico {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}
.msg-S .msg-ico {
  background: var(--ok);
}
.msg-S .msg-ico::before {
  content: '\2713';
}
.msg-E .msg-ico {
  background: var(--bad);
}
.msg-E .msg-ico::before {
  content: '\2715';
}
.msg-E {
  color: var(--bad);
  font-weight: 600;
}
.msg-W .msg-ico {
  background: #e9730c;
  border-radius: 2px;
}
.msg-W .msg-ico::before {
  content: '!';
}
.msg-I .msg-ico {
  background: var(--blue);
}
.msg-I .msg-ico::before {
  content: 'i';
}
.status-sys {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

/* ---------- Page structure ---------- */
.crumbs {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}
.crumbs .sep {
  margin: 0 6px;
}
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.page-head h1.in-titlebar {
  display: none;
}
.page-head > div:first-child {
  min-width: 260px;
  flex: 1 1 360px;
}
.subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  max-width: 760px;
}
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  margin-bottom: 16px;
  min-width: 0;
}
.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.grid-2 > .card {
  margin-bottom: 0;
}
.grid-2 + .card,
.grid-2 + .grid-2 {
  margin-top: 16px;
}
.empty {
  padding: 18px;
  text-align: center;
  color: var(--muted);
  background: #fafbfc;
  border: 1px dashed var(--border);
  border-radius: 6px;
}
.notice {
  padding: 12px 14px;
  border-radius: 6px;
  margin-bottom: 16px;
}
.notice.error {
  background: var(--bad-bg);
  color: var(--bad);
}

/* ---------- Tiles ---------- */
.tiles {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--blue);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow);
}
.tile-value {
  font-size: 24px;
  font-weight: 600;
}
.tile-label {
  font-size: 12px;
  color: var(--muted);
}
.tile.pass {
  border-top-color: var(--ok);
}
.tile.pass .tile-value {
  color: var(--ok);
}
.tile.fail {
  border-top-color: var(--bad);
}
.tile.fail .tile-value {
  color: var(--bad);
}
.tile.pending {
  border-top-color: #8a97a6;
}
.tile.check {
  border-top-color: var(--purple);
}
.tile.check .tile-value {
  color: var(--purple);
}

/* ---------- Tables ---------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th,
.table td {
  text-align: left;
  padding: 6px 9px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.table th {
  background: var(--alv-head);
  font-size: 12px;
  font-weight: 600;
  color: #4b5258;
  white-space: nowrap;
  border-bottom: 1px solid #c6ced6;
}
.table:not(.inner) > tbody > tr:nth-child(even):not(.fields-row) > td {
  background: var(--alv-zebra);
}
.table tbody tr:last-child td {
  border-bottom: 0;
}
.table .num {
  text-align: right;
  white-space: nowrap;
}
.table.clickable tbody tr {
  cursor: pointer;
}
.table.clickable tbody tr:hover,
#test-table tbody tr:not(.fields-row):hover {
  background: #f5f9ff;
}
.table td.mono {
  white-space: nowrap;
}
#test-table {
  min-width: 1040px;
}
#test-table > tbody > tr > td:nth-child(3) {
  min-width: 170px;
}
#test-table > tbody > tr > td:nth-child(7) {
  min-width: 200px;
}
#log-table {
  min-width: 900px;
}
.table td.path {
  white-space: normal;
  max-width: 420px;
  word-break: break-all;
}
.table .w-exp {
  width: 32px;
}
.table.inner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.fields-row > td {
  background: #f7f9fb;
}
tr.open > td {
  background: #f5f9ff;
}
tr.mismatch td {
  background: var(--bad-bg);
}
tr.mismatch td:first-child {
  box-shadow: inset 3px 0 0 var(--bad);
}
.cur {
  color: var(--muted);
  font-size: 12px;
}
.expander {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: 4px;
  width: 22px;
  height: 22px;
  line-height: 18px;
  padding: 0;
  cursor: pointer;
  color: var(--blue-dark);
}
.bar {
  height: 6px;
  background: #e8edf2;
  border-radius: 3px;
  overflow: hidden;
  width: 140px;
  margin: 6px 0 3px;
}
.bar span {
  display: block;
  height: 100%;
  background: var(--blue);
}

/* ---------- Badges, chips ---------- */
.badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  background: #eef1f4;
  color: var(--muted);
}
.badge.ok,
.badge.st-pass {
  background: var(--ok-bg);
  color: var(--ok);
}
.badge.warn {
  background: var(--warn-bg);
  color: var(--warn);
}
.badge.bad,
.badge.st-fail {
  background: var(--bad-bg);
  color: var(--bad);
}
.badge.info {
  background: var(--info-bg);
  color: var(--info);
}
.badge.st-pending {
  background: #eef1f4;
  color: #4a5867;
}
.badge.st-check-in-arve {
  background: var(--purple-bg);
  color: var(--purple);
}
.chip {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  padding: 1px 7px;
  margin: 2px 0;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: #f7f9fb;
}
.chip.create {
  border-color: #b6d0f2;
  background: var(--blue-soft);
  color: var(--blue-dark);
}
.method {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
}
.m-post {
  color: var(--purple);
}
.m-get {
  color: var(--blue-dark);
}

/* ---------- Buttons and forms ---------- */
.btn {
  font: inherit;
  font-size: 13px;
  border: 1px solid var(--blue);
  background: var(--surface);
  color: var(--blue);
  border-radius: 4px;
  padding: 5px 12px;
  cursor: pointer;
  white-space: nowrap;
  display: inline-block;
  line-height: 1.4;
}
.btn:hover {
  background: #ebf5fe;
  border-color: var(--blue-dark);
  color: var(--blue-dark);
  text-decoration: none;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.btn.primary:hover:not(:disabled) {
  background: var(--blue-dark);
  color: #fff;
}
.btn.danger {
  background: var(--bad);
  border-color: var(--bad);
  color: #fff;
}
.btn.danger-outline {
  color: var(--bad);
  border-color: #e7b4ae;
}
.btn.danger-outline:hover {
  border-color: var(--bad);
  color: var(--bad);
}
.btn.small {
  padding: 2px 8px;
  font-size: 12px;
}
.btn.wide {
  width: 100%;
  padding: 9px;
}
.icon-btn {
  border: 0;
  background: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}
input,
select {
  font: inherit;
  font-size: 13px;
  padding: 6px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  min-width: 0;
}
input:focus,
select:focus {
  outline: 2px solid rgba(26, 111, 216, 0.25);
  border-color: var(--blue);
}
input:disabled {
  background: #f3f5f8;
  color: var(--muted);
}
label {
  display: grid;
  gap: 4px;
  font-size: 13px;
  font-weight: 500;
}
label.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
}
label.check input {
  margin: 0;
}
.toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 400;
}
fieldset {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  display: grid;
  gap: 8px;
  margin: 0;
}
legend {
  font-size: 13px;
  font-weight: 500;
  padding: 0 4px;
}
.form-grid {
  display: grid;
  gap: 14px;
}
.form-grid p {
  margin: -6px 0 0;
}
.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
}
.form-error {
  color: var(--bad);
  margin: 8px 0 0;
  min-height: 0;
}
.form-error:empty {
  display: none;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
  align-items: end;
}
.filters label.grow {
  flex: 1 1 220px;
}
.qty-input {
  width: 90px;
  text-align: right;
}

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}
.tabs button {
  font: inherit;
  border: 0;
  background: none;
  padding: 8px 14px;
  cursor: pointer;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tabs button.active {
  color: var(--blue-dark);
  border-bottom-color: var(--blue);
  font-weight: 600;
}

/* ---------- Key-value lists ---------- */
.kv {
  display: grid;
  grid-template-columns: minmax(140px, 34%) minmax(0, 1fr);
  margin: 0;
  gap: 0;
}
.kv dt,
.kv dd {
  margin: 0;
  padding: 7px 0;
  border-bottom: 1px solid #edf0f3;
}
.kv dt {
  color: var(--muted);
  padding-right: 12px;
}
.kv dd {
  word-break: break-word;
}
.kv dt:last-of-type,
.kv dd:last-of-type {
  border-bottom: 0;
}
.steps {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
}
.audit {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

/* ---------- Dialog ---------- */
dialog {
  border: 0;
  border-radius: 10px;
  padding: 0;
  width: min(560px, calc(100vw - 32px));
  box-shadow: 0 20px 50px rgba(11, 31, 58, 0.3);
  color: var(--text);
}
dialog.wide {
  width: min(860px, calc(100vw - 32px));
}
dialog::backdrop {
  background: rgba(11, 31, 58, 0.45);
}
.dialog-form {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 64px);
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.dialog-head h2 {
  font-size: 16px;
}
.dialog-body {
  padding: 16px 18px;
  overflow-y: auto;
}
.dialog-body > p:first-child {
  margin-top: 0;
}
.dialog-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: #f7f9fb;
  border-radius: 0 0 10px 10px;
}
pre.code {
  background: #0f1d31;
  color: #dbe7f7;
  padding: 12px 14px;
  border-radius: 6px;
  font: 12px/1.5 var(--mono);
  overflow: auto;
  max-height: 300px;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: 460px;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--navy);
  color: #fff;
  box-shadow: 0 8px 24px rgba(11, 31, 58, 0.25);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  z-index: 10;
}
.toast.show {
  opacity: 1;
  transform: none;
}
.toast.error {
  background: var(--bad);
}


/* ---------- SAP Easy Access ---------- */
.ea {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 380px);
  gap: 16px;
  align-items: start;
}
.ea-tree {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px 12px;
  min-width: 0;
}
.ea-tree ul {
  list-style: none;
  margin: 0;
  padding: 0 0 0 18px;
}
.ea-tree > ul {
  padding-left: 0;
}
.ea-tree summary {
  cursor: pointer;
  padding: 3px 4px;
  border-radius: 3px;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}
.ea-tree summary::-webkit-details-marker {
  display: none;
}
.ea-tree summary::before {
  content: '\25B8';
  color: var(--muted);
  font-size: 11px;
  width: 10px;
}
.ea-tree details[open] > summary::before {
  content: '\25BE';
}
.ea-tree summary:hover {
  background: #f2f2f2;
}
.ea-folder-ico {
  width: 15px;
  height: 11px;
  background: #e8b84a;
  border-radius: 1px 3px 2px 2px;
  position: relative;
  flex: 0 0 auto;
}
.ea-folder-ico::before {
  content: '';
  position: absolute;
  top: -3px;
  left: 0;
  width: 7px;
  height: 4px;
  background: #e8b84a;
  border-radius: 2px 2px 0 0;
}
.ea-leaf a {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 3px 4px 3px 16px;
  color: var(--text);
  border-radius: 3px;
}
.ea-leaf a:hover {
  background: #ebf5fe;
  text-decoration: none;
}
.ea-ico {
  width: 10px;
  height: 10px;
  border: 1px solid #7a8c9e;
  background: linear-gradient(#fff, #dfe7ef);
  flex: 0 0 auto;
  align-self: center;
}
.ea-code {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--blue-dark);
  min-width: 128px;
}
.ea-text {
  min-width: 0;
}
.ea-side .sap-panel {
  margin-bottom: 12px;
}
.ea-steps {
  margin: 0 0 8px;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

/* ---------- Panels, object header, read-only fields, tab strips ---------- */
.sap-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  min-width: 0;
}
.sap-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 6px 12px;
  border-bottom: 1px solid #e5e5e5;
  background: #fafafa;
  border-radius: var(--radius) var(--radius) 0 0;
}
.sap-panel-head h2 {
  font-size: 14px;
  font-weight: 600;
}
.sap-panel-body {
  padding: 10px 12px;
  min-width: 0;
}
.objhead {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 12px;
  display: grid;
  gap: 6px;
}
.obj-title {
  font-size: 17px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.obj-type {
  color: var(--muted);
}
.obj-id {
  font-weight: 600;
  font-family: var(--mono);
}
.obj-year {
  color: var(--muted);
  font-family: var(--mono);
}
.obj-name {
  font-weight: 600;
}
.sap-form {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 4px 24px;
}
.f-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
  min-width: 0;
}
.f-label {
  color: var(--muted);
  text-align: right;
  font-size: 12px;
}
.f-label::after {
  content: ':';
}
.f-value {
  border-bottom: 1px solid #e5e5e5;
  padding: 2px 4px;
  min-height: 23px;
  overflow-wrap: anywhere;
  background: #fbfbfb;
}
.sap-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin: -2px 0 10px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.sap-tab {
  font: inherit;
  font-size: 13px;
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 6px 12px;
  cursor: pointer;
  color: var(--muted);
  white-space: nowrap;
}
.sap-tab:hover {
  color: var(--blue-dark);
}
.sap-tab.active {
  color: var(--blue-dark);
  border-bottom-color: var(--blue);
  font-weight: 600;
}
.mir4-head {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 12px;
}
.mir4-head .sap-form {
  grid-template-columns: minmax(0, 1fr);
}
.mir4-head .sap-panel:first-child .sap-form {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.item-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  min-width: 0;
}
.item-sel {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sap-notice {
  background: var(--info-bg);
  border: 1px solid #b8d7f5;
  border-left: 4px solid var(--blue);
  padding: 8px 12px;
  border-radius: var(--radius);
  margin-bottom: 12px;
}
.sap-msgs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
  font-size: 12px;
}
.msg-time {
  font-family: var(--mono);
  color: var(--muted);
  margin-right: 6px;
}
.tag-warn {
  display: inline-block;
  background: #fff3b8;
  border: 1px solid #e9c46a;
  color: #6b4a00;
  border-radius: 3px;
  padding: 0 5px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.due-over {
  color: var(--bad);
  font-size: 10px;
}

/* Traffic lights (ALV status icons). */
.led {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  vertical-align: -1px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}
.led-green {
  background: #2b9a3e;
}
.led-yellow {
  background: #f0ab00;
}
.led-red {
  background: #d52b1e;
}
.led-grey {
  background: #b5bbc1;
}

/* ---------- Selection screens ---------- */
.selscreen {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
  max-width: 900px;
}
.sel-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 14px 12px;
  margin: 0;
  display: grid;
  gap: 6px;
  min-width: 0;
}
.sel-group legend {
  font-weight: 600;
  font-size: 13px;
  padding: 0 6px;
  color: var(--text);
}
.sel-row {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.sel-label {
  display: block;
  font-weight: 400;
  font-size: 13px;
  color: var(--text);
}
.sel-ctrl {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}
.sel-input {
  height: 26px;
  padding: 2px 6px;
  border: 1px solid var(--border-strong);
  border-radius: 2px;
  font-size: 13px;
  max-width: 100%;
}
input.sel-input {
  font-family: var(--mono);
}
input.sel-input[type='date'] {
  font-family: var(--font);
}
.sel-input:focus {
  outline: 1px solid var(--blue);
  border-color: var(--blue);
}
.sel-to {
  color: var(--muted);
  font-size: 12px;
}
.sel-radios {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
}
.sel-radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 400;
}
.sel-note {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}
.migo-top {
  max-width: none;
}
.migo-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
}
.migo-mvt {
  color: var(--muted);
  font-size: 12px;
}

/* ---------- ALV grid ---------- */
.alv {
  min-width: 0;
  margin-bottom: 8px;
}
.alv + .alv {
  margin-top: 14px;
}
.alv-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 2px 6px;
  flex-wrap: wrap;
}
.alv-title {
  font-weight: 600;
  font-size: 13px;
}
.alv-count {
  font-size: 12px;
  color: var(--muted);
}
.alv-wrap {
  overflow-x: auto;
  border: 1px solid #c6ced6;
  background: var(--surface);
  max-width: 100%;
}
.alv-grid {
  border-collapse: collapse;
  width: 100%;
  font-size: 12.5px;
}
.alv-grid th,
.alv-grid td {
  padding: 4px 8px;
  border-right: 1px solid #e3e7eb;
  border-bottom: 1px solid #e3e7eb;
  text-align: left;
  white-space: nowrap;
  vertical-align: middle;
}
.alv-grid th {
  background: var(--alv-head);
  color: #3b4248;
  font-weight: 600;
  font-size: 12px;
  border-bottom: 1px solid #b9c2cb;
  position: sticky;
  top: 0;
}
.alv-grid .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.alv-grid tbody tr:nth-child(even) > td {
  background: var(--alv-zebra);
}
.alv-grid tbody tr:hover > td {
  background: #ebf5fe;
}
.alv-grid tbody tr.alv-selected > td {
  background: var(--alv-select);
}
.alv-grid tbody tr.alv-total > td {
  background: var(--alv-total);
  font-weight: 700;
  border-top: 1px solid #e3c96a;
}
.alv-grid tbody tr.alv-subtotal > td {
  background: var(--alv-subtotal);
  font-weight: 600;
}
.alv-grid tbody tr.alv-group > td {
  background: #dfe8f1;
  font-weight: 600;
  border-top: 1px solid #b9c2cb;
}
.alv-sigma {
  color: #6b4a00;
}
.alv-grid a.drill {
  font-family: var(--mono);
  font-size: 12px;
}
.alv-grid .qty-input {
  width: 90px;
  height: 24px;
  padding: 1px 4px;
  text-align: right;
}
.alv-empty {
  padding: 12px;
  color: var(--muted);
  background: #fafafa;
  border: 1px dashed var(--border);
  text-align: center;
}

/* ---------- Narrower screens ---------- */
@media (max-width: 1240px) {
  .tiles {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 1100px) {
  .shell {
    grid-template-columns: 196px minmax(0, 1fr);
  }
  .main {
    padding: 12px 14px 28px;
  }
  .grid-2,
  .mir4-head,
  .ea {
    grid-template-columns: minmax(0, 1fr);
  }
  .system-info {
    display: none;
  }
}
@media (max-width: 760px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 44px auto auto minmax(0, 1fr) auto;
    grid-template-areas: 'top' 'title' 'tools' 'main' 'status';
  }
  .menu-btn {
    display: inline-block;
  }
  .topbar {
    gap: 8px;
    padding: 0 8px;
  }
  .okcode {
    flex: 1 1 auto;
  }
  .topbar-right {
    gap: 8px;
  }
  .topbar-right a.top-link,
  .tag,
  .fault-banner {
    display: none;
  }
  .sidebar {
    display: none;
  }
  .shell.nav-open .sidebar {
    display: flex;
    position: fixed;
    top: 44px;
    left: 0;
    bottom: 0;
    width: min(290px, 86vw);
    z-index: 50;
    box-shadow: 4px 0 16px rgba(0, 0, 0, 0.25);
  }
  .titlebar {
    padding: 6px 12px 4px;
  }
  .tx-title {
    font-size: 16px;
  }
  .guitoolbar {
    padding: 2px 6px;
  }
  .tb-btn kbd {
    display: none;
  }
  .tb-btn {
    padding: 3px 6px;
  }
  .main {
    padding: 10px 10px 24px;
  }
  .tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sel-row,
  .f-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
  .f-label {
    text-align: left;
  }
  .sap-form,
  .mir4-head .sap-panel:first-child .sap-form {
    grid-template-columns: minmax(0, 1fr);
  }
  .ea-code {
    min-width: 0;
  }
  .ea-leaf a {
    flex-wrap: wrap;
    gap: 0 8px;
  }
  .status-sys {
    display: none;
  }
}
