@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@600;700&family=IBM+Plex+Sans:wght@400;500;600&display=swap');

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: #0b0e1a;
  color: #f3f2fa;
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
}

a { color: #a855f7; text-decoration: none; }
a:hover { color: #c084fc; }

.bg-texture {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: radial-gradient(rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 28px 28px;
}

button { font-family: inherit; }

/* ---- Login ---- */
.login-wrap {
  position: relative; min-height: 100vh; display: flex; align-items: center; justify-content: center; z-index: 1;
}
.login-card { width: 420px; display: flex; flex-direction: column; align-items: center; padding: 24px; }
.badge {
  width: 92px; height: 92px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.09); margin-bottom: 22px;
  box-shadow: 0 0 0 1px #a855f740, 0 0 60px -12px #a855f799;
}
.badge svg { width: 44px; height: 44px; color: #e9eaf6; }
.wordmark { font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 32px; letter-spacing: .06em; text-transform: uppercase; text-align: center; }
.wordmark .accent { color: #a855f7; }
.subtitle { margin-top: 8px; font-size: 13px; color: #9498b3; letter-spacing: .03em; margin-bottom: 30px; text-align: center; }

.field { width: 100%; margin-bottom: 16px; }
.field label { display: block; font-size: 12px; color: #9498b3; margin-bottom: 7px; letter-spacing: .02em; }
.field input {
  width: 100%; height: 46px; padding: 0 14px; border-radius: 7px;
  background: rgba(255,255,255,0.035); border: 1px solid rgba(255,255,255,0.14);
  color: #f3f2fa; font-size: 14px; font-family: inherit;
}
.field input::placeholder { color: #565a78; }
.field input:focus { outline: none; border-color: #a855f7; }

.btn-primary {
  width: 100%; height: 48px; border-radius: 7px; border: none; margin-top: 6px;
  font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 16px; letter-spacing: .04em; text-transform: uppercase;
  cursor: pointer; color: #0b0e1a; background: #a855f7;
}
.btn-primary:disabled { opacity: .6; cursor: default; }
.btn-primary:hover:not(:disabled) { background: #c084fc; }

.form-error {
  width: 100%; margin-top: 14px; padding: 10px 12px; border-radius: 7px;
  background: #ef44441a; border: 1px solid #ef444455; color: #f87171; font-size: 13px; display: none;
}
.form-error.show { display: block; }

.footnote { margin-top: 26px; font-size: 11.5px; color: #565a78; text-align: center; line-height: 1.6; }

/* ---- App shell (Dashboard / Unterseiten) ---- */
.app { position: relative; min-height: 100vh; z-index: 1; padding-bottom: 56px; }
.topbar {
  display: flex; align-items: center; gap: 16px; padding: 0 40px; height: 76px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.topbar .back { width: 34px; height: 34px; border-radius: 6px; background: rgba(255,255,255,0.05); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.topbar .back svg { width: 16px; height: 16px; color: #c7cae0; }
.title-block h1 { margin: 0; font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 21px; letter-spacing: .03em; }
.title-block .sub { font-size: 12px; color: #9498b3; margin-top: 2px; }

.dept-chip {
  display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: 6px;
  font-family: 'Rajdhani', sans-serif; font-weight: 600; font-size: 13.5px; letter-spacing: .04em; white-space: nowrap;
}
.dept-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.top-status { margin-left: auto; display: flex; align-items: center; gap: 18px; color: #9498b3; font-size: 13px; }
.top-status .u { display: flex; align-items: center; gap: 9px; }
.logout-btn { border: none; background: rgba(255,255,255,0.05); color: #c7cae0; height: 34px; padding: 0 14px; border-radius: 6px; font-size: 13px; cursor: pointer; }
.logout-btn:hover { background: rgba(255,255,255,0.09); }

.content { padding: 44px; }

.module-grid { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 108px; gap: 16px; max-width: 1100px; }
.tile {
  display: flex; flex-direction: column; justify-content: center; gap: 10px; padding: 16px 18px;
  border-radius: 8px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07);
  text-decoration: none; color: inherit; cursor: pointer; transition: border-color .15s, background .15s;
}
.tile:hover { background: rgba(255,255,255,0.055); border-color: rgba(255,255,255,0.14); }
.tile.disabled { opacity: .4; cursor: default; }
.tile.disabled:hover { background: rgba(255,255,255,0.03); border-color: rgba(255,255,255,0.07); }
.tile svg { width: 22px; height: 22px; color: #c7cae0; }
.tile span { font-family: 'Rajdhani', sans-serif; font-weight: 600; font-size: 14.5px; letter-spacing: .02em; color: #e3e5f2; }
.tile .soon { font-size: 10.5px; color: #565a78; font-family: 'IBM Plex Sans'; letter-spacing: 0; text-transform: none; }

/* ---- Personenabfrage / Tabellen / Formulare ---- */
.search-bar { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 14px; margin-bottom: 26px; align-items: end; max-width: 980px; }
.search-bar .field { margin-bottom: 0; }
.btn-search {
  height: 46px; padding: 0 26px; border-radius: 7px; border: none; background: #3b82f6; color: #071022;
  font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 14.5px; letter-spacing: .04em; text-transform: uppercase;
  display: flex; align-items: center; gap: 9px; cursor: pointer;
}
.btn-search:hover { background: #60a5fa; }
.btn-search svg { width: 16px; height: 16px; }

.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; max-width: 980px; }
.panel-head h2 { margin: 0; font-family: 'Rajdhani', sans-serif; font-weight: 600; font-size: 15px; letter-spacing: .03em; color: #d9dbec; }
.panel-head .tag { font-size: 11.5px; color: #565a78; }
.btn-ghost {
  border: 1px solid rgba(255,255,255,0.14); background: none; color: #c7cae0; height: 34px; padding: 0 14px;
  border-radius: 6px; font-size: 12.5px; cursor: pointer; font-family: 'Rajdhani', sans-serif; font-weight: 600; letter-spacing: .03em;
}
.btn-ghost:hover { border-color: #a855f7; color: #a855f7; }

table { width: 100%; border-collapse: collapse; max-width: 980px; }
thead th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: #7d81a0; font-weight: 600; padding: 0 16px 12px; border-bottom: 1px solid rgba(255,255,255,0.08); }
tbody td { padding: 14px 16px; font-size: 13.5px; border-bottom: 1px solid rgba(255,255,255,0.05); vertical-align: middle; }
tbody tr { cursor: pointer; }
tbody tr:hover td { background: rgba(255,255,255,0.025); }
tbody tr td:first-child, thead th:first-child { padding-left: 16px; }
.name { font-weight: 600; color: #f3f2fa; }
.muted { color: #9498b3; }
.empty-row td { color: #565a78; text-align: center; padding: 30px 16px; }

.status { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; padding: 5px 11px; border-radius: 20px; font-weight: 500; }
.status.clean { background: #22c55e1f; color: #4ade80; }
.status.flag { background: #ef44441f; color: #f87171; }
.status .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55); display: none; align-items: center; justify-content: center; z-index: 10;
}
.modal-backdrop.show { display: flex; }
.modal { width: 480px; max-height: 84vh; overflow-y: auto; background: #12162a; border: 1px solid rgba(255,255,255,0.1); border-radius: 10px; padding: 26px; }
.modal h3 { margin: 0 0 18px; font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 18px; letter-spacing: .03em; }
.modal .close { float: right; cursor: pointer; color: #9498b3; font-size: 20px; line-height: 1; }
.modal-actions { display: flex; gap: 10px; margin-top: 6px; }
.modal-actions .btn-primary { margin-top: 0; }

.note-item { padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.note-item:last-child { border-bottom: none; }
.note-item .meta { font-size: 11px; color: #565a78; margin-bottom: 4px; }
.note-item.vermerk { color: #f87171; }
.note-item .text { font-size: 13.5px; }

.role-badge { font-size: 10.5px; padding: 2px 8px; border-radius: 20px; background: rgba(255,255,255,0.08); color: #c7cae0; letter-spacing: .03em; }
.role-badge.admin { background: #a855f722; color: #c084fc; }

@media (max-width: 900px) {
  .module-grid { grid-template-columns: repeat(2, 1fr); }
  .search-bar { grid-template-columns: 1fr; }
  .content { padding: 24px; }
  .topbar { padding: 0 20px; }
}
