:root {
  --bg: #030b16;
  --bg-2: #061426;
  --surface: rgba(9, 24, 44, .88);
  --surface-solid: #09182c;
  --surface-2: #0d213d;
  --surface-3: #102b50;
  --border: rgba(61, 107, 160, .38);
  --border-soft: rgba(61, 107, 160, .22);
  --text: #f5f9ff;
  --muted: #9db8d8;
  --soft-text: #c7d7ec;
  --accent: #2f80ed;
  --accent-2: #60a5fa;
  --accent-soft: rgba(47, 128, 237, .18);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, .16);
  --success: #22c55e;
  --success-soft: rgba(34, 197, 94, .16);
  --warning: #f59e0b;
  --warning-soft: rgba(245, 158, 11, .16);
  --shadow: 0 24px 70px rgba(0, 0, 0, .38);
  --shadow-soft: 0 10px 28px rgba(0, 0, 0, .22);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    linear-gradient(rgba(96, 165, 250, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(96, 165, 250, .035) 1px, transparent 1px),
    radial-gradient(circle at 85% 5%, rgba(47, 128, 237, .22), transparent 30rem),
    radial-gradient(circle at 14% 10%, rgba(14, 165, 233, .10), transparent 28rem),
    linear-gradient(135deg, #020814 0%, #061426 46%, #081b33 100%);
  background-size: 64px 64px, 64px 64px, auto, auto, auto;
}

body::before {
  content: "LSPD";
  position: fixed;
  right: 7vw;
  top: 3vh;
  z-index: -1;
  color: rgba(255, 255, 255, .035);
  font-size: min(13vw, 180px);
  font-weight: 950;
  letter-spacing: .04em;
  pointer-events: none;
}

button, input, select, textarea { font: inherit; }
button { border: 0; cursor: pointer; }
.hidden { display: none !important; }
.mt { margin-top: 1rem; }

#toast {
  position: fixed;
  right: 1rem;
  top: 1rem;
  z-index: 99;
  display: grid;
  gap: .5rem;
}

.toast {
  min-width: 280px;
  padding: .85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(9, 24, 44, .96);
  box-shadow: var(--shadow);
  color: var(--soft-text);
}

.toast.error {
  border-color: rgba(239, 68, 68, .65);
  background: rgba(69, 10, 10, .92);
}

