/* BGE-App — colors sampled from the SRS sketch pages */
:root {
  --c-klaerungen: #FAD6BA;
  --c-sv: #FEE599;
  --c-pl: #B7DDE8;
  --c-komm: #D9958F;
  --c-action: #FFF2CC;      /* Login / Logout buttons */
  --c-popup-bg: #FBE3D6;
  --c-navy: #1A688B;        /* popup X / download buttons / labels */
  --c-navy-dark: #14506C;
  --c-nukem-orange: #E6561D;
  --c-nukem-text: #444444;
  --c-border: #9a9a9a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  background: #ececec;
  color: #222;
}

/* ---------- Screen frame (mirrors the bordered page in the SRS sketches) ---------- */
.screen {
  position: relative;
  width: 960px;
  min-height: 600px;
  margin: 24px auto;
  background: #fff;
  border: 1px solid var(--c-border);
}

/* ---------- Logos ---------- */
.logo-nukem-img { display: block; height: auto; }
.logo-nukem-footer { width: 170px; }
.logo-nukem-login { width: 230px; margin: 0 auto; }

.logo-bge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 64px; height: 64px;
  background: linear-gradient(135deg, #4E7DA0 0%, #2C567A 100%);
  color: #fff; font-size: 24px; font-weight: 800; letter-spacing: 1px;
}

/* ---------- Module buttons and submenus ---------- */
.modules {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 18px 30px 0;
}

.module-col { display: flex; flex-direction: column; gap: 0; width: 150px; flex: none; }
.module-col .btn { width: 100%; box-sizing: border-box; }

.btn {
  border: 1px solid #8a6d3b;
  border-radius: 2px;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 1px 1px 2px rgba(0,0,0,.25);
  text-align: center;
}
.btn:active { transform: translateY(1px); }

.btn-mod { min-width: 110px; }
.btn-sub {
  min-width: 110px;
  margin-top: 8px;
  font-weight: 400;
  font-size: 13px;
  padding: 6px 6px;
}

