:root {
  --bg: #f3f4f6;
  --bg-panel: #ffffff;
  --bg-panel-soft: #f9fafb;
  --border: #e5e7eb;
  --shadow: 0 10px 25px rgba(15, 23, 42, 0.06);
  --text: #111827;
  --text-muted: #4b5563;
  --accent: #2563eb;
  --accent-soft: #eff6ff;
}
html[data-theme="dark"] {
  --bg: #020617;
  --bg-panel: #020617;
  --bg-panel-soft: #0f172a;
  --border: #1f2937;
  --shadow: 0 14px 30px rgba(0, 0, 0, 0.7);
  --text: #e5e7eb;
  --text-muted: #9ca3af;
  --accent: #60a5fa;
  --accent-soft: #1e293b;
}
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.app-header {
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo {
  font-weight: 700;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.header-right {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.icon-btn {
  border: none;
  background: transparent;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--text-muted);
}
.app-main {
  flex: 1;
  padding: 1.5rem;
}
.content {
  max-width: 1200px;
  margin: 0 auto;
}
.layout {
  display: grid;
  grid-template-columns: 2fr 2fr;
  gap: 1.5rem;
  margin-top: 1.25rem;
}
.panel {
  background: var(--bg-panel);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.right-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
h1, h2, h3 { margin-top: 0; }
.projekt-tabelle {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.projekt-tabelle th,
.projekt-tabelle td {
  border-bottom: 1px solid var(--border);
  padding: 0.4rem 0.35rem;
}
.projekt-tabelle th {
  text-align: left;
  background: var(--bg-panel-soft);
}
.projekt-tabelle tr:hover td {
  background: var(--accent-soft);
}
.form-field {
  display: flex;
  flex-direction: column;
  margin-bottom: 0.75rem;
}
.form-field label {
  font-size: 0.85rem;
  margin-bottom: 0.15rem;
  color: var(--text-muted);
}
input,
textarea,
select {
  font: inherit;
  padding: 0.35rem 0.45rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text);
}
textarea {
  min-height: 70px;
  resize: vertical;
}
button {
  border: none;
  background: var(--accent);
  color: #ffffff;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.85rem;
}
button.secondary {
  background: var(--border);
  color: var(--text);
}
button.small {
  padding: 0.25rem 0.6rem;
  font-size: 0.8rem;
}

button.danger {
  background: #dc2626;
}

html[data-theme="dark"] button.danger {
  background: #ef4444;
}

.panel-actions {
  display: flex;
  justify-content: flex-end;
}

/* ------------------------------------------------------------
   Modal (Neues Projekt)
------------------------------------------------------------ */
.modal-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  z-index: 9999;
  padding: 1rem;
}

.modal-overlay.is-open {
  display: flex;
}

.modal {
  width: min(720px, 96vw);
  max-height: 88vh;
  overflow: auto;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  box-shadow: var(--shadow);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
}

.modal-body {
  padding: 1rem;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding-top: 0.75rem;
}
#active-project-info {
  font-size: 0.9rem;
  line-height: 1.4;
}
#active-project-info .label {
  font-weight: 600;
}
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.9rem;
  margin-top: 0.75rem;
}
.module-card {
  display: block;
  text-decoration: none;
  background: var(--bg-panel-soft);
  border-radius: 0.75rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  color: inherit;
  transition:
    transform 0.1s ease,
    box-shadow 0.1s ease,
    border-color 0.1s ease,
    background-color 0.1s ease;
}
.module-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 25px rgba(15, 23, 42, 0.2);
  border-color: var(--accent-soft);
  background: var(--accent-soft);
}
.module-icon {
  font-size: 1.4rem;
  margin-bottom: 0.15rem;
}
.module-title {
  font-weight: 600;
  margin-bottom: 0.1rem;
}
.module-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.module-tag {
  margin-top: 0.4rem;
  font-size: 0.75rem;
  color: var(--accent);
}
.module-card.disabled {
  opacity: 0.6;
  cursor: default;
  box-shadow: none;
}
.module-card.disabled:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--border);
  background: var(--bg-panel-soft);
}
@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }
}
