/* ============================================================
   SAP UI MOCK — HTML/CSS reproduction of SAP S/4HANA Fiori shell.
   POC : SAP Easy Access screen.
   No PNG. Pixel-perfect interactive fields.
   ============================================================ */

:root {
  --sap-titlebar-bg: #2b3d50;       /* dark navy */
  --sap-titlebar-fg: #e8edf1;
  --sap-toolbar-bg: #fafbfc;
  --sap-toolbar-border: #d9dde2;
  --sap-body-bg: #ffffff;
  --sap-tree-bg: #ffffff;
  --sap-tree-hover: #f4f7fa;
  --sap-text: #32363a;
  --sap-text-muted: #6a6d70;
  --sap-link: #0a6ed1;
  --sap-execute-bg: #0a6ed1;
  --sap-execute-fg: #ffffff;
  --sap-decor-from: #5b9ad6;
  --sap-decor-to:   #c8e1f4;
  --sap-statusbar-bg: #eef2f6;
  --sap-cmd-border: #b9c1c9;
  --sap-cmd-border-focus: #0a6ed1;
  --sap-cmd-bg: #ffffff;
  --sap-font: 'Segoe UI', 'Arial', sans-serif;
}

.sap-window {
  position: relative;
  width: 100%;
  aspect-ratio: 1200 / 675;
  background: var(--sap-body-bg);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  display: grid;
  grid-template-rows: 32px 44px 1fr 28px;
  font-family: var(--sap-font);
  color: var(--sap-text);
  font-size: 13px;
}

/* === Title bar ============================================== */
.sap-titlebar {
  background: var(--sap-titlebar-bg);
  color: var(--sap-titlebar-fg);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 12px;
  font-size: 12px;
}
.sap-titlebar-left { display: flex; align-items: center; gap: 10px; justify-self: start; }
.sap-titlebar-burger { font-size: 16px; cursor: default; }
.sap-titlebar-app { opacity: 0.85; font-size: 11px; }
.sap-titlebar-center {
  justify-self: center;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.sap-titlebar-right { display: flex; align-items: center; gap: 14px; justify-self: end; }
.sap-titlebar-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px;
  opacity: 0.85;
  cursor: default;
  font-size: 13px;
}
.sap-titlebar-close { font-size: 16px; }

/* === Toolbar ================================================ */
.sap-toolbar {
  background: var(--sap-toolbar-bg);
  border-bottom: 1px solid var(--sap-toolbar-border);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  overflow: hidden;
}
.sap-cmd-wrap {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--sap-cmd-border);
  border-radius: 2px;
  background: var(--sap-cmd-bg);
  height: 26px;
  min-width: 180px;
  margin-right: 8px;
  transition: border-color 120ms;
}
.sap-cmd-wrap:focus-within { border-color: var(--sap-cmd-border-focus); box-shadow: 0 0 0 2px rgba(10, 110, 209, 0.18); }

.sap-cmd-input {
  border: 0;
  background: transparent;
  font: inherit;
  font-family: 'Consolas', 'Courier New', 'Menlo', monospace;
  font-size: 13px;
  padding: 0 8px;
  outline: none;
  width: 140px;
  color: var(--sap-text);
  text-transform: uppercase;
}
.sap-cmd-input.correct {
  background: #e8f5ec;
  color: #0a6e3a;
}
.sap-cmd-input.incorrect {
  background: #fbeae8;
  color: #a52a1f;
  animation: shake 500ms ease-out;
}
.sap-cmd-dropdown {
  border: 0;
  border-left: 1px solid var(--sap-cmd-border);
  background: transparent;
  width: 18px;
  font-size: 10px;
  color: var(--sap-text-muted);
  cursor: default;
}

.sap-toolbar-icons {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  overflow: hidden;
}
.sap-toolbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.sap-tool-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--sap-text);
  font-size: 14px;
  cursor: default;
  border-radius: 2px;
}
.sap-tool-icon:hover { background: rgba(0, 0, 0, 0.05); }
.sap-toolbar-more {
  margin-left: 6px;
  font-size: 12px;
  color: var(--sap-text);
  cursor: default;
}
.sap-exit-btn {
  background: transparent;
  border: 0;
  color: var(--sap-text);
  font-size: 13px;
  padding: 4px 10px;
  cursor: default;
}

