/* ══════════════════════════════
   THWS SAP - S05
══════════════════════════════ */
#sec-thws { background-color: #000; font-family: 'Segoe UI', Arial, sans-serif; }

#thws-prog { position: absolute; top: 0; left: 0; right: 0; height: 3px; z-index: 9000; }
#thws-prog-fill { height: 100%; width: 0; background: #0044cc; transition: width 0.4s; }

#thws-restart-btn {
  position: absolute; top: 10px; right: 12px; z-index: 9001;
  font-family: Arial, sans-serif; font-size: 11px;
  padding: 5px 12px; background: rgba(255,255,255,0.2); cursor: pointer;
  border: 1px solid rgba(255,255,255,0.3); color: rgba(255,255,255,0.6);
  transition: all 0.2s;
}
#thws-restart-btn:hover { background: rgba(255,255,255,0.35); color: #fff; }

#thws-blackout { position: absolute; inset: 0; z-index: 8990; background: #000; opacity: 0; pointer-events: none; transition: opacity 0.5s; }
#thws-blackout.show { opacity: 1; }

#thws-cursor { position: absolute; z-index: 9999; pointer-events: none; opacity: 0; transition: opacity 0.3s; filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.5)); }
#thws-cursor svg { width: 20px; height: 20px; }
#thws-cursor.click-anim svg { animation: cc 0.18s ease-out; }
@keyframes cc { 0%{transform:scale(1)} 40%{transform:scale(0.75)} 100%{transform:scale(1)} }

/* Desktop ID — Hintergrund kommt von .win-desktop */
#thws-desktop { z-index: 10; }

/* Taskbar */
#thws-taskbar { }
#thws-win-btn {
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  border-radius: 6px; transition: background 0.15s; cursor: pointer;
}
#thws-win-btn:hover { background: rgba(255,255,255,0.1); }
#thws-win-btn svg { width: 16px; height: 16px; }