.m-klaerungen { background: var(--c-klaerungen); border-color: #c79b6d; }
.m-sv         { background: var(--c-sv);         border-color: #c9a94e; }
.m-pl         { background: var(--c-pl);         border-color: #7fa8b8; }
.m-komm       { background: var(--c-komm);       border-color: #a86a66; }

.submenu { display: none; flex-direction: column; align-items: stretch; }
.submenu.open { display: flex; }
.submenu-arrow { text-align: center; color: #666; font-size: 14px; margin-top: 4px; }

/* ---------- Starting page center / footer ---------- */
.center-block {
  position: absolute;
  top: 390px; left: 0; right: 0;
  text-align: center;
}
.center-block .welcome { font-size: 17px; margin-bottom: 10px; }
.btn-action {
  background: var(--c-action);
  border: 1px solid #bfae6e;
  border-radius: 2px;
  padding: 5px 34px;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 1px 1px 2px rgba(0,0,0,.2);
}

.screen-footer {
  position: absolute;
  left: 18px; right: 18px; bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

/* ---------- Login page ---------- */
.login-card {
  width: 460px;
  margin: 60px auto;
  background: #fff;
  border: 1px solid var(--c-border);
  padding: 16px 60px 50px;
  text-align: center;
}
.lang-switch-card {
  text-align: right;
  font-size: 12px;
  color: #666;
  margin-bottom: 10px;
}
.lang-switch-card select { font-size: 12px; margin-left: 4px; }
.login-card .logo-stack { display: flex; flex-direction: column; align-items: center; gap: 18px; margin-bottom: 36px; }
.login-field { text-align: left; margin-bottom: 18px; }
.login-field label { display: block; font-size: 13px; margin-bottom: 3px; }
.login-field input {
  width: 100%;
  padding: 7px 8px;
  border: 1px solid #8c8c8c;
  font-size: 13px;
}
.login-success {
  display: none;
  margin-top: 14px;
  padding: 8px 12px;
  background: #e3f2e1;
  border: 1px solid #5a9e54;
  color: #2e6b2a;
  font-size: 13px;
  border-radius: 3px;
}
.login-success.show { display: block; }
.login-error {
  display: none;
  margin-top: 14px;
  padding: 8px 12px;
  background: #fbe3e1;
  border: 1px solid #c05a50;
  color: #8c2f27;
  font-size: 13px;
  border-radius: 3px;
}
.login-error.show { display: block; }
.login-info {
  display: none;
  margin-top: 14px;
  padding: 8px 12px;
  background: #eef3f8;
  border: 1px solid #7a93ad;
  color: #33506b;
  font-size: 13px;
  border-radius: 3px;
}
.login-info.show { display: block; }

/* In-popup feedback (e.g. change-password form) */
.form-error {
  display: none;
  margin-top: 14px;
  padding: 8px 12px;
  background: #fbe3e1;
  border: 1px solid #c05a50;
  color: #8c2f27;
  font-size: 13px;
  border-radius: 3px;
}
.form-error.show { display: block; }
.form-success {
  display: none;
  margin-top: 14px;
  padding: 8px 12px;
  background: #e3f2e1;
  border: 1px solid #5a9e54;
  color: #2e6b2a;
  font-size: 13px;
  border-radius: 3px;
}
.form-success.show { display: block; }

/* ---------- Pop-ups ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.overlay.open { display: flex; }

.popup {
  position: relative;
  width: 620px;
  background: var(--c-popup-bg);
  border: 1px solid #b98a7a;
  box-shadow: 0 6px 24px rgba(0,0,0,.35);
  padding: 18px 22px 22px;
}
.popup-close {
  position: absolute;
  top: 0; right: 0;
  width: 34px; height: 34px;
  background: var(--c-navy);
  color: #fff;
  border: none;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
.popup-close:hover { background: var(--c-navy-dark); }

.bearbeiter-box {
  border: 1.5px solid var(--c-navy);
  padding: 10px 14px 12px;
  margin-bottom: 18px;
}
.bearbeiter-box .box-title {
  color: var(--c-navy);
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 8px;
}
.person-grid {
  display: grid;
  grid-template-columns: 70px 150px 60px 170px;
  align-items: center;
  row-gap: 10px;
  column-gap: 8px;
  font-size: 12.5px;
}
.person-grid.no-rolle { grid-template-columns: 70px 150px; }
.person-grid .lbl { text-align: right; padding-right: 4px; }
.person-grid select {
  width: 100%;
  padding: 4px;
  font-size: 12.5px;
  border: 1px solid #8c8c8c;
  background: #fff;
}

.field-row {
  display: flex;
  align-items: center;
  margin-bottom: 14px;
}
.field-row label {
  width: 210px;
  color: var(--c-navy);
  font-weight: 700;
  font-size: 13px;
}
.field-row input, .field-row select {
  flex: 1;
  padding: 6px 8px;
  font-size: 13px;
  border: 1px solid #8c8c8c;
  background: #fff;
}

.popup-actions { text-align: right; margin-top: 8px; }
.btn-download {
  background: var(--c-navy);
  color: #fff;
  border: none;
  padding: 9px 18px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}
.btn-download:hover:not(:disabled) { background: var(--c-navy-dark); }
.btn-download:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- Notifications ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 10px 18px;
  border-radius: 4px;
  font-size: 13.5px;
  display: none;
  z-index: 200;
  max-width: 80%;
}
.toast.show { display: block; }

/* ---------- Confirm dialog (logout) ---------- */
.confirm-box {
  background: #fff;
  border: 1px solid #888;
  box-shadow: 0 8px 30px rgba(0,0,0,.4);
  padding: 28px 36px;
  text-align: center;
  max-width: 420px;
}
.confirm-text { font-size: 15px; margin-bottom: 16px; }
.confirm-actions { display: flex; gap: 12px; justify-content: center; }
.btn-secondary { background: #f0f0f0; border-color: #999; color: #333; }

.filename-box {
  position: fixed;
  left: 50%; top: 50%;
  transform: translate(-50%,-50%);
  background: #fff;
  border: 1px solid #888;
  box-shadow: 0 8px 30px rgba(0,0,0,.4);
  padding: 24px 30px;
  z-index: 300;
  display: none;
  max-width: 640px;
  text-align: center;
}
.filename-box.show { display: block; }
.filename-box .fn-success {
  color: #2e6b2a;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 10px;
}
.filename-box .fn {
  font-family: Consolas, monospace;
  font-size: 13px;
  background: #f4f4f4;
  border: 1px solid #ccc;
  padding: 8px 10px;
  margin: 12px 0 16px;
  word-break: break-all;
}

/* ---------- User menu (history, password, language, logout) ---------- */
.user-menu {
  margin-left: auto;
  flex: none;
  position: relative;
}
.user-menu-btn {
  padding: 2px 0;
  font-size: 13px;
  font-weight: 400;
  color: #666;
  background: none;
  border: none;
  box-shadow: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.user-menu-btn:hover { color: #333; }
.user-menu-btn .caret { font-size: 10px; }
.user-menu-list {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 100%;
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: 2px;
  box-shadow: 2px 3px 8px rgba(0,0,0,.25);
  z-index: 60;
  padding: 4px 0;
}
.user-menu-list.open { display: block; }
.menu-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 14px;
  border: none;
  background: none;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}
.menu-item:hover { background: #f0f0f0; }
.menu-label {
  padding: 4px 14px 2px;
  font-size: 11px;
  color: #888;
}
.menu-sep { border-top: 1px solid #e3e3e3; margin: 4px 0; }
.lang-check { color: var(--c-navy); font-weight: 700; visibility: hidden; }
.lang-item.active .lang-check { visibility: visible; }

/* ---------- Concept page ---------- */
.concept-cols {
  display: flex;
  gap: 26px;
  align-items: flex-start;
  padding: 18px 30px 0;
}
.concept-cols .module-col .btn-mod { min-width: 120px; }
.concept-cols .btn-sub { min-width: 120px; }

/* ---------- History pop-up ---------- */
.history-popup { width: 640px; max-width: 90%; max-height: 80vh; overflow-y: auto; }
.history-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.history-table th, .history-table td {
  border-bottom: 1px solid #ddd; padding: 5px 6px; text-align: left; vertical-align: top;
}
.history-table th { background: #f0f0f0; font-weight: 700; }
.history-table td:last-child { word-break: break-all; }
.history-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 12px;
  font-size: 13px;
}
.history-pager button:disabled { opacity: .45; cursor: default; }

/* ---------- Language switcher ---------- */
.lang-switch-fixed {
  position: fixed; top: 10px; right: 14px; z-index: 50;
  font-size: 12px; color: #666;
}
.lang-switch-fixed select { font-size: 12px; margin-left: 4px; }