/* === Body : tree + decorative pane ========================== */
.sap-body {
  display: grid;
  grid-template-columns: minmax(280px, 0.55fr) 1fr;
  background: var(--sap-body-bg);
  overflow: hidden;
}
.sap-tree {
  background: var(--sap-tree-bg);
  padding: 8px 4px 8px 8px;
  overflow-y: auto;
  font-size: 12px;
  color: var(--sap-text);
}
.sap-tree-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px;
  border-radius: 2px;
  cursor: default;
  white-space: nowrap;
}
.sap-tree-row:hover { background: var(--sap-tree-hover); }
.sap-tree-arrow {
  display: inline-flex; align-items: center; justify-content: center;
  width: 12px; color: var(--sap-text-muted);
  font-size: 10px;
}
.sap-tree-folder { font-size: 11px; }
.sap-tree-label { font-size: 12px; }
.sap-tree-child { padding-left: 16px; }

/* === Decorative right pane ================================== */
.sap-decor {
  position: relative;
  background: linear-gradient(135deg, var(--sap-decor-from), var(--sap-decor-to));
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sap-decor-pattern {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 50% 50%, rgba(255,255,255,0.5) 0, transparent 50%),
    repeating-radial-gradient(circle at 50% 50%, transparent 0, transparent 18px, rgba(255,255,255,0.18) 18px, rgba(255,255,255,0.18) 20px);
  opacity: 0.85;
}
.sap-decor-words {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding: 24px;
  align-items: center;
  justify-content: center;
  max-width: 90%;
}
.sap-decor-word {
  font-family: 'Georgia', serif;
  font-style: italic;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  user-select: none;
}
.sap-decor-word:nth-child(odd) { font-size: 16px; }
.sap-decor-word:nth-child(3n) { font-size: 11px; opacity: 0.7; }

/* === Status bar ============================================= */
.sap-statusbar {
  background: var(--sap-statusbar-bg);
  border-top: 1px solid var(--sap-toolbar-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 0 12px;
  font-size: 11px;
  color: var(--sap-text-muted);
}
.sap-execute-btn {
  background: var(--sap-execute-bg);
  color: var(--sap-execute-fg);
  border: 0;
  font-size: 12px;
  padding: 4px 16px;
  cursor: pointer;
  border-radius: 2px;
  font-weight: 600;
}
.sap-execute-btn:hover { filter: brightness(1.08); }

/* === Feedback toast (below command field) =================== */
.sap-cmd-feedback {
  position: absolute;
  top: 76px;
  left: 12px;
  background: var(--c-ink);
  color: var(--c-bg);
  padding: 6px 12px;
  border-radius: var(--r-sm);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  box-shadow: var(--shadow-pop);
  z-index: 5;
  animation: popIn var(--dur-base) var(--ease-out);
  max-width: 320px;
}
.sap-cmd-feedback.ok { background: var(--c-action); }
.sap-cmd-feedback.ko { background: var(--c-error); }

/* === Navigation flash overlay (on correct ME21N) ============ */
.sap-nav-flash {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--c-ink);
  z-index: 50;
  animation: fadeIn 300ms ease-out;
  letter-spacing: 0.01em;
}

/* ============================================================
   CREATE PURCHASE ORDER WINDOW (6 view states)
   ============================================================ */

.sap-window-po {
  grid-template-rows: 32px 36px 1fr 32px;
}

/* --- Title bar menu (Purchase Order Edit Goto ...) -------- */
.sap-titlebar-menu {
  display: flex;
  gap: 14px;
  font-size: 12px;
  margin-left: 8px;
}
.sap-titlebar-menu span {
  cursor: default;
  opacity: 0.9;
}
.sap-titlebar-menu span:first-letter { text-decoration: underline; }

