:root {
  --bg: #e9eef4;
  --panel: #ffffff;
  --line: #d2dae4;
  --text: #11263f;
  --muted: #5c6f85;
  --brand: #0b5cab;
  --brand-dark: #083f74;
  --ok: #238b45;
  --warn: #cc7a00;
  --risk: #b8322a;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: linear-gradient(135deg, #dce5ef 0%, #eef3f8 60%, #e5edf6 100%);
  color: var(--text);
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px 1fr;
  grid-template-rows: 70px 1fr;
  grid-template-areas:
    "top top"
    "side main";
}

.topbar {
  grid-area: top;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 18px;
  background: linear-gradient(90deg, var(--brand-dark), var(--brand));
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}

.brand { display: flex; align-items: center; gap: 10px; }
.logo {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.2);
  display: grid;
  place-items: center;
  font-weight: 700;
}
.brand h1 { margin: 0; font-size: 1.1rem; }
.brand p { margin: 0; opacity: 0.8; font-size: 0.82rem; }

.top-actions { display: flex; gap: 10px; align-items: center; }
input, select, button {
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
}
#globalSearch { min-width: 280px; border: none; }

.btn {
  background: #fff;
  color: var(--brand-dark);
  cursor: pointer;
}
.btn.primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.sidebar {
  grid-area: side;
  padding: 14px;
  border-right: 1px solid var(--line);
  background: #f7f9fc;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-link {
  width: 100%;
  text-align: left;
  background: #fff;
}
.nav-link.active {
  background: #dcebfa;
  border-color: #9cc4ea;
  color: var(--brand-dark);
  font-weight: 600;
}

.content { grid-area: main; padding: 16px; overflow: auto; }
.view { display: none; }
.view.active { display: block; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 14px;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.inline-actions { display: flex; gap: 8px; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
}
.card .label { color: var(--muted); font-size: 0.8rem; }
.card .value { font-size: 1.35rem; font-weight: 700; margin-top: 6px; }

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}
th, td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 9px;
  font-size: 0.92rem;
}
th { color: var(--muted); font-weight: 600; }

.status {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}
.status.Planung { background: #eceff5; }
.status.Aktiv { background: #d9f1e1; color: var(--ok); }
.status.Risiko { background: #fbe4d0; color: var(--warn); }
.status.Abgeschlossen { background: #f2f4f7; color: #45566d; }

.split {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 14px;
}
form { display: grid; gap: 10px; }
label { display: grid; gap: 6px; }

.bars { display: grid; gap: 8px; }
.bar-row {
  display: grid;
  grid-template-columns: 170px 1fr 70px;
  align-items: center;
  gap: 8px;
}
.track {
  background: #edf2f8;
  border-radius: 999px;
  height: 14px;
  overflow: hidden;
}
.fill {
  height: 14px;
  background: linear-gradient(90deg, var(--brand), #3b92df);
}

.settings { max-width: 500px; }
.toggle {
  display: flex;
  align-items: center;
  gap: 8px;
}
.compact th, .compact td { padding: 5px 7px; font-size: 0.84rem; }

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr;
    grid-template-areas:
      "top"
      "side"
      "main";
  }
  .sidebar { flex-direction: row; overflow: auto; }
  .split { grid-template-columns: 1fr; }
  #globalSearch { min-width: 140px; }
}