.toast.ok {
  border-color: rgba(34, 197, 94, .55);
  background: rgba(5, 46, 22, .92);
}

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.login-card {
  width: min(520px, 100%);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border: 1px solid var(--border);
  border-radius: 30px;
  background: rgba(9, 24, 44, .82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.mark {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  color: white;
  font-weight: 950;
  letter-spacing: .08em;
  border-radius: 21px;
  background: linear-gradient(135deg, #2f80ed, #1d4ed8);
  box-shadow: 0 18px 35px rgba(47, 128, 237, .28);
}

.mark.small {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  font-size: .7rem;
}

.eyebrow {
  margin: 1rem 0 .3rem;
  color: #7db7ff;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}

h1, h2, h3, h4, p { margin-top: 0; }

h1 {
  margin-bottom: .7rem;
  font-size: clamp(2.15rem, 6vw, 4rem);
  line-height: .98;
  letter-spacing: -.06em;
}

h2 {
  margin-bottom: .25rem;
  font-size: clamp(1.75rem, 4vw, 2.45rem);
  letter-spacing: -.045em;
  text-shadow: 0 2px 20px rgba(47, 128, 237, .18);
}

h3 {
  margin-bottom: .45rem;
  font-size: 1.15rem;
  letter-spacing: -.02em;
}

h4 {
  margin-bottom: .25rem;
  letter-spacing: -.015em;
}

.muted {
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 0;
}

.form, .modal-form {
  display: grid;
  gap: .9rem;
}

.form { margin-top: 1.5rem; }

label {
  display: grid;
  gap: .45rem;
  color: var(--soft-text);
  font-size: .9rem;
  font-weight: 650;
}

input, select, textarea {
  width: 100%;
  color: var(--text);
  background: rgba(3, 11, 22, .72);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: .85rem 1rem;
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .015);
}

textarea {
  min-height: 112px;
  resize: vertical;
  line-height: 1.55;
}

input::placeholder, textarea::placeholder { color: #7894b7; }

input:focus, select:focus, textarea:focus {
  border-color: rgba(96, 165, 250, .95);
  box-shadow: 0 0 0 4px rgba(47, 128, 237, .16);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  color: var(--text);
  border-radius: 13px;
  padding: .76rem 1rem;
  font-weight: 850;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease;
}

.btn:hover { transform: translateY(-1px); }

.btn.primary {
  color: white;
  background: linear-gradient(135deg, #2f80ed, #1d4ed8);
  box-shadow: 0 12px 24px rgba(47, 128, 237, .22);
}

.btn.ghost {
  color: var(--soft-text);
  background: rgba(255,255,255,.035);
  border: 1px solid var(--border);
}

.btn.ghost:hover {
  border-color: rgba(96, 165, 250, .6);
  background: rgba(47, 128, 237, .10);
}

.demo {
  display: grid;
  gap: .25rem;
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid rgba(96, 165, 250, .35);
  border-radius: 18px;
  background: rgba(47, 128, 237, .10);
  color: var(--soft-text);
}

code {
  color: #93c5fd;
  font-weight: 850;
}

.app {
  display: grid;
  grid-template-columns: 292px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 1.15rem;
  border-right: 1px solid var(--border-soft);
  background: rgba(3, 11, 22, .74);
  backdrop-filter: blur(24px);
  display: flex;
  flex-direction: column;
  gap: .95rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .25rem .25rem 1rem;
  border-bottom: 1px solid var(--border-soft);
}

.brand strong {
  display: block;
  letter-spacing: -.02em;
  font-size: 1.18rem;
}

.brand span {
  display: block;
  color: #8fc1ff;
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.nav-group {
  display: grid;
  gap: .45rem;
}

.nav-group > span {
  color: #76a9e8;
  font-size: .68rem;
  font-weight: 950;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: .2rem .75rem;
  opacity: .9;
}

.nav {
  width: 100%;
  text-align: left;
  color: var(--soft-text);
  background: rgba(9, 24, 44, .52);
  border: 1px solid transparent;
  border-radius: 15px;
  padding: .86rem .95rem;
  font-weight: 760;
}

.nav:hover, .nav.active {
  color: white;
  border-color: rgba(47, 128, 237, .45);
  background: linear-gradient(135deg, rgba(47, 128, 237, .24), rgba(47, 128, 237, .08));
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, .08);
}

.logout {
  margin-top: auto;
  color: #fecaca;
  background: rgba(239, 68, 68, .10);
  border: 1px solid rgba(239, 68, 68, .36);
}

.main {
  min-width: 0;
  padding: clamp(1rem, 2vw, 1.7rem);
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .65rem;
  flex-wrap: wrap;
}

.status-pill, .profile-pill {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .62rem .78rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(9, 24, 44, .72);
  box-shadow: var(--shadow-soft);
}

.status-pill strong {
  font-size: .9rem;
  white-space: nowrap;
}

.status-pill small { color: var(--muted); }

.status-pill.online span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, .13);
}

.status-pill.clock span { color: #93c5fd; }

.profile-pill { min-width: 190px; }

.profile-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(135deg, #2f80ed, #1d4ed8);
  box-shadow: 0 10px 20px rgba(47, 128, 237, .22);
}

.profile-pill span {
  display: block;
  color: var(--muted);
  font-size: .84rem;
  margin-top: .1rem;
}

.page { display: none; }
.page.active { display: block; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .95rem;
  margin-bottom: .95rem;
}

.stats article, .panel, .card {
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.stats article {
  position: relative;
  overflow: hidden;
  padding: 1.05rem 1.15rem;
  min-height: 118px;
}

.stats article::after {
  content: "";
  position: absolute;
  right: -26px;
  top: -26px;
  width: 96px;
  height: 96px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(47, 128, 237, .22), rgba(14, 165, 233, .08));
}

.stats span {
  display: block;
  color: var(--muted);
  font-weight: 720;
}

.stats strong {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: .38rem;
  font-size: 2.35rem;
  letter-spacing: -.06em;
}

.stats article small {
  color: var(--muted);
  display: block;
  margin-top: .25rem;
  position: relative;
  z-index: 2;
}

.grid {
  display: grid;
  gap: .95rem;
}

.grid.two { grid-template-columns: 1fr 1fr; }
.grid.personnel { grid-template-columns: 340px 1fr; align-items: start; }
.grid.chat-grid { grid-template-columns: 310px 1fr; align-items: start; }

.panel { padding: 1.15rem; }

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.command-panel { margin-bottom: .95rem; }

.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .85rem;
}

.quick-card {
  text-align: left;
  color: var(--text);
  padding: 1rem;
  min-height: 116px;
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(47, 128, 237, .24), transparent 7rem),
    rgba(6, 20, 38, .72);
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.quick-card:hover {
  transform: translateY(-2px);
  border-color: rgba(96, 165, 250, .68);
}

.quick-card strong {
  display: block;
  font-size: 1rem;
  margin-bottom: .4rem;
}

.quick-card span {
  color: var(--muted);
  line-height: 1.45;
}

.page-tools { margin-bottom: .95rem; }

.mini-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .85rem;
}

.mini-stats article {
  padding: .95rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(9, 24, 44, .84);
  box-shadow: var(--shadow-soft);
}

.mini-stats span {
  color: var(--muted);
  font-size: .82rem;
}

.mini-stats strong {
  display: block;
  margin-top: .25rem;
  font-size: 1.8rem;
  letter-spacing: -.04em;
}

.search { margin-bottom: 1rem; }

.filter-bar {
  display: grid;
  grid-template-columns: 1.5fr .8fr .8fr auto;
  gap: .7rem;
  align-items: center;
  margin-bottom: 1rem;
}

.filter-bar .search { margin-bottom: 0; }

.list, .cards-list, .calendar-list {
  display: grid;
  gap: .78rem;
}

.cards-list {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.item, .select-item, .calendar-item, .card {
  padding: .9rem;
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  background: rgba(6, 20, 38, .70);
}

.select-item {
  width: 100%;
  color: var(--text);
  text-align: left;
  transition: border-color .16s ease, background .16s ease, transform .16s ease, box-shadow .16s ease;
}

.select-item:hover {
  transform: translateY(-1px);
  border-color: rgba(96, 165, 250, .55);
  background: rgba(47, 128, 237, .12);
}

.select-item.active {
  border-color: rgba(96, 165, 250, .86);
  background: rgba(47, 128, 237, .18);
  box-shadow: 0 12px 28px rgba(47, 128, 237, .10);
}

.item p, .card p, .select-item p {
  color: var(--muted);
  margin: .25rem 0 0;
  line-height: 1.45;
}

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  min-width: 1080px;
  border-collapse: separate;
  border-spacing: 0 .45rem;
}

th, td {
  text-align: left;
  padding: .82rem;
  vertical-align: middle;
}

th {
  color: #9cc6f6;
  font-size: .74rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

td {
  background: rgba(6, 20, 38, .76);
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
}

td:first-child {
  border-left: 1px solid var(--border-soft);
  border-top-left-radius: 14px;
  border-bottom-left-radius: 14px;
}

td:last-child {
  border-right: 1px solid var(--border-soft);
  border-top-right-radius: 14px;
  border-bottom-right-radius: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: .32rem .7rem;
  font-size: .8rem;
  font-weight: 850;
  color: #cbd5e1;
  background: rgba(148, 163, 184, .13);
}

.badge.green {
  color: #86efac;
  background: var(--success-soft);
  border: 1px solid rgba(34, 197, 94, .24);
}

.badge.yellow {
  color: #fde68a;
  background: var(--warning-soft);
  border: 1px solid rgba(245, 158, 11, .24);
}

.badge.red {
  color: #fca5a5;
  background: var(--danger-soft);
  border: 1px solid rgba(239, 68, 68, .24);
}

.badge.blue {
  color: #bfdbfe;
  background: var(--accent-soft);
  border: 1px solid rgba(96, 165, 250, .25);
}

.actions {
  display: flex;
  gap: .45rem;
  flex-wrap: wrap;
}

.link-btn, .delete-btn {
  padding: .45rem .65rem;
  border-radius: 10px;
  font-size: .85rem;
  font-weight: 850;
  color: #bfdbfe;
  background: rgba(47, 128, 237, .16);
  border: 1px solid rgba(96, 165, 250, .20);
}

.delete-btn {
  color: #fecaca;
  background: rgba(239, 68, 68, .16);
  border-color: rgba(239, 68, 68, .24);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .7rem;
  margin-bottom: 1rem;
}

.info-grid div {
  padding: .85rem;
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  background: rgba(13, 33, 61, .76);
}

.info-grid span, .unit-meta span {
  display: block;
  color: #9cc6f6;
  font-size: .72rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: .25rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-bottom: 1rem;
}

.chip {
  color: var(--soft-text);
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(6, 20, 38, .70);
  padding: .5rem .85rem;
  font-weight: 780;
}

.chip:hover, .chip.active {
  color: white;
  border-color: rgba(96, 165, 250, .7);
  background: rgba(47, 128, 237, .18);
}

.calendar-item {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: .9rem;
  align-items: center;
}

.datebox {
  text-align: center;
  padding: .6rem;
  border: 1px solid rgba(96, 165, 250, .35);
  border-radius: 15px;
  background: rgba(47, 128, 237, .16);
}

.datebox strong {
  display: block;
  color: #bfdbfe;
  font-size: 1.4rem;
}

.datebox span {
  color: var(--muted);
  font-size: .75rem;
  font-weight: 780;
}

.sticky-panel {
  position: sticky;
  top: 1rem;
}

.file-grid {
  display: grid;
  gap: .85rem;
}

.file-grid textarea { min-height: 128px; }

.unit-card {
  display: grid;
  gap: .9rem;
}

.unit-card-head {
  display: flex;
  justify-content: space-between;
  gap: .8rem;
  align-items: flex-start;
}

.unit-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .65rem;
}

.unit-meta div {
  padding: .75rem;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: rgba(3, 11, 22, .32);
}

.chat-help { margin-bottom: .8rem; }

.chat-panel {
  height: min(74vh, 820px);
  display: flex;
  flex-direction: column;
}

.messages {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .65rem;
  overflow-y: auto;
  padding: .7rem;
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  background: rgba(3, 11, 22, .46);
}

.message {
  width: fit-content;
  max-width: min(700px, 86%);
  padding: .75rem .85rem;
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  background: rgba(13, 33, 61, .78);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
}

.message.me {
  align-self: flex-end;
  color: white;
  background: linear-gradient(135deg, #2f80ed, #1d4ed8);
  border-color: transparent;
}

.message.me small { color: rgba(255, 255, 255, .75); }

.message p {
  margin: .25rem 0;
  line-height: 1.45;
}

.message small { color: var(--muted); }

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .7rem;
  margin-top: .7rem;
}

dialog {
  width: min(720px, calc(100% - 2rem));
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface-solid);
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(0, 0, 0, .68);
  backdrop-filter: blur(7px);
}

.modal-form { padding: .8rem; }
.modal-form h3 { margin-bottom: .5rem; }

.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: .65rem;
  margin-top: .5rem;
}