/* --- Toolbar with PO type dropdown + action icons --------- */
.sap-toolbar-po {
  padding: 0 8px;
  gap: 4px;
}
.sap-po-type, .sap-po-type-2 {
  height: 24px;
  border: 1px solid var(--sap-cmd-border);
  font-size: 12px;
  padding: 0 6px;
  background: var(--sap-cmd-bg);
  color: var(--sap-text);
  border-radius: 2px;
}
.sap-po-number, .sap-po-num-input {
  height: 24px;
  border: 1px solid var(--sap-cmd-border);
  background: var(--sap-cmd-bg);
  width: 110px;
  padding: 0 6px;
  font-size: 12px;
  border-radius: 2px;
}
.sap-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  overflow: hidden;
}
.sap-tool-icon-with-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 6px;
  width: auto;
}
.sap-tool-label {
  font-size: 11px;
  color: var(--sap-text);
}

/* --- Header form (Supplier + Doc Date) -------------------- */
.sap-po-body {
  background: var(--sap-body-bg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.sap-po-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--sap-toolbar-border);
}
.sap-cart-icon {
  font-size: 16px;
}
.sap-field-label {
  font-size: 12px;
  color: var(--sap-text);
  margin-left: 8px;
  white-space: nowrap;
}
.sap-supplier-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 380px;
}
/* The field box wraps the input + the F4 button */
.sap-supplier-field {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--sap-cmd-border);
  background: var(--sap-cmd-bg);
  height: 22px;
  border-radius: 2px;
  overflow: hidden;
  transition: border-color 120ms, box-shadow 120ms;
}
.sap-supplier-wrap-active .sap-supplier-field,
.sap-supplier-field:focus-within {
  border-color: var(--sap-cmd-border-focus);
  box-shadow: 0 0 0 2px rgba(10, 110, 209, 0.18);
}
.sap-supplier-input {
  border: 0;
  background: transparent;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 12px;
  padding: 0 6px;
  width: 110px;
  color: var(--sap-text);
  outline: none;
}
.sap-supplier-input.correct {
  background: rgba(232, 245, 236, 0.6);
  color: #0a6e3a;
}
.sap-supplier-input.incorrect {
  background: rgba(251, 234, 232, 0.6);
  color: #a52a1f;
  animation: shake 500ms ease-out;
}