/* SAP Logon Dialog */
#sap-logon {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  background: #d4d0c8; border: 2px solid #fff;
  border-right-color: #808080; border-bottom-color: #808080;
  padding: 0; display: none; flex-direction: column;
  min-width: 320px; font-family: Arial, sans-serif;
  box-shadow: 2px 2px 8px rgba(0,0,0,0.4);
  color: #000;
}
.slog-title { background: linear-gradient(90deg, #000080, #1084d0); color: #fff; padding: 4px 8px; font-size: 12px; font-weight: bold; display: flex; justify-content: space-between; align-items: center; }
.slog-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; color: #000; }
.slog-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #000; }
.slog-lbl { min-width: 80px; color: #000; }
.slog-field { background: #fff; border: 1px inset #808080; padding: 2px 4px; font-size: 12px; font-family: 'Courier New', monospace; flex: 1; height: 20px; color: #000; }
.slog-bar { height: 16px; background: #fff; border: 1px inset #808080; overflow: hidden; margin-top: 4px; }
.slog-bar-fill { height: 100%; background: #000080; width: 0; transition: width 0.15s; }
.slog-btns { display: flex; gap: 4px; justify-content: flex-end; margin-top: 4px; }
.slog-btn { background: #d4d0c8; border: 1px solid #fff; border-right-color: #808080; border-bottom-color: #808080; padding: 3px 12px; font-size: 12px; cursor: default; font-family: Arial, sans-serif; color: #000; }

/* SAP GUI */
#sap {
  position: absolute; inset: 0; z-index: 10;
  display: none; flex-direction: column;
  background: #d4d0c8; font-family: Arial, sans-serif; font-size: 12px; color: #000;
}
#sap-title {
  background: linear-gradient(180deg, #0a0a80 0%, #0000aa 100%);
  height: 26px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 6px; flex-shrink: 0;
}
.sap-title-ico { font-size: 14px; margin-right: 4px; }
.sap-title-txt { color: #fff; font-size: 11px; font-weight: bold; flex: 1; }
.sap-wbtns { display: flex; }
.sap-wb { width: 20px; height: 20px; background: #d4d0c8; border: 1px outset #d4d0c8; display: flex; align-items: center; justify-content: center; font-size: 10px; color: #000; cursor: default; }
.sap-wb:hover { background: #c0c0c0; }
.sap-wb.x:hover { background: #cc0000; color: #fff; }

#sap-menu { background: #d4d0c8; border-bottom: 1px solid #808080; display: flex; padding: 1px 2px; flex-shrink: 0; }
.sap-mitem { padding: 3px 8px; font-size: 12px; color: #000; cursor: default; }
.sap-mitem:hover, .sap-mitem.active { background: #000080; color: #fff; }

#sap-tb1 {
  background: #d4d0c8; border-bottom: 1px solid #808080;
  padding: 2px 3px; display: flex; gap: 2px; align-items: center; flex-shrink: 0;
}
.stb { width: 24px; height: 22px; background: #d4d0c8; border: 1px outset #d4d0c8; display: flex; align-items: center; justify-content: center; font-size: 11px; cursor: default; color: #000; }
.stb:hover { background: #c8c8c8; }
.stb-sep { width: 1px; height: 20px; background: #808080; margin: 0 2px; }
#cmd-field { background: #fff; border: 1px inset #808080; padding: 1px 3px; font-size: 12px; font-family: 'Courier New', monospace; width: 140px; height: 20px; color: #000; }

#sap-tb2 {
  background: #d4d0c8; border-bottom: 2px solid #808080;
  padding: 2px 3px; display: flex; gap: 2px; align-items: center; flex-shrink: 0;
}
.se38-btn {
  height: 22px; background: #d4d0c8; border: 1px outset #d4d0c8;
  display: flex; align-items: center; gap: 3px;
  padding: 0 6px; font-size: 11px; cursor: default; white-space: nowrap; color: #000;
}
.se38-btn:hover { background: #c8c8c8; }
.se38-btn.active { background: #c0c0ff; border: 1px inset #808080; }
.se38-prog-field {
  background: #fff; border: 1px inset #808080;
  padding: 1px 4px; font-size: 12px; font-family: 'Courier New', monospace;
  width: 200px; height: 22px; color: #000; font-weight: bold;
}

#sap-screen-hdr {
  background: linear-gradient(180deg, #5577cc, #3355aa);
  color: #fff; padding: 3px 10px; font-size: 12px; font-weight: bold;
  flex-shrink: 0; display: flex; align-items: center; justify-content: space-between;
}
.sap-hdr-tcode { font-size: 10px; color: rgba(255,255,255,0.6); font-weight: normal; }

#se38-initial {
  flex: 1; padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; overflow: hidden;
}
.se38-field-row { display: flex; align-items: center; gap: 6px; }
.se38-field-lbl { min-width: 140px; font-size: 12px; font-weight: bold; color: #000; text-align: right; }
.se38-field-val { background: #fff; border: 1px inset #808080; padding: 1px 4px; font-size: 12px; font-family: 'Courier New', monospace; width: 280px; height: 20px; color: #000; }
.se38-field-val.active { border-color: #000080; outline: 1px solid #000080; }
.se38-radio-group { display: flex; gap: 12px; margin-left: 148px; font-size: 12px; color: #000; }
.se38-radio { display: flex; align-items: center; gap: 4px; color: #000; }
.se38-radio input { accent-color: #000080; }
.se38-section-bar { background: #c8c8e8; border: 1px solid #8888aa; padding: 2px 6px; font-size: 11px; font-weight: bold; color: #000033; margin: 4px 0; }

#se38-editor { flex: 1; display: none; flex-direction: column; overflow: hidden; }
#editor-toolbar {
  background: #d4d0c8; border-bottom: 1px solid #808080;
  padding: 2px 3px; display: flex; gap: 2px; flex-shrink: 0;
}
.ed-btn { height: 20px; background: #d4d0c8; border: 1px outset #d4d0c8; padding: 0 5px; font-size: 11px; cursor: default; color: #000; }
.ed-btn:hover { background: #c8c8c8; }
.ed-btn.key { background: #e8e8ff; font-weight: bold; color: #000080; }
#editor-area { flex: 1; display: flex; overflow-y: scroll; font-family: 'Courier New', monospace; font-size: 15px; background: #fff; }
#line-numbers { background: #e8e8e8; border-right: 1px solid #c0c0c0; padding: 4px 6px; min-width: 40px; text-align: right; color: #808080; font-size: 14px; line-height: 1.55; user-select: none; white-space: pre; flex-shrink: 0; align-self: flex-start; }
#code-area { flex: 1; background: #fff; padding: 4px 8px; line-height: 1.55; white-space: pre; align-self: flex-start; width: 100%; }
#results-table { width: 100%; border-collapse: collapse; font-size: 15px; font-family: 'Courier New', monospace; }

.kw   { color: #0000ff; font-weight: bold; }
.str  { color: #cc0000; }
.cmt  { color: #006600; font-style: italic; }
.type { color: #800080; font-weight: bold; }
.op   { color: #000000; font-weight: bold; }
.num  { color: #cc6600; }
.cur-line { background: #e8f0ff; display: block; }
.tw-caret { display: inline-block; width: 2px; height: 1.1em; background: #000; vertical-align: middle; animation: caret 1s step-end infinite; }
@keyframes caret { 50%{opacity:0} }

#se38-results { flex: 1; display: none; flex-direction: column; overflow: hidden; }
#results-toolbar {
  background: #d4d0c8; border-bottom: 1px solid #808080;
  padding: 2px 3px; display: flex; gap: 2px; align-items: center; flex-shrink: 0;
}
#results-header { background: linear-gradient(180deg, #5577cc, #3355aa); color: #fff; padding: 3px 10px; font-size: 12px; font-weight: bold; flex-shrink: 0; }
#results-table-wrap { flex: 1; overflow: auto; padding: 0; }
#results-table { width: 100%; border-collapse: collapse; font-size: 15px !important; font-family: 'Courier New', monospace; }
#results-table th { background: linear-gradient(180deg, #4466aa, #2244aa); color: #fff; padding: 6px 14px; text-align: left; border: 1px solid #3355aa; font-weight: bold; white-space: nowrap; font-size: 15px !important; }
#results-table td { padding: 5px 14px; border: 1px solid #c8c8c8; background: #fff; color: #000; white-space: nowrap; opacity: 0; transition: opacity 0.2s; font-size: 15px !important; }
#results-table tr:nth-child(even) td { background: #eeeeff; }
#results-table td.vis { opacity: 1; }
#results-table td.em { color: #000080; font-weight: bold; }
#results-table td.ok { color: #006600; font-weight: bold; }
#results-table td.hl { color: #cc4400; font-weight: bold; }

#sap-statusbar {
  background: #d4d0c8; border-top: 2px solid #808080;
  padding: 2px 8px; display: flex; justify-content: space-between;
  font-size: 11px; color: #000; flex-shrink: 0; align-items: center;
  font-family: Arial, sans-serif; height: 20px;
}
.sap-status-ok { color: #006600; }
.sap-status-info { color: #000080; font-weight: bold; }

#thws-spotlight {
  position: absolute; inset: 0; z-index: 500;
  background: rgba(0,0,0,0); pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.8s;
}
#thws-spotlight.dim { background: rgba(0,0,0,0.88); }
#thws-sp-box { opacity: 0; transition: opacity 0.6s 0.3s; text-align: center; font-family: Arial, sans-serif; }
#thws-spotlight.dim #thws-sp-box { opacity: 1; }
.sp-label { font-size: 11px; letter-spacing: 0.25em; color: rgba(255,255,255,0.4); text-transform: uppercase; display: block; margin-bottom: 16px; }
.sp-main { font-size: clamp(28px,4vw,52px); font-weight: bold; color: #fff; display: block; margin-bottom: 8px; }
.sp-sub { font-size: clamp(13px,1.6vw,18px); color: rgba(255,255,255,0.65); display: block; margin-bottom: 4px; }
.sp-det { font-size: clamp(10px,1.1vw,13px); color: rgba(255,255,255,0.35); display: block; }
.sp-rule { width: 160px; height: 1px; background: rgba(255,255,255,0.2); margin: 14px auto; }