@media (max-width: 1300px) {
  .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-bar { grid-template-columns: 1fr 1fr; }
  .filter-bar .search { grid-column: 1 / -1; }
}

@media (max-width: 1250px) {
  .topbar { flex-direction: column; }
  .top-actions { justify-content: flex-start; }
}

@media (max-width: 1180px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .grid.two, .grid.personnel, .grid.chat-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .info-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .quick-grid, .mini-stats, .unit-meta, .modal-grid, .filter-bar {
    grid-template-columns: 1fr;
  }
  .sticky-panel { position: static; }
}

@media (max-width: 680px) {
  .topbar, .panel-head { flex-direction: column; }
  .top-actions, .status-pill, .profile-pill { width: 100%; }
  .stats, .info-grid { grid-template-columns: 1fr; }
  .calendar-item { grid-template-columns: 1fr; }
  .chat-form { grid-template-columns: 1fr; }
  .main { padding: .85rem; }
  .panel { border-radius: 20px; }
}


/* ===== Dashboard- und Unit-Übersicht ohne Funk ===== */

.overview-grid {
  grid-template-columns: 1.15fr .85fr;
}

.panel-head.slim {
  align-items: center;
}

.dashboard-units {
  display: grid;
  gap: .65rem;
}

.dash-unit {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: .8rem;
  align-items: center;
  text-align: left;
  color: var(--text);
  padding: .85rem;
  border: 1px solid var(--border-soft);
  border-radius: 15px;
  background: rgba(6, 20, 38, .62);
}