/* F4 search help button — small square inside the field, on the right */
.sap-f4-btn {
  width: 20px;
  height: 100%;
  border: 0;
  border-left: 1px solid var(--sap-cmd-border);
  background: #eef2f6;
  color: var(--sap-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  padding: 0;
  flex-shrink: 0;
  transition: background 120ms;
}
.sap-f4-btn .sap-f4-glyph {
  display: inline-flex;
  width: 14px;
  height: 14px;
  line-height: 1;
}
.sap-f4-btn .sap-f4-glyph svg {
  width: 100%;
  height: 100%;
  display: block;
}
.sap-f4-btn:hover { background: #dde4eb; }
.sap-f4-btn-active {
  cursor: pointer;
  background: #cfe4f7;
  color: var(--sap-link);
  animation: f4Pulse 1.8s ease-in-out infinite;
}
.sap-f4-btn-active:hover {
  background: #b5d4f0;
}
@keyframes f4Pulse {
  0%, 100% { box-shadow: inset 0 0 0 0 rgba(10, 110, 209, 0); }
  50%      { box-shadow: inset 0 0 0 2px rgba(10, 110, 209, 0.5); }
}
.sap-supplier-name {
  font-size: 12px;
  color: var(--sap-text);
  padding: 3px 4px 0;
  white-space: nowrap;
  overflow: hidden;
}
.sap-doc-date {
  display: flex;
  align-items: stretch;
  gap: 4px;
  border: 1px solid var(--sap-cmd-border);
  background: var(--sap-cmd-bg);
  height: 22px;
  border-radius: 2px;
  padding: 0 4px;
}
.sap-date-input {
  border: 0;
  background: transparent;
  font-size: 12px;
  width: 80px;
  text-align: center;
}
.sap-date-indicator {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #d34c2f;
  align-self: center;
}

/* --- Tabs row --------------------------------------------- */
.sap-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--sap-toolbar-border);
  background: #fbfbfc;
  padding: 0 8px;
  overflow-x: auto;
}
.sap-tab {
  padding: 6px 10px;
  font-size: 11.5px;
  color: var(--sap-text);
  cursor: default;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.sap-tab:hover { background: rgba(0, 0, 0, 0.03); }
.sap-tab.active {
  color: var(--sap-link);
  border-bottom-color: var(--sap-link);
  font-weight: 600;
}

/* --- Content area (Org Data / Items) ---------------------- */
.sap-po-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* --- Org Data section ------------------------------------- */
.sap-org-section {
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 110px;
}
.sap-org-section.sap-org-empty {
  min-height: 50px;
  padding: 8px 12px;
}
.sap-org-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.sap-org-row { position: relative; }
.sap-org-hint-i {
  display: inline-flex;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: transparent;
  color: var(--sap-text-muted);
  font-style: italic;
  font-size: 11px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--sap-cmd-border);
  cursor: help;
  font-family: 'Georgia', serif;
  transition: background 120ms, color 120ms, border-color 120ms;
}
.sap-org-hint-i:hover,
.sap-org-hint-i:focus {
  background: var(--sap-link);
  color: #fff;
  border-color: var(--sap-link);
  outline: none;
}
.sap-org-tooltip {
  position: absolute;
  left: 30px;
  top: 100%;
  margin-top: 4px;
  max-width: 320px;
  background: var(--c-ink);
  color: var(--c-bg);
  padding: 10px 14px;
  border-radius: var(--r-md);
  font-size: 12px;
  font-family: var(--font-body);
  line-height: 1.5;
  box-shadow: var(--shadow-pop);
  z-index: 30;
  pointer-events: none;
  animation: fadeIn 180ms ease-out;
}
.sap-org-tooltip strong { display: block; margin-bottom: 4px; font-size: 12px; }
.sap-org-tooltip[hidden] { display: none; }
.sap-org-input {
  border: 1px solid var(--sap-cmd-border);
  background: var(--sap-cmd-bg);
  height: 22px;
  width: 80px;
  padding: 0 6px;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 12px;
  border-radius: 2px;
  outline: none;
}
.sap-org-input:focus {
  border-color: var(--sap-cmd-border-focus);
  box-shadow: 0 0 0 2px rgba(10, 110, 209, 0.18);
}
.sap-org-input.correct {
  background: #e8f5ec;
  color: #0a6e3a;
  border-color: #0a6e3a;
}
.sap-org-input.incorrect {
  background: #fbeae8;
  color: #a52a1f;
  border-color: #a52a1f;
  animation: shake 500ms ease-out;
}
.sap-org-input.filled {
  color: var(--sap-text);
  background: var(--sap-cmd-bg);
}
.sap-org-desc {
  font-size: 12px;
  color: var(--sap-text);
  padding-left: 4px;
}
.sap-org-feedback {
  font-size: 11px;
  color: #a52a1f;
  padding-left: 8px;
}

/* --- Items table ------------------------------------------ */
.sap-items-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--sap-body-bg);
  overflow: hidden;
}
.sap-items-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-top: 1px solid var(--sap-toolbar-border);
  border-bottom: 1px solid var(--sap-toolbar-border);
  background: #fbfbfc;
  flex-shrink: 0;
}
.sap-items-select {
  height: 22px;
  border: 1px solid var(--sap-cmd-border);
  background: var(--sap-cmd-bg);
  font-size: 11px;
  padding: 0 4px;
  border-radius: 2px;
  min-width: 100px;
}
.sap-items-select-wide { min-width: 240px; }
.sap-items-label { font-size: 11px; color: var(--sap-text); }

