:root {
  --sidebar: 268px;
  --topbar: 78px;
  --navy: #17396f;
  --navy-dark: #18345f;
  --navy-hover: #274879;
  --coral: #ec6b58;
  --ink: #162f59;
  --muted: #67778b;
  --line: #d5dde7;
  --soft: #f2f5f8;
  --success: #315f48;
  --warn: #8a5a10;
  --font: "soleil", "Avenir Next", Avenir, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }

html,
body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: #f4f6f8;
  font-family: "soleil", "Avenir Next", Avenir, "Segoe UI", Arial, sans-serif;
}

button,
input,
select { font: inherit; color: inherit; }
button { cursor: pointer; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  width: var(--sidebar);
  min-width: 0;
  background: var(--navy-dark);
  color: #fff;
}

.sidebar-project {
  display: grid;
  gap: 9px;
  padding: 22px 16px 12px;
}

.project-label {
  color: #aebdd0;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .14em;
}

.project-select {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #58779e;
  border-radius: 4px;
  outline: none;
  background: #274879;
  color: #fff;
  font-size: 11px;
}

.project-select:focus,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #f3b2a8;
  outline-offset: 1px;
}

.project-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.small-btn {
  min-height: 30px;
  padding: 5px 4px;
  border: 1px solid #6e8db3;
  border-radius: 3px;
  background: transparent;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

.small-btn:hover { background: var(--navy-hover); }
.small-btn.danger { border-color: #e89083; color: #ffd9d3; }

.sidebar nav {
  display: grid;
  align-content: start;
  min-width: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 52px;
  padding: 10px 16px;
  border: 0;
  border-left: 4px solid transparent;
  background: transparent;
  color: #e5ebf3;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
}

.nav-item:hover { background: #213f6b; }
.nav-item.active { border-left-color: var(--coral); background: var(--navy-hover); color: #fff; }
.nav-icon { flex: 0 0 22px; width: 22px; color: var(--coral); text-align: center; font-size: 16px; line-height: 1; }
.nav-label { min-width: 0; overflow-wrap: anywhere; }

.sidebar-foot {
  display: grid;
  gap: 4px;
  margin-top: auto;
  padding: 20px;
  border-top: 1px solid #31507b;
}

.sidebar-foot img { display: block; width: 150px; height: auto; margin-bottom: 8px; }
.sidebar-foot strong { font-size: 14px; }
.sidebar-foot small { color: #aebdd0; line-height: 1.35; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  min-height: var(--topbar);
  margin-left: var(--sidebar);
  width: calc(100vw - var(--sidebar));
  max-width: calc(100vw - var(--sidebar));
  padding: 0 18px;
  gap: 12px;
  border-bottom: 1px solid #c6d0dc;
  background: #fff;
  box-shadow: 0 3px 12px #102d5812;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 178px;
  width: 178px;
  height: 54px;
  padding: 10px 16px;
  border: 0;
  background: var(--navy);
}

.brand img { display: block; width: 146px; height: auto; }

.top-title { display: grid; min-width: 0; }
.top-title span { color: #8392a7; font-size: 9px; font-weight: 700; letter-spacing: .17em; }
.top-title strong { overflow-wrap: anywhere; font-size: 15px; }
.top-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; margin-left: auto; }
.status-pill,
.user-pill { display: inline-flex; align-items: center; min-height: 30px; padding: 6px 10px; border-radius: 16px; font-size: 10px; font-weight: 700; }
.status-pill { background: #edf4ef; color: var(--success); }
.status-pill.error { background: #fff0ed; color: #923629; }
.user-pill { background: var(--soft); color: var(--muted); }

main {
  min-width: 0;
  max-width: calc(100vw - var(--sidebar));
  margin-left: var(--sidebar);
}

.hero {
  position: sticky;
  top: var(--topbar);
  z-index: 10;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  min-width: 0;
  padding: 24px 30px;
  background: var(--navy);
  color: #fff;
}

.hero .eyebrow { color: #b5c2d4; }
.hero h1 { margin: 5px 0 4px; overflow-wrap: anywhere; font-size: 30px; line-height: 1.1; }
.hero p { margin: 0; color: #dce4ee; font-size: 12px; }

.context-card {
  flex: 0 1 220px;
  min-width: 180px;
  padding: 12px 14px;
  border-left: 4px solid var(--coral);
  background: #fff;
  color: var(--ink);
  box-shadow: 0 3px 14px #10273c20;
}

.context-card span,
.context-card small { display: block; color: var(--muted); font-size: 9px; }
.context-card b { display: block; margin: 4px 0; overflow-wrap: anywhere; color: var(--navy); font-size: 13px; }

#content { min-width: 0; padding: 22px 30px 44px; }
.eyebrow { color: #8392a7; font-size: 9px; font-weight: 700; letter-spacing: .17em; }

.toast {
  position: fixed;
  top: 92px;
  right: 26px;
  z-index: 30;
  display: none;
  max-width: 390px;
  padding: 11px 14px;
  border-radius: 4px;
  background: var(--navy);
  color: #fff;
  font-size: 11px;
  box-shadow: 0 6px 20px #102d5840;
}

.toast.show { display: block; }
.toast.error { background: #a93024; }

.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 0 0 12px; }
.section-head h2 { margin: 0; color: var(--navy); font-size: 20px; }
.section-head p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }

.filter-bar {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 13px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--coral);
  background: #fff;
}

.filter-bar label,
.form-grid label { display: block; color: var(--muted); font-size: 10px; font-weight: 700; }
.filter-bar select,
.form-grid input,
.form-grid select { display: block; min-width: 130px; margin-top: 5px; padding: 8px 9px; border: 1px solid #b9c5d4; border-radius: 2px; background: #fff; font-size: 11px; }

.primary-btn,
.secondary-btn {
  min-height: 36px;
  padding: 7px 13px;
  border-radius: 2px;
  font-size: 11px;
  font-weight: 700;
}

.primary-btn { border: 1px solid var(--navy); background: var(--navy); color: #fff; }
.secondary-btn { border: 1px solid #9fb0c5; background: #fff; color: var(--navy); }
.primary-btn,
.secondary-btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.primary-btn:hover { background: var(--navy-hover); }
.secondary-btn:hover { background: var(--soft); }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr));
  align-items: stretch;
  gap: 12px;
  margin-bottom: 16px;
}

.kpi-card {
  display: grid;
  grid-template-rows: 36px auto 1fr;
  min-width: 0;
  min-height: 112px;
  padding: 14px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--navy);
  border-radius: 3px;
  background: #fff;
}

.kpi-card.accent { border-top-color: var(--coral); }
.kpi-card span { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.kpi-card b { overflow-wrap: anywhere; color: var(--navy); font-size: 21px; line-height: 1.15; }
.kpi-card small { align-self: end; margin-top: 6px; color: var(--muted); font-size: 10px; }

.panel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.panel { min-width: 0; padding: 17px; border: 1px solid var(--line); border-top: 3px solid var(--navy); border-radius: 3px; background: #fff; }
.panel h3 { margin: 0 0 9px; color: var(--navy); font-size: 14px; }
.panel p { color: var(--muted); font-size: 11px; line-height: 1.5; }

.table-wrap { max-width: 100%; overflow-x: auto; border: 1px solid var(--line); background: #fff; }
.data-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.data-table th { padding: 9px 10px; background: var(--navy); color: #fff; text-align: left; font-size: 10px; white-space: nowrap; }
.data-table td { padding: 9px 10px; border-top: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.data-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table tr:hover td { background: #f7f9fb; }

.badge { display: inline-flex; align-items: center; min-height: 22px; padding: 3px 7px; border-radius: 12px; background: #eaf5eb; color: var(--success); font-size: 9px; font-weight: 800; }
.badge.warn { background: #fff4df; color: var(--warn); }
.badge.muted { background: var(--soft); color: var(--muted); }

.domain-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 12px; }
.domain-card { min-width: 0; padding: 15px; border: 1px solid var(--line); border-top: 3px solid var(--navy); border-radius: 3px; background: #fff; }
.domain-card h3 { margin: 0; overflow-wrap: anywhere; color: var(--navy); font-size: 13px; }
.domain-card p { min-height: 34px; margin: 7px 0 11px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.domain-card input { width: 100%; margin-bottom: 8px; font-size: 10px; }
.domain-card button { width: 100%; }
.domain-meta { display: flex; justify-content: space-between; gap: 6px; margin-top: 9px; color: var(--muted); font-size: 9px; }
.template-link { display: block; margin: -2px 0 9px; color: var(--navy); font-size: 10px; font-weight: 700; text-decoration: none; }
.template-link:hover { text-decoration: underline; }

.run-note { padding: 12px 13px; margin: 10px 0 14px; border-left: 4px solid #8293aa; background: #edf2f7; color: #41576b; font-size: 11px; line-height: 1.45; }
.cost-scope { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 7px; }
.scope-item { padding: 9px; border-left: 3px solid var(--navy); background: var(--soft); color: var(--navy); font-size: 10px; }
.scope-item.off { color: var(--muted); text-decoration: line-through; }
.map-frame { width: 100%; height: 720px; border: 1px solid var(--line); background: #fff; }
.empty { padding: 34px; border: 1px dashed #adc0ce; background: #fff; color: var(--muted); font-size: 11px; }
.json-box { max-height: 280px; overflow: auto; padding: 12px; border-radius: 3px; background: #112d43; color: #dcecf4; font: 10px/1.45 Consolas, monospace; }

@media (max-width: 1050px) {
  :root { --sidebar: 72px; }
  .sidebar-project { display: none; }
  .sidebar nav .nav-item { justify-content: center; padding-inline: 8px; }
  .sidebar nav .nav-label { display: none; }
  .topbar .brand { flex-basis: 132px; width: 132px; padding: 8px 12px; }
  .topbar .brand img { width: 108px; }
  .top-title strong { font-size: 13px; }
  .hero { padding: 22px 24px; }
  #content { padding-inline: 24px; }
}

@media (max-width: 900px) {
  .sidebar { position: relative; inset: auto; width: 100%; max-height: 64px; overflow-x: auto; overflow-y: hidden; }
  .sidebar nav { display: flex; min-width: max-content; }
  .sidebar nav .nav-item { width: auto; min-width: 132px; min-height: 56px; justify-content: flex-start; padding: 8px 12px; border-left: 0; border-bottom: 4px solid transparent; }
  .sidebar nav .nav-label { display: block; white-space: nowrap; }
  .sidebar-foot { display: none; }
  .topbar,
  main { margin-left: 0; width: 100%; max-width: 100vw; }
  .topbar { flex-wrap: wrap; padding: 8px 10px; }
  .top-actions { max-width: 100%; }
  .hero { position: relative; top: auto; flex-direction: column; }
  .context-card { width: 100%; max-width: 360px; }
}

@media (max-width: 640px) {
  .top-title { display: none; }
  .user-pill { display: none; }
  #content { padding: 15px 14px 30px; }
  .hero { padding: 20px 14px; }
  .hero h1 { font-size: 25px; }
  .panel-grid { grid-template-columns: 1fr; }
  .filter-bar { align-items: stretch; flex-direction: column; }
  .filter-bar label,
  .filter-bar select,
  .primary-btn { width: 100%; }
  .map-frame { height: 560px; }
}

/* Referenzprojekt-Navigation follows the Process Studio information architecture. */
.sidebar-project { padding-top: 18px; }
.project-label { font-size: 10px; }
.project-select { min-height: 40px; font-size: 13px; }
.small-btn { min-height: 32px; font-size: 11px; }
.nav-group { padding: 0 0 8px; border-top: 1px solid #31507b; }
.nav-group:first-child { border-top: 0; }
.nav-group-title { padding: 13px 20px 7px; color: #aebdd0; font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.nav-item { min-height: 44px; padding: 9px 16px; font-size: 13px; }
.nav-icon { flex-basis: 30px; width: 30px; font-size: 12px; font-weight: 800; }
.sidebar-foot strong { font-size: 15px; }
.sidebar-foot small { font-size: 11px; }

.project-nav {
  display: flex;
  align-self: stretch;
  align-items: stretch;
  min-width: 0;
  flex: 1 1 auto;
  overflow-x: auto;
  scrollbar-width: thin;
}
.project-nav.hidden { display: none; }
.project-tab {
  flex: 0 0 auto;
  min-width: 92px;
  padding: 8px 13px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}
.project-tab:hover { background: #f3f6fa; }
.project-tab.active { border-bottom-color: var(--coral); background: #f5f7fa; color: var(--navy); }

.page-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.page-head h2 { margin: 0; color: var(--navy); font-size: 25px; line-height: 1.15; }
.page-head p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.page-head-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.global-page { min-width: 0; }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(420px, 100%), 1fr)); gap: 12px; }
.project-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; min-width: 0; padding: 17px 18px; border: 1px solid var(--line); border-left: 4px solid var(--navy); background: #fff; }
.project-card.reference { border-left-color: var(--coral); }
.project-card h3 { margin: 0; overflow-wrap: anywhere; color: var(--navy); font-size: 17px; }
.project-card p { margin: 6px 0 10px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.project-card-meta { display: flex; flex-wrap: wrap; gap: 7px; color: var(--muted); font-size: 11px; }
.project-card-actions { display: flex; align-items: center; gap: 7px; }
.project-card-actions .secondary-btn { min-width: 82px; }
.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(270px, 100%), 1fr)); gap: 12px; }
.template-card { min-width: 0; padding: 16px; border: 1px solid var(--line); border-top: 3px solid var(--navy); background: #fff; }
.template-card h3 { margin: 0 0 6px; color: var(--navy); font-size: 15px; }
.template-card p { min-height: 48px; margin: 0 0 13px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.template-card a { font-size: 12px; }
.form-card { max-width: 820px; padding: 20px; border: 1px solid var(--line); border-top: 3px solid var(--coral); background: #fff; }
.form-card h2 { margin: 0 0 6px; color: var(--navy); font-size: 19px; }
.form-card p { margin: 0 0 18px; color: var(--muted); font-size: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid textarea { display: block; width: 100%; min-height: 110px; margin-top: 5px; padding: 9px; border: 1px solid #b9c5d4; border-radius: 2px; resize: vertical; font-size: 12px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.reference-panel { max-width: 980px; }

@media (max-width: 1500px) {
  .top-title { max-width: 180px; }
  .project-tab { min-width: 80px; padding-inline: 9px; font-size: 10px; }
}

@media (max-width: 900px) {
  .project-nav { order: 3; flex-basis: 100%; min-height: 48px; }
  .topbar { align-items: center; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
}

@media (max-width: 640px) {
  .page-head { align-items: start; flex-direction: column; }
  .project-card { grid-template-columns: 1fr; }
  .project-card-actions { justify-content: flex-start; }
}