.dash-unit:hover {
  border-color: rgba(96, 165, 250, .65);
  background: rgba(47, 128, 237, .12);
}

.dash-unit strong {
  display: block;
  margin-bottom: .2rem;
}

.dash-unit small {
  color: var(--muted);
}

.status-overview {
  display: grid;
  gap: .85rem;
}

.status-row {
  display: grid;
  gap: .4rem;
}

.status-row > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: .8rem;
}

.status-row span {
  color: var(--muted);
  font-size: .88rem;
}

.bar {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(96, 165, 250, .12);
  border: 1px solid var(--border-soft);
}

.bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2f80ed, #60a5fa);
}

.unit-meta {
  grid-template-columns: 1fr 1fr;
}

.unit-card {
  min-height: 250px;
}

@media (max-width: 1180px) {
  .overview-grid {
    grid-template-columns: 1fr;
  }
}


/* ===== Moderner Mitarbeiter-Dialog + Statussystem ===== */

.modern-dialog {
  width: min(780px, calc(100% - 2rem));
  border-radius: 28px;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(47, 128, 237, .20), transparent 16rem),
    rgba(9, 24, 44, .96);
}

.modern-modal {
  padding: 1.45rem;
}

.modal-titlebar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.15rem;
}

.modal-titlebar h3 {
  margin: .15rem 0 0;
  font-size: 1.35rem;
}