.sap-items-scroll {
  flex: 1;
  overflow: auto;
  background: #fff;
}
.sap-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
.sap-items-table th,
.sap-items-table td {
  border-right: 1px solid var(--sap-toolbar-border);
  border-bottom: 1px solid var(--sap-toolbar-border);
  padding: 3px 4px;
  text-align: left;
  white-space: nowrap;
  height: 20px;
}
.sap-items-table th {
  background: #f1f3f6;
  font-weight: 500;
  color: var(--sap-text);
}
.sap-items-col-0 { width: 24px; text-align: center; color: var(--sap-text-muted); }
.sap-items-col-1 { width: 32px; }
.sap-items-col-2 { width: 48px; }
.sap-items-col-3 { width: 22px; }
.sap-items-col-4 { width: 22px; text-align: center; color: #d34c2f; font-weight: 700; }
.sap-items-col-5 { width: 110px; }
.sap-items-col-6 { width: 180px; overflow: hidden; text-overflow: ellipsis; }
.sap-items-col-7 { width: 90px; }
.sap-items-col-8 { width: 36px; }
.sap-items-col-9 { width: 26px; text-align: center; }
.sap-items-col-10 { width: 22px; }
.sap-items-col-11 { width: 80px; }
.sap-items-col-12 { width: 70px; text-align: right; }
.sap-items-col-13 { width: 42px; }
.sap-items-col-14 { width: 30px; }
.sap-items-col-15 { width: 30px; }
.sap-items-col-16 { width: 100px; }
.sap-items-col-17 { width: 100px; }
.sap-items-col-18 { width: 90px; }

.sap-items-row-empty td { color: var(--sap-text-muted); }
.sap-items-row-first { background: #fff; }
.sap-items-material-link { color: var(--sap-link); cursor: pointer; }

.sap-items-cell-active {
  background: #fff7e0;
  border: 1.5px solid #f0b400 !important;
}
.sap-items-cell-qty {
  background: #e3f0fd;
}
.sap-items-cell-qty-active {
  background: #e3f0fd;
  border: 1.5px solid #0a6ed1 !important;
}
.sap-items-input {
  border: 0;
  background: transparent;
  width: 100%;
  height: 18px;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 11px;
  padding: 0;
  outline: none;
  color: var(--sap-text);
}
.sap-items-input.correct {
  background: #e8f5ec;
  color: #0a6e3a;
}
.sap-items-input.incorrect {
  background: #fbeae8;
  color: #a52a1f;
  animation: shake 500ms ease-out;
}

/* --- Item footer ------------------------------------------ */
.sap-item-footer {
  border-top: 1px solid var(--sap-toolbar-border);
  background: #fbfbfc;
  padding: 4px 12px;
  flex-shrink: 0;
}
.sap-item-footer-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
}
.sap-default-values, .sap-addl-planning {
  height: 22px;
  border: 1px solid var(--sap-cmd-border);
  background: var(--sap-cmd-bg);
  color: var(--sap-text);
  padding: 0 14px;
  font-size: 11px;
  border-radius: 2px;
  margin-left: 8px;
  cursor: default;
}
.sap-item-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.sap-item-select {
  height: 22px;
  border: 1px solid var(--sap-cmd-border);
  background: var(--sap-cmd-bg);
  font-size: 11px;
  padding: 0 4px;
  border-radius: 2px;
  min-width: 280px;
}

/* --- Status bar variants ---------------------------------- */
.sap-statusbar-empty .sap-statusbar-dot { color: #d34c2f; margin-right: 4px; }
.sap-statusbar-msg-info { color: var(--sap-text); font-size: 11px; }

.sap-statusbar-warning {
  background: #fef6e3;
  border-top-color: #f0b400;
}
.sap-warning-icon {
  background: transparent;
  border: 0;
  font-size: 14px;
  cursor: pointer;
  color: #d34c2f;
  padding: 0 6px;
  animation: pulse 1.6s ease-out infinite;
}
.sap-warning-icon:hover { transform: scale(1.15); }
.sap-warning-text {
  color: var(--sap-text);
  font-size: 11px;
}
.sap-statusbar-right {
  margin-left: auto;
  display: flex;
  gap: 4px;
  padding-right: 4px;
}
.sap-save-btn, .sap-cancel-btn {
  height: 22px;
  border: 1px solid var(--sap-cmd-border);
  background: var(--sap-cmd-bg);
  padding: 0 16px;
  font-size: 11px;
  border-radius: 2px;
  cursor: default;
}
.sap-save-btn-active {
  background: var(--sap-execute-bg);
  color: var(--sap-execute-fg);
  border-color: var(--sap-execute-bg);
  cursor: pointer;
  animation: pulse 1.8s ease-out infinite;
}
.sap-save-btn-active:hover { filter: brightness(1.08); }
.sap-save-btn-dimmed {
  opacity: 0.5;
}

/* ============================================================
   SUPPLIER SEARCH HELP DIALOG (overlay on Create PO)
   ============================================================ */
.sap-dialog-overlay {
  position: absolute;
  inset: 0;
  background: rgba(36, 59, 83, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn var(--dur-base) var(--ease-out);
  backdrop-filter: blur(1px);
}
.sap-dialog-overlay.closing { animation: fadeOut var(--dur-base) var(--ease-out) forwards; }

.sap-dialog {
  background: var(--c-bg);
  width: 88%;
  max-width: 460px;
  border-radius: 8px;
  box-shadow: var(--shadow-pop);
  overflow: hidden;
  animation: popIn var(--dur-base) var(--ease-out);
  font-family: var(--sap-font);
}
.sap-dialog-header {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--sap-toolbar-border);
  gap: 8px;
}
.sap-dialog-burger { font-size: 14px; color: var(--sap-text-muted); }
.sap-dialog-title {
  flex: 1;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--sap-text);
}
.sap-dialog-close-x {
  background: transparent;
  border: 0;
  font-size: 18px;
  color: var(--sap-text-muted);
  cursor: pointer;
  padding: 0 4px;
}

.sap-dialog-tabs {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--sap-toolbar-border);
  padding: 0 8px;
  gap: 4px;
  overflow: hidden;
}
.sap-dialog-tab-arrow {
  font-size: 13px;
  color: var(--sap-text-muted);
  padding: 6px 4px;
  cursor: default;
}
.sap-dialog-tab {
  font-size: 11px;
  color: var(--sap-text);
  padding: 6px 8px;
  cursor: default;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}
