/* ════════════════════════════════════════════════════════════════════════
   ENTGELTABRECHNUNG – ÜBUNGSTOOL
   Zentrales Stylesheet (Design-Tokens, Layout, Formulare, Komponenten)
   ════════════════════════════════════════════════════════════════════════ */

/* ── Design-Tokens ──────────────────────────────────────────────────────── */
:root {
  --nav-bg:      #1a2e4a;
  --nav-active:  #2d7dd2;
  --accent:      #2d7dd2;
  --accent-dark: #1a5ca8;
  --border:      #d0d7e2;
  --bg:          #f4f6f9;
  --card:        #ffffff;
  --text:        #1a1a2e;
  --muted:       #64748b;
  --danger:      #c0392b;
  --success:     #27ae60;
  --on-dark:     #f4f6f9;       /* Textfarbe auf dunklem Hintergrund */
  --label-fs:    11.5px;
  --input-h:     30px;
  --radius:      5px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ════════════════════════════════════════════════════════════════════════
   TOPBAR / NAVIGATION
   ════════════════════════════════════════════════════════════════════════ */
.topbar {
  background: var(--nav-bg);
  color: var(--on-dark);
  display: flex;
  align-items: center;
  padding: 0 16px;
  height: 46px;
  gap: 4px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
}
.topbar .brand {
  font-size: 15px;
  font-weight: bold;
  letter-spacing: .4px;
  color: var(--on-dark);
  margin-right: 20px;
  white-space: nowrap;
}
.topbar .brand span { color: var(--nav-active); }

.nav-btn {
  background: none;
  border: none;
  color: rgba(244,246,249,.7);
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 12.5px;
  transition: background .15s, color .15s;
}
.nav-btn:hover { background: rgba(244,246,249,.12); color: var(--on-dark); }
.nav-btn.active { background: var(--nav-active); color: #fff; }
.nav-btn:disabled { cursor: not-allowed; opacity: .4; }

.topbar-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* Buttons auf dunklem Topbar-Hintergrund: heller Rahmen + heller Text */
.btn-ghost-dark {
  background: none;
  border: 1px solid rgba(244,246,249,.4);
  color: var(--on-dark);
  padding: 5px 12px;
  border-radius: var(--radius);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.btn-ghost-dark:hover {
  background: rgba(244,246,249,.12);
  border-color: rgba(244,246,249,.7);
}

/* ════════════════════════════════════════════════════════════════════════
   GRUNDLAYOUT (Sidebar + Hauptbereich)
   ════════════════════════════════════════════════════════════════════════ */
.shell { display: flex; min-height: calc(100vh - 46px); }

.sidebar {
  width: 220px;
  background: var(--card);
  border-right: 1px solid var(--border);
  padding: 12px 0;
  flex-shrink: 0;
}
.sidebar-title {
  font-size: 10px;
  font-weight: bold;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .8px;
  padding: 0 14px 6px;
}

.main { flex: 1; padding: 20px 24px; overflow-y: auto; }

/* ════════════════════════════════════════════════════════════════════════
   MITARBEITER-LISTE (Sidebar)
   ════════════════════════════════════════════════════════════════════════ */
.ma-item {
  display: flex;
  align-items: center;
  padding: 7px 14px;
  cursor: pointer;
  gap: 8px;
  transition: background .12s;
  border-left: 3px solid transparent;
}
.ma-item:hover { background: #f0f4fa; }
.ma-item.active { background: #e8f0fb; border-left-color: var(--accent); }

.ma-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--nav-bg);
  color: var(--on-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: bold;
  flex-shrink: 0;
}
.ma-info { flex: 1; min-width: 0; }
.ma-name {
  font-size: 12.5px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ma-persnr { font-size: 10.5px; color: var(--muted); }

.btn-add-ma {
  margin: 10px 14px 0;
  width: calc(100% - 28px);
  padding: 7px;
  border: 1px dashed var(--border);
  background: none;
  color: var(--accent);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 12px;
  transition: background .12s;
}
.btn-add-ma:hover { background: #f0f4fa; }

/* ════════════════════════════════════════════════════════════════════════
   SEITENKOPF
   ════════════════════════════════════════════════════════════════════════ */
.page-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-head h2 { font-size: 16px; font-weight: bold; }
.page-head .sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* ════════════════════════════════════════════════════════════════════════
   KARTEN
   ════════════════════════════════════════════════════════════════════════ */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 14px;
}
.card-head {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: bold;
  color: var(--nav-bg);
  background: #f7f9fc;
  border-radius: var(--radius) var(--radius) 0 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.card-body { padding: 14px; }

/* ════════════════════════════════════════════════════════════════════════
   FORMULAR-GRID
   ════════════════════════════════════════════════════════════════════════ */
.fg { display: grid; gap: 10px 16px; }
.fg-2 { grid-template-columns: repeat(2, 1fr); }
.fg-3 { grid-template-columns: repeat(3, 1fr); }
.fg-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 760px) { .fg-2, .fg-3, .fg-4 { grid-template-columns: 1fr; } }

.f { display: flex; flex-direction: column; gap: 3px; }
.f label { font-size: var(--label-fs); color: var(--muted); font-weight: 600; }
.f input, .f select {
  height: var(--input-h);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 8px;
  font-size: 12.5px;
  background: #fff;
  color: var(--text);
  transition: border-color .15s;
}
.f input:focus, .f select:focus { outline: none; border-color: var(--accent); }
.f input[readonly] { background: #f7f9fc; color: var(--muted); }
.f .hint { font-size: 10.5px; color: var(--muted); }
.f.checkbox-row { flex-direction: row; align-items: center; padding-top: 18px; }
.f.checkbox-row label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12.5px; color: var(--text); font-weight: 400; }
.f.checkbox-row input[type="checkbox"] { width: 15px; height: 15px; }

.divider { height: 1px; background: var(--border); margin: 10px 0; }

/* ════════════════════════════════════════════════════════════════════════
   BUTTONS (im Inhaltsbereich, hellem Hintergrund)
   ════════════════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 16px;
  border: none; border-radius: var(--radius);
  cursor: pointer; font-size: 12.5px; font-weight: 600;
  transition: background .15s, color .15s, border-color .15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #a93226; }
.btn-danger-outline {
  background: none; border: 1px solid var(--danger); color: var(--danger);
}
.btn-danger-outline:hover { background: #fbeceb; }
.btn-ghost {
  background: none; border: 1px solid var(--border); color: var(--text);
}
.btn-ghost:hover { background: #f0f4fa; }

/* ════════════════════════════════════════════════════════════════════════
   STEP-BADGE
   ════════════════════════════════════════════════════════════════════════ */
.step-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 11px; font-weight: bold;
  flex-shrink: 0;
}

/* ════════════════════════════════════════════════════════════════════════
   LEER-ZUSTAND
   ════════════════════════════════════════════════════════════════════════ */
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty h3 { font-size: 15px; margin-bottom: 8px; color: var(--text); }
.empty p { font-size: 12.5px; margin-bottom: 16px; }

/* ════════════════════════════════════════════════════════════════════════
   TOAST
   ════════════════════════════════════════════════════════════════════════ */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--success); color: #fff;
  padding: 10px 18px; border-radius: var(--radius);
  font-size: 13px; font-weight: 600;
  opacity: 0; pointer-events: none;
  transition: opacity .25s;
  z-index: 999;
}
.toast.show { opacity: 1; }

/* ════════════════════════════════════════════════════════════════════════
   PLATZHALTER-SEITEN (für noch nicht gebaute Schritte)
   ════════════════════════════════════════════════════════════════════════ */
.placeholder-page {
  text-align: center; padding: 80px 20px; color: var(--muted);
}
.placeholder-page h3 { font-size: 16px; margin-bottom: 8px; color: var(--text); }