.modal-kicker {
  color: #7db7ff;
  font-size: .72rem;
  font-weight: 950;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.modal-x {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--soft-text);
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 13px;
  font-size: 1.35rem;
  line-height: 1;
}

.modal-x:hover {
  color: white;
  background: rgba(239, 68, 68, .14);
  border-color: rgba(239, 68, 68, .35);
}

.modern-modal .modal-grid {
  gap: .9rem;
}

.modern-modal label {
  padding: .75rem;
  border: 1px solid rgba(61, 107, 160, .18);
  border-radius: 18px;
  background: rgba(3, 11, 22, .24);
}

.modern-modal label:focus-within {
  border-color: rgba(96, 165, 250, .62);
  background: rgba(47, 128, 237, .08);
}

.modern-modal input,
.modern-modal select {
  margin-top: .2rem;
  border-radius: 13px;
  background: rgba(2, 8, 20, .78);
}

.status-hint {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-top: .95rem;
  padding: .75rem;
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  background: rgba(3, 11, 22, .28);
}

.modern-modal .modal-actions {
  margin-top: 1.15rem;
}

#officerStatusFilter option,
select[name="status"] option {
  background: #09182c;
  color: white;
}

@media (max-width: 720px) {
  .modern-modal {
    padding: 1rem;
  }

  .modern-modal .modal-grid {
    grid-template-columns: 1fr;
  }

  .modal-titlebar {
    align-items: center;
  }
}


/* ===== Status-Schnellauswahl ===== */

.status-field {
  grid-column: 1 / -1;
}

.status-choice {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
  margin-top: .45rem;
  padding: .55rem;
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  background: rgba(3, 11, 22, .35);
}

.status-option {
  padding: .25rem;
  border-radius: 999px;
  background: transparent;
  border: 1px solid transparent;
  transition: transform .14s ease, border-color .14s ease, background .14s ease, box-shadow .14s ease;
}

.status-option:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,.04);
  border-color: rgba(96, 165, 250, .28);
}

.status-option.active {
  background: rgba(47, 128, 237, .13);
  border-color: rgba(96, 165, 250, .75);
  box-shadow: 0 0 0 4px rgba(47, 128, 237, .14);
}

.status-option .badge {
  pointer-events: none;
}


/* ===== Moderne Personalakte + Module / Prüfungen ===== */

.personnel-detail {
  overflow: hidden;
}

.personnel-hero {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.1rem;
  margin: -1.15rem -1.15rem 1rem;
  border-bottom: 1px solid var(--border-soft);
  background:
    radial-gradient(circle at top right, rgba(47, 128, 237, .22), transparent 18rem),
    rgba(3, 11, 22, .18);
}

.personnel-hero h3 {
  margin: .15rem 0 .25rem;
  font-size: 1.45rem;
}

.personnel-tabs {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin: 1rem 0;
  padding: .45rem;
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  background: rgba(3, 11, 22, .28);
}

.tab {
  color: var(--soft-text);
  padding: .65rem .9rem;
  border-radius: 12px;
  background: transparent;
  font-weight: 850;
}

.tab:hover,
.tab.active {
  color: white;
  background: rgba(47, 128, 237, .22);
}

.personnel-tab {
  display: none;
}

.personnel-tab.active {
  display: block;
}