.sap-dialog-tab.active {
  color: var(--sap-link);
  border-bottom-color: var(--sap-link);
  font-weight: 600;
}

.sap-dialog-body {
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sap-dialog-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.sap-dialog-label {
  width: 120px;
  text-align: right;
  font-size: 11px;
  color: var(--sap-text);
}
.sap-dialog-input {
  border: 1px solid var(--sap-cmd-border);
  background: var(--sap-cmd-bg);
  height: 20px;
  padding: 0 6px;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 11px;
  border-radius: 2px;
  outline: none;
}
.sap-dialog-input-tiny { width: 50px; }
.sap-dialog-input-short { width: 110px; }
.sap-dialog-input-long { width: 200px; }
.sap-dialog-input-active {
  width: 110px;
  border-color: var(--sap-cmd-border-focus);
  box-shadow: 0 0 0 2px rgba(10, 110, 209, 0.18);
}
.sap-dialog-input-active.correct {
  background: #e8f5ec;
  color: #0a6e3a;
  border-color: #0a6e3a;
}
.sap-dialog-input-active.incorrect {
  background: #fbeae8;
  color: #a52a1f;
  border-color: #a52a1f;
  animation: shake 500ms ease-out;
}
.sap-dialog-supplier-pre {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--sap-cmd-border);
  background: var(--sap-cmd-bg);
  border-radius: 2px;
  color: var(--sap-text-muted);
  font-size: 13px;
}

.sap-dialog-footer {
  display: flex;
  gap: 14px;
  justify-content: flex-end;
  padding: 6px 14px;
  border-top: 1px solid var(--sap-toolbar-border);
  background: #fbfbfc;
}
.sap-dialog-action {
  font-size: 11px;
  color: var(--sap-link);
  cursor: default;
}
.sap-dialog-action-clickable { cursor: pointer; }
.sap-dialog-action-clickable:hover { text-decoration: underline; }

/* === Responsive ============================================= */
@media (max-width: 768px) {
  .sap-window { font-size: 11px; }
  .sap-cmd-wrap { min-width: 130px; }
  .sap-cmd-input { width: 90px; font-size: 11px; }
  .sap-decor-word { font-size: 11px; }
  .sap-decor-word:nth-child(odd) { font-size: 13px; }
  .sap-body { grid-template-columns: 45% 55%; }
  .sap-po-header { flex-wrap: wrap; }
  .sap-tab { font-size: 10px; padding: 4px 6px; }
}