.modern-file-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.modern-file-grid label {
  padding: .75rem;
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  background: rgba(3, 11, 22, .24);
}

.modern-file-grid textarea {
  min-height: 150px;
}

.module-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.module-add-box {
  display: grid;
  grid-template-columns: 1fr .75fr .65fr 1.2fr;
  gap: .75rem;
  padding: .85rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  background: rgba(3, 11, 22, .34);
}

.module-list {
  display: grid;
  gap: .7rem;
}

.module-card {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: .9rem;
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  background: rgba(6, 20, 38, .74);
}

.module-card p {
  margin: .25rem 0 0;
  color: var(--muted);
}

.module-actions {
  display: flex;
  gap: .55rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.history-box {
  padding: 1rem;
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  background: rgba(3, 11, 22, .28);
}

.summary-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .75rem;
  margin-top: 1rem;
}

.summary-card {
  padding: .9rem;
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  background: rgba(6, 20, 38, .74);
}

.summary-card span {
  display: block;
  color: #9cc6f6;
  font-size: .72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: .35rem;
}

.summary-card strong {
  font-size: 1.25rem;
}

@media (max-width: 1180px) {
  .modern-file-grid,
  .module-add-box,
  .summary-list {
    grid-template-columns: 1fr;
  }

  .personnel-hero,
  .module-head,
  .module-card {
    flex-direction: column;
  }

  .module-actions {
    justify-content: flex-start;
  }
}


/* ===== Permission-System ===== */

.permission-layout {
  grid-template-columns: 1fr 1fr;
  align-items: start;
}

.permission-layout .wide-panel {
  grid-column: 1 / -1;
}

.permission-stats strong {
  font-size: 1.75rem;
}

.permission-list {
  display: grid;
  gap: .9rem;
  margin-top: 1rem;
}

.permission-group {
  padding: .9rem;
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  background: rgba(3, 11, 22, .30);
}

.permission-group h4 {
  color: #9cc6f6;
  margin-bottom: .7rem;
  font-size: .85rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.permission-check {
  display: flex;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: .75rem;
  padding: .65rem;
  border-radius: 14px;
  background: rgba(6, 20, 38, .55);
  margin-bottom: .45rem;
}

.permission-check:last-child {
  margin-bottom: 0;
}

.permission-check input {
  width: 18px;
  height: 18px;
  accent-color: #2f80ed;
}

.permission-check span {
  display: grid;
  gap: .15rem;
}

.permission-check small {
  color: var(--muted);
  font-size: .75rem;
}

.user-form {
  display: grid;
  gap: .85rem;
}

.user-list-wrap {
  margin-top: 1.25rem;
}

.user-row {
  display: flex;
  justify-content: space-between;
  gap: .85rem;
  align-items: center;
  padding: .85rem;
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  background: rgba(6, 20, 38, .68);
}

.user-row p {
  margin: .25rem 0 0;
  color: var(--muted);
}

.permission-note,
.permission-admin-note {
  margin-top: .85rem;
  padding: .85rem;
  border: 1px solid rgba(96, 165, 250, .28);
  border-radius: 16px;
  background: rgba(47, 128, 237, .10);
  color: var(--soft-text);
}

@media (max-width: 1180px) {
  .permission-layout {
    grid-template-columns: 1fr;
  }

  .permission-layout .wide-panel {
    grid-column: auto;
  }
}


/* ===== Modulübersicht / Modulverwaltung ===== */

.module-toolbar {
  display: grid;
  grid-template-columns: 1fr .55fr auto;
  gap: .75rem;
  align-items: center;
  margin-bottom: 1rem;
}

.module-toolbar .search {
  margin-bottom: 0;
}

.module-catalog {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: .85rem;
}

.module-admin-card {
  display: grid;
  gap: .85rem;
  padding: 1rem;
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(47, 128, 237, .18), transparent 9rem),
    rgba(6, 20, 38, .74);
}

.module-admin-card.inactive {
  opacity: .72;
}

.module-admin-main {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  align-items: flex-start;
}

.module-admin-card h3 {
  margin: .25rem 0 .35rem;
}

.module-admin-card p {
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
}

.module-category {
  display: inline-flex;
  color: #9cc6f6;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.module-stats strong {
  font-size: 1.9rem;
}

@media (max-width: 900px) {
  .module-toolbar {
    grid-template-columns: 1fr;
  }
}
