/* ========================================
   LSPD IAD · Apple Design System
   ======================================== */

:root {
  --bg: #1a1c1e;
  --bg-alt: #0d1d2d;
  --panel: rgba(12, 22, 33, 0.88);
  --panel2: rgba(17, 31, 46, 0.92);
  --line: rgba(146, 184, 225, 0.18);
  --text: #edf6ff;
  --muted: #9bb2c9;
  --blue: #5aa9ff;
  --blue-strong: #2a7df4;
  --blue-light: #bfe1ff;
  --danger: #ff6b6b;
  --ok: #43d17a;
  --warning: #ffb84d;
  --shadow: 0 18px 48px rgba(2, 6, 12, 0.38);
  --shadow-lg: 0 30px 80px rgba(1, 6, 12, 0.56);
  --radius: 18px;
  --radius-lg: 28px;
  --glass: rgba(15, 23, 35, 0.74);
}

* {
  box-sizing: border-box;
}

html,
body {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
  background:
    radial-gradient(circle at top right, rgba(90, 169, 255, 0.22), transparent 24%),
    radial-gradient(circle at bottom left, rgba(82, 129, 255, 0.12), transparent 26%),
    linear-gradient(180deg, #040b13 0%, #0b1521 30%, #0e1b2a 100%);
  color: var(--text);
  letter-spacing: -0.4px;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.05), transparent 22%, transparent 72%, rgba(255, 255, 255, 0.03));
  pointer-events: none;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: -0.4px;
}

.hidden {
  display: none !important;
}

/* ========================================
   LOGIN SCREEN
   ======================================== */

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top, rgba(90, 169, 255, 0.22), transparent 25%),
    linear-gradient(135deg, #050b13 0%, #0b1421 48%, #101d2d 100%);
}

.login-watermark {
  position: fixed;
  bottom: -60px;
  right: -60px;
  width: 280px;
  opacity: 0.045;
  z-index: 0;
  pointer-events: none;
  filter: drop-shadow(0 0 30px rgba(90, 169, 255, 0.2));
}

.login-watermark img {
  width: 100%;
}

.login-card {
  width: min(430px, 100%);
  background: linear-gradient(180deg, rgba(14, 24, 35, 0.94), rgba(9, 15, 24, 0.96));
  backdrop-filter: blur(22px);
  border: 1px solid rgba(143, 177, 214, 0.18);
  border-radius: var(--radius-lg);
  padding: 42px 34px;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  position: relative;
  z-index: 1;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
}

.login-brand img {
  width: 52px;
  height: 62px;
}

.login-brand>div {
  display: flex;
  flex-direction: column;
}

.brand {
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.5px;
  color: var(--text);
}

.sub {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
  letter-spacing: -0.2px;
}

.classification {
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.2px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  background: rgba(6, 13, 21, 0.82);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  outline: none;
  transition: all 0.25s ease;
  font-size: 15px;
}

.field textarea {
  min-height: 100px;
  resize: vertical;
}

.field input:hover,
.field select:hover {
  border-color: #d5d5d7;
}

.field input[disabled],
.field select[disabled],
.field textarea[disabled],
.readonly-field {
  background: rgba(9, 17, 26, 0.82) !important;
  color: var(--muted) !important;
  cursor: not-allowed;
  opacity: 0.9;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}

#msg {
  margin-top: 16px;
  min-height: 24px;
}

#msg .error {
  padding: 10px 12px;
  background: #fee;
  border: 1px solid rgba(255, 59, 48, 0.2);
  border-radius: 8px;
  color: var(--danger);
  font-size: 13px;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================
   MAINTENANCE & LOCKED SCREENS
   ======================================== */

.maintenance-screen,
.locked-screen {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 30px;
  overflow: hidden;
}

.maintenance-screen {
  isolation: isolate;
  background:
    radial-gradient(circle at 18% 15%, rgba(39, 139, 215, 0.2), transparent 28%),
    radial-gradient(circle at 83% 84%, rgba(214, 173, 77, 0.12), transparent 26%),
    linear-gradient(135deg, #040b14 0%, #071728 56%, #07111e 100%);
}

.locked-screen {
  background: linear-gradient(135deg, #fff5f5 0%, #ffe8e8 100%);
}

.maintenance-grid,
.maintenance-scanline {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.maintenance-grid {
  z-index: -1;
  opacity: 0.42;
  background-image:
    linear-gradient(rgba(119, 180, 237, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(119, 180, 237, 0.08) 1px, transparent 1px);
  background-size: 42px 42px;
  animation: maintenanceGrid 18s linear infinite;
}

.maintenance-scanline {
  z-index: 0;
  height: 28%;
  background: linear-gradient(180deg, transparent, rgba(74, 164, 238, 0.08), transparent);
  animation: maintenanceScan 5.5s ease-in-out infinite;
}

.maintenance-overlay,
.locked-overlay {
  display: none;
}

.maintenance-card,
.locked-card {
  position: relative;
  z-index: 1;
  width: min(540px, 100%);
  padding: 48px 40px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.maintenance-card {
  width: min(620px, 100%);
  padding: 30px 38px 34px;
  border-color: rgba(115, 177, 229, 0.32);
  border-radius: 8px;
  color: #edf6ff;
  background: linear-gradient(145deg, rgba(8, 25, 42, 0.96), rgba(5, 16, 28, 0.92));
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.56), inset 0 1px rgba(255, 255, 255, 0.06);
  animation: maintenanceEnter 600ms cubic-bezier(.2, .85, .24, 1) both;
}

.maintenance-status {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  color: #a7cbec;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.6px;
}

.maintenance-status span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e7b755;
  box-shadow: 0 0 0 0 rgba(231, 183, 85, 0.55);
  animation: maintenancePulse 1.8s ease-out infinite;
}

.maintenance-seal,
.locked-seal {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.maintenance-seal img,
.locked-seal img {
  width: 72px;
  height: 72px;
  opacity: 0.9;
}

.maintenance-seal {
  position: relative;
  align-items: center;
  height: 108px;
  margin-bottom: 17px;
}

.maintenance-seal img {
  position: relative;
  z-index: 1;
  width: 82px;
  height: 92px;
  filter: drop-shadow(0 10px 20px rgba(73, 164, 238, 0.32));
  animation: maintenanceSeal 4.6s ease-in-out infinite;
}

.maintenance-rings,
.maintenance-rings::after {
  position: absolute;
  border: 1px solid rgba(108, 183, 240, 0.3);
  border-radius: 50%;
  content: '';
}

.maintenance-rings {
  width: 102px;
  height: 102px;
  animation: maintenanceRing 4.6s ease-in-out infinite;
}

.maintenance-rings::after {
  inset: -15px;
  border-color: rgba(215, 177, 84, 0.16);
}

.maintenance-card .eyebrow,
.locked-card .eyebrow {
  letter-spacing: 1px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
}

.maintenance-card h1,
.locked-card h1 {
  margin: 16px 0 12px;
  font-size: 2.4rem;
  letter-spacing: -1px;
  color: var(--text);
  font-weight: 700;
}

.maintenance-card h1 {
  margin: 10px 0 13px;
  color: #f0f7ff;
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  letter-spacing: 0.14em;
  text-shadow: 0 0 26px rgba(86, 166, 235, 0.2);
}

.maintenance-card .eyebrow {
  color: #87bde9;
  letter-spacing: 1.7px;
}

.maintenance-rule {
  width: min(330px, 80%);
  height: 2px;
  margin: 0 auto 17px;
  background: linear-gradient(90deg, transparent, #d7b45d 22%, #79b9ec 50%, #d7b45d 78%, transparent);
}

.maintenance-card p,
.locked-card p {
  margin: 0 auto 28px;
  max-width: 420px;
  line-height: 1.6;
  color: var(--muted);
  font-size: 15px;
}

.maintenance-card p {
  color: #c5d9ea;
  font-size: 16px;
}

.maintenance-meta {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: -7px 0 25px;
  color: #7597b7;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.1px;
}

.maintenance-meta span+span::before {
  margin-right: 14px;
  color: #d7b45d;
  content: '•';
}

.maintenance-btn,
.locked-btn {
  width: min(240px, 100%);
  padding: 14px 20px;
  font-size: 15px;
  letter-spacing: -0.3px;
  font-weight: 500;
}

.maintenance-btn {
  border-color: #4b92d8;
  background: linear-gradient(135deg, #2e83d5, #195a9d);
  box-shadow: 0 10px 26px rgba(26, 104, 182, 0.28);
  letter-spacing: 0.9px;
  text-transform: uppercase;
}

@keyframes maintenanceEnter {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes maintenanceGrid {
  from {
    background-position: 0 0, 0 0;
  }

  to {
    background-position: 42px 42px, 42px 42px;
  }
}

@keyframes maintenanceScan {

  0%,
  100% {
    transform: translateY(-120%);
    opacity: 0;
  }

  12%,
  78% {
    opacity: 1;
  }

  90% {
    transform: translateY(420%);
    opacity: 0;
  }
}

@keyframes maintenancePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(231, 183, 85, 0.6);
  }

  70% {
    box-shadow: 0 0 0 11px rgba(231, 183, 85, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(231, 183, 85, 0);
  }
}

@keyframes maintenanceSeal {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-5px);
  }
}

@keyframes maintenanceRing {

  0%,
  100% {
    transform: scale(0.92);
    opacity: 0.35;
  }

  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
}

@media (prefers-reduced-motion: reduce) {

  .maintenance-grid,
  .maintenance-scanline,
  .maintenance-card,
  .maintenance-status span,
  .maintenance-seal img,
  .maintenance-rings {
    animation: none;
  }
}

@media (max-width: 560px) {
  .maintenance-screen {
    padding: 18px;
  }

  .maintenance-card {
    padding: 26px 20px 28px;
  }

  .maintenance-meta {
    gap: 8px;
    flex-direction: column;
  }

  .maintenance-meta span+span::before {
    display: none;
  }
}

/* ========================================
   MAIN LAYOUT
   ======================================== */

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

.layout.sidebar-collapsed {
  grid-template-columns: 0 1fr;
}

.layout.sidebar-collapsed .sidebar {
  display: none;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: linear-gradient(180deg, rgba(9, 17, 27, 0.96), rgba(5, 11, 18, 0.98));
  border-right: 1px solid var(--line);
  padding: 22px 16px 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(18px);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.04), 8px 0 30px rgba(0, 0, 0, 0.14);
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.sidebar-toggle {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.sidebar-toggle:hover {
  background: var(--line);
}

.side-brand {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.side-brand img {
  width: 36px;
  height: 44px;
  object-fit: contain;
}

.side-brand>div {
  min-width: 0;
}

.side-brand .logo {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--text);
}

.side-brand span {
  display: block;
  font-size: 8px;
  letter-spacing: 0.8px;
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  margin-top: 2px;
  line-height: 1;
}

.side-rule {
  height: 1px;
  background: var(--line);
  margin: 20px 0 16px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: auto;
}

.nav button {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s ease;
}

.nav button:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(143, 177, 214, 0.12);
  color: var(--text);
  transform: translateX(2px);
}

.nav button.active {
  background: linear-gradient(135deg, rgba(90, 169, 255, 0.24), rgba(90, 169, 255, 0.12));
  border-color: rgba(127, 192, 255, 0.22);
  color: white;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 12px 24px rgba(90, 169, 255, 0.12);
}

.nav-icon {
  width: 18px;
  text-align: center;
  font-size: 15px;
}

.nav-label {
  flex: 1;
  text-align: left;
}

.security-card {
  display: flex;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(143, 177, 214, 0.14);
  background: linear-gradient(135deg, rgba(90, 169, 255, 0.1), rgba(255, 255, 255, 0.02));
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 12px;
}

.security-card strong {
  font-size: 12px;
  display: block;
  color: var(--text);
  font-weight: 600;
}

.security-card small {
  font-size: 11px;
  color: var(--muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--ok);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.1);
}

.userbox {
  background: var(--bg);
  border-radius: 8px;
  padding: 16px;
  border: 1px solid var(--line);
}

.user-line {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.user-line .avatar {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--line);
}

.user-line .avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-line strong {
  font-size: 14px;
  color: var(--text);
  font-weight: 600;
}

.user-line .muted {
  font-size: 12px;
  color: var(--muted);
}

.mini-roleline {
  font-size: 10px;
  letter-spacing: 0.4px;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 600;
  margin-top: 4px;
}

.sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.content {
  position: relative;
  padding: 32px 48px;
  overflow-y: auto;
  background:
    radial-gradient(circle at 0% 0%, rgba(90, 169, 255, 0.08), transparent 18%),
    var(--bg);
}

.content-watermark {
  display: none;
}

#view {
  max-width: 1400px;
  margin: 0 auto;
}

.top {
  margin-bottom: 32px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.title h1 {
  font-size: 30px;
  letter-spacing: -1px;
  line-height: 1.1;
  color: var(--text);
  margin: 0;
  font-weight: 700;
}

.title p {
  color: var(--muted);
  font-size: 15px;
  letter-spacing: -0.3px;
  margin: 4px 0 0;
}

.title .eyebrow {
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 4px;
}

.title {
  position: relative;
  padding-left: 14px;
}

.title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--blue), #d6b15f);
}

/* ========================================
   BUTTONS
   ======================================== */

.btn {
  border: none;
  border-radius: 12px;
  padding: 10px 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
  transition: all 0.25s ease;
  font-size: 14px;
  letter-spacing: -0.3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid rgba(143, 177, 214, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(9, 20, 34, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.btn:active {
  transform: scale(0.98);
}

.btn.primary {
  background: linear-gradient(135deg, #73b9ff, #3d7df0 52%, #255fe2 100%);
  color: white;
  border-color: rgba(166, 216, 255, 0.42);
  box-shadow: 0 12px 26px rgba(61, 125, 240, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn.primary:hover {
  background: linear-gradient(135deg, #81c5ff, #4d8ef7 52%, #2f67eb 100%);
}

.btn.danger {
  background: linear-gradient(135deg, #ff7d7d, var(--danger));
  color: white;
}

.btn.danger:hover {
  background: linear-gradient(135deg, #ff8d8d, #ff4a4a);
}

.btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
}

.btn.ghost:hover {
  background: var(--bg);
  border-color: #ccc;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn.mini {
  padding: 6px 12px;
  font-size: 13px;
}

.btn.iconbtn {
  padding: 8px;
  background: transparent;
  border: none;
  color: var(--muted);
  width: 32px;
  height: 32px;
}

.btn.iconbtn:hover {
  background: var(--bg);
  color: var(--text);
}

/* ========================================
   CARDS & SECTIONS
   ======================================== */

.card {
  background: linear-gradient(180deg, rgba(15, 23, 35, 0.96), rgba(10, 16, 23, 0.95));
  border: 1px solid rgba(143, 177, 214, 0.18);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
  backdrop-filter: blur(14px);
}

.card:hover {
  border-color: rgba(143, 177, 214, 0.32);
  box-shadow: 0 24px 42px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat {
  background: linear-gradient(180deg, rgba(15, 23, 35, 0.95), rgba(10, 16, 25, 0.95));
  border: 1px solid rgba(143, 177, 214, 0.16);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--blue);
}

.stat strong {
  display: block;
  font-size: 28px;
  line-height: 1;
  color: var(--text);
  margin-bottom: 8px;
  font-weight: 700;
}

.stat span {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  font-weight: 500;
}

.stat:nth-child(2) {
  border-top-color: var(--ok);
}

.stat:nth-child(3) {
  border-top-color: #ff9500;
}

.stat:nth-child(4) {
  border-top-color: #5856d6;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.section-head h2 {
  font-size: 16px;
  letter-spacing: -0.4px;
  color: var(--text);
  margin: 0;
  font-weight: 600;
}

.section-head .muted {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

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

.empty {
  text-align: center;
  padding: 32px;
  color: var(--muted);
  font-size: 15px;
}

.error {
  background: #fee;
  border: 1px solid rgba(255, 59, 48, 0.2);
  color: var(--danger);
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  animation: slideDown 0.3s ease;
}

.success {
  background: #efe;
  border: 1px solid rgba(52, 199, 89, 0.2);
  color: var(--ok);
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  animation: slideDown 0.3s ease;
}

/* ========================================
   TABLES
   ======================================== */

.table-wrap {
  border: 1px solid rgba(143, 177, 214, 0.16);
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(10, 16, 24, 0.46);
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  background: rgba(15, 23, 35, 0.9);
  padding: 12px 16px;
  border-bottom: 1px solid rgba(143, 177, 214, 0.16);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: left;
}

.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  color: var(--text);
}

.table tbody tr {
  transition: background-color 0.2s ease;
}

.table tbody tr:hover {
  background: var(--bg);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table tbody tr.case-row-closed {
  background: rgba(255, 68, 68, 0.14);
  border-left: 2px solid var(--danger);
}

.table tbody tr.case-row-closed:hover {
  background: rgba(255, 68, 68, 0.22);
}

.status-text.status-closed {
  color: var(--danger);
  font-weight: 700;
}

/* ========================================
   FORMS & INPUTS
   ======================================== */

.form-section {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.form-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.form-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 16px;
}

.form-section-title span {
  display: inline-grid;
  width: 21px;
  height: 21px;
  margin-right: 7px;
  place-items: center;
  border: 1px solid rgba(107, 171, 230, 0.45);
  border-radius: 5px;
  color: #8fc4ff;
  font-size: 9px;
}

.role-selector {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.role-select {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 98px;
  padding: 14px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(12, 22, 35, 0.78), rgba(8, 17, 27, 0.9));
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.role-select:hover:not(.locked) {
  transform: translateY(-1px);
  border-color: rgba(111, 171, 255, 0.72);
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.12);
}

.role-select.locked {
  opacity: 0.62;
  cursor: not-allowed;
  border-style: dashed;
}

.role-select input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 4px;
  accent-color: var(--blue);
  cursor: pointer;
}

.role-select.locked input[type="checkbox"] {
  cursor: not-allowed;
}

.role-select-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(101, 169, 255, 0.12);
  color: #94c6ff;
  font-size: 17px;
  font-weight: 800;
  flex-shrink: 0;
}

.role-select-body {
  flex: 1;
  min-width: 0;
}

.role-select-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.role-select strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.role-select small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.role-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.role-pill.member {
  background: rgba(93, 176, 255, 0.12);
  color: #9fc9ff;
}

.role-pill.administrator {
  background: rgba(255, 181, 76, 0.12);
  color: #ffcb6b;
}

.locknotice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(211, 174, 93, 0.28);
  border-radius: 12px;
  background: rgba(24, 20, 13, 0.62);
  color: #dce9ff;
  line-height: 1.5;
}

.locknotice>span:first-child:not(:last-child) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 8px;
  background: rgba(215, 180, 93, 0.12);
  font-size: 15px;
}

.locknotice>span:only-child {
  min-width: 0;
  flex: 1;
}

.locknotice strong {
  color: #f1f7ff;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

/* ========================================
   MODALS
   ======================================== */

.modal-back {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 600px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal.case-modal {
  max-width: 1120px;
  width: min(1120px, 96vw);
  padding: 0;
  overflow: auto;
  background: rgba(9, 19, 29, 0.98);
}

.case-document {
  position: relative;
  overflow: hidden;
  padding: 24px;
  background: linear-gradient(180deg, rgba(8, 18, 27, 0.98), rgba(8, 17, 25, 0.98));
  color: var(--text);
}

.case-watermark {
  position: absolute;
  width: 470px;
  right: -130px;
  top: 180px;
  opacity: 0.03;
  pointer-events: none;
  filter: grayscale(1);
}

.case-watermark img {
  width: 100%;
}

.case-document-head {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.case-document-head .dossier-title>img {
  width: 66px;
  height: 78px;
  object-fit: contain;
}

.case-document-head h2 {
  margin: 0 0 2px;
  font-size: 28px;
  color: var(--text);
  letter-spacing: -0.6px;
}

.case-subtitle {
  font-size: 15px;
  color: #dfeaf8;
  font-weight: 600;
}

.case-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.readonly-badge {
  font-size: 10px;
  letter-spacing: 1px;
  border: 1px solid rgba(214, 179, 92, 0.6);
  color: #e4c677;
  background: rgba(43, 36, 21, 0.9);
  padding: 8px 10px;
  border-radius: 7px;
  font-weight: 800;
  white-space: nowrap;
}

.case-rule {
  position: relative;
  z-index: 1;
  height: 3px;
  background: linear-gradient(90deg, #c99e47 0 18%, #294867 18% 100%);
  margin: 19px 0;
}

.case-meta-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: #243a53;
  border: 1px solid #243a53;
  border-radius: 12px;
  overflow: hidden;
}

.meta-block {
  background: rgba(11, 25, 41, 0.95);
  padding: 13px 14px;
  min-height: 68px;
}

.meta-block span {
  display: block;
  color: var(--muted);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  margin-bottom: 6px;
}

.meta-block strong {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: #eaf1f9;
}

.priority-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6593c9;
}

.priority-dot.hoch {
  background: #f2a04f;
}

.priority-dot.kritisch {
  background: #ff5f6d;
}

.priority-dot.niedrig {
  background: #5ecf9a;
}

.case-body-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.35fr 0.8fr;
  gap: 14px;
  margin-top: 14px;
}

.document-section {
  position: relative;
  background: rgba(11, 25, 41, 0.94);
  border: 1px solid #233a55;
  border-radius: 13px;
  padding: 17px;
}

.document-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 11px;
  margin-bottom: 12px;
  border-bottom: 1px solid #20344d;
}

.document-section-head span {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(87, 155, 255, 0.12);
  color: #9ec6ff;
  font-size: 11px;
  font-weight: 800;
}

.document-section-head h3 {
  margin: 0;
  font-size: 14px;
  color: #edf6ff;
}

.document-section-head .muted {
  margin-left: auto;
  font-size: 11px;
}

.document-text,
.document-empty,
.evidence-view p,
.case-summary,
.case-footer {
  color: #dfeaf8;
  line-height: 1.6;
}

.document-text {
  font-size: 12px;
  white-space: pre-wrap;
}

.case-summary {
  position: relative;
  z-index: 1;
  margin-top: 16px;
  padding: 15px 16px;
  border: 1px solid #233a55;
  border-radius: 12px;
  background: rgba(10, 22, 35, 0.9);
}

.case-summary h3 {
  margin: 0 0 8px;
  font-size: 14px;
  color: #edf6ff;
}

.evidence-view-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.evidence-view {
  background: rgba(12, 26, 40, 0.88);
  border: 1px solid #233a55;
  border-radius: 11px;
  padding: 12px;
}

.evidence-number {
  display: inline-block;
  margin-bottom: 8px;
  color: #d4b56a;
  font-size: 10px;
  letter-spacing: 1.2px;
  font-weight: 800;
}

.evidence-view strong {
  display: block;
  margin-bottom: 6px;
  color: #edf6ff;
  font-size: 13px;
}

.evidence-view p {
  margin: 0 0 8px;
  font-size: 12px;
}

.evidence-view a {
  color: #7db9ff;
  text-decoration: none;
  font-size: 12px;
}

.evidence-time {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
}

.case-footer {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid #243a53;
  color: var(--muted);
  font-size: 12px;
}

.case-footer strong {
  color: #dfeaf8;
}

.case-footer span {
  display: block;
  margin-top: 4px;
}

.status-control {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr minmax(180px, 240px) auto;
  gap: 12px;
  align-items: center;
  margin: 16px 0 18px;
  padding: 14px 16px;
  border: 1px solid rgba(58, 136, 255, 0.32);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(16, 42, 72, 0.78), rgba(7, 20, 35, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.status-control span {
  display: block;
  font-weight: 800;
  color: #e9f3ff;
}

.status-control small {
  display: block;
  margin-top: 3px;
  color: #8fa8c4;
}

.status-control select {
  width: 100%;
  background: #081421;
  color: #eef6ff;
  border: 1px solid #315276;
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
}

.status-control select:focus {
  border-color: #4b9cff;
  box-shadow: 0 0 0 3px rgba(47, 132, 255, 0.12);
}

.status-readonly-note {
  position: relative;
  z-index: 2;
  margin: 16px 0 18px;
  padding: 11px 14px;
  border: 1px solid rgba(136, 160, 188, 0.18);
  border-radius: 12px;
  background: rgba(7, 18, 31, 0.7);
  color: #8fa8c4;
  font-size: 13px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.dossier-title {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  flex: 1;
}

.dossier-title img {
  width: 48px;
  height: 58px;
  object-fit: contain;
}

.dossier-title h2 {
  margin: 0;
  font-size: 20px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.5px;
}

.dossier-title .eyebrow {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  margin-bottom: 4px;
}

.dossier-title .muted {
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
}

@media (max-width: 1000px) {
  .case-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .case-body-grid {
    grid-template-columns: 1fr;
  }

  .evidence-view-grid {
    grid-template-columns: 1fr;
  }

  .case-document-head {
    align-items: flex-start;
  }

  .readonly-badge {
    display: none;
  }
}

@media (max-width: 580px) {
  .case-meta-grid {
    grid-template-columns: 1fr;
  }

  .case-document {
    padding: 15px;
  }

  .case-document-head .dossier-title>img {
    width: 45px;
    height: 55px;
  }

  .case-document-head h2 {
    font-size: 22px;
  }

  .status-control {
    grid-template-columns: 1fr;
  }

  .status-control .btn {
    width: 100%;
  }

  .case-footer {
    flex-direction: column;
  }
}

/* ========================================
   PROFILE UPLOAD
   ======================================== */

.profile-upload-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(10, 17, 27, 0.96), rgba(7, 12, 17, 0.94));
  transition: all 0.3s ease;
}

.profile-upload-box:hover {
  border-color: var(--blue);
  background: linear-gradient(135deg, rgba(0, 113, 227, 0.05), transparent);
}

.profile-avatar-preview {
  width: 140px;
  height: 140px;
  border-radius: 18px;
  border: 1px solid rgba(145, 176, 209, 0.22);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(24, 36, 55, 0.9), rgba(9, 17, 26, 0.95));
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.profile-avatar-preview:hover {
  transform: scale(1.05);
  border-color: var(--blue);
  box-shadow: 0 8px 24px rgba(0, 113, 227, 0.15);
}

.profile-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s ease;
}

.profile-upload-actions {
  display: flex;
  gap: 12px;
  width: 100%;
  justify-content: center;
}

#uploadMsg {
  width: 100%;
  min-height: 20px;
}

/* ========================================
   UTILITIES & MISC
   ======================================== */

.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.search {
  background: var(--bg) !important;
  border: 1px solid var(--line) !important;
  padding: 10px 14px !important;
  border-radius: 8px !important;
}

.classification-chip {
  display: inline-flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.person-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.person-avatar {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--blue), #5ac8fa);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

.person-avatar {
  overflow: hidden;
}

.person-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.person-avatar:has(img) span {
  display: none;
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}

.access-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}

.access-chip.admin {
  background: linear-gradient(135deg, #ff9500, #ff6b35);
  color: white;
  border: none;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--bg);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.status-badge.online {
  color: var(--ok);
}

.status-badge.offline {
  color: var(--muted);
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  background: var(--bg);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.pill.critical {
  background: rgba(255, 59, 48, 0.1);
  color: var(--danger);
}

.pill.high {
  background: rgba(255, 149, 0, 0.1);
  color: #ff9500;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

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

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 260px;
    height: 100vh;
    z-index: 999;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .layout:not(.sidebar-collapsed) .sidebar {
    transform: translateX(0);
  }

  .sidebar-toggle {
    display: flex;
  }

  .content {
    padding: 20px;
  }

  .grid2 {
    grid-template-columns: 1fr;
  }

  .modal {
    padding: 20px;
    border-radius: var(--radius);
  }

  .modal-head {
    flex-direction: column;
  }

  .dossier-title img {
    display: none;
  }

  .profile-avatar-preview {
    width: 100px;
    height: 100px;
  }

  .top {
    flex-direction: column;
  }

  .title h1 {
    font-size: 24px;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .form-actions {
    flex-direction: column-reverse;
  }

  .form-actions .btn {
    width: 100%;
  }

  .table {
    font-size: 12px;
  }

  .table th,
  .table td {
    padding: 8px 12px;
  }
}

/* Permanent dark blue theme */
body {
  --bg: #07111f;
  --bg-alt: #0d1b2d;
  --panel: rgba(13, 27, 45, 0.92);
  --panel2: rgba(16, 36, 58, 0.96);
  --line: rgba(120, 164, 214, 0.2);
  --text: #edf5ff;
  --muted: #9db6cf;
  --blue: #3d8fff;
  --blue-strong: #1976ff;
  --blue-light: #dfeeff;
  --glass: rgba(11, 22, 35, 0.72);
  --shadow: 0 2px 10px rgba(0, 0, 0, .24);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, .42);
  background:
    radial-gradient(circle at 85% 5%, rgba(37, 99, 235, 0.28), transparent 30%),
    linear-gradient(180deg, #07111f 0%, #091a2b 100%);
  color: var(--text);
}

.login,
.maintenance-screen,
.locked-screen {
  background: linear-gradient(145deg, rgba(4, 16, 26, 0.92), rgba(13, 30, 48, 0.98));
}

.login-card,
.maintenance-card,
.locked-card,
.modal {
  border-color: var(--line);
  box-shadow: var(--shadow-lg);
  background: linear-gradient(145deg, #0d1d30, #081522);
}

.field input,
.field select,
.field textarea,
.search {
  background: #071522 !important;
  color: var(--text);
  border-color: #24425f;
}

.table th {
  background: #0b1d30;
  color: #86a7c9;
}

.table td {
  border-bottom-color: #19304a;
}

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

@media (max-width: 480px) {
  .login-card {
    padding: 32px 24px;
  }

  .title h1 {
    font-size: 20px;
  }

  .card {
    padding: 16px;
  }

  .modal {
    padding: 16px;
  }

  .content {
    padding: 16px;
  }
}

.profile-upload-box {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel2);
}

.profile-avatar-preview {
  flex: 0 0 96px;
  width: 96px;
  height: 96px;
  border: 2px solid var(--blue);
  border-radius: 12px;
  background: var(--bg);
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(61, 143, 255, .16);
}

.profile-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity .25s;
}

.profile-upload-actions {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.profile-upload-actions input[type=file] {
  display: none;
}

.upload-select-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.upload-choose-btn {
  cursor: pointer;
  font-size: 12px;
  padding: 7px 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

.profile-file-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#profileUploadBtn {
  width: 100%;
  font-size: 13px;
}

.upload-msg {
  min-height: 18px;
  font-size: 12px;
  font-weight: 500;
}

.upload-ok {
  color: var(--ok);
}

.upload-err {
  color: var(--danger);
}

.upload-note {
  color: var(--muted);
}

#themePreference {
  min-height: 42px;
  cursor: pointer;
}

#themePreference option {
  background: var(--panel);
  color: var(--text);
}

@media (max-width: 560px) {
  .profile-upload-box {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .profile-upload-actions {
    align-items: center;
    width: 100%;
  }

  .upload-select-row {
    justify-content: center;
  }
}

/* Personnel directory layout */
.systembar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
  margin: -8px 0 18px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

.systemtag {
  padding: 6px 9px;
  border: 1px solid rgba(140, 176, 214, 0.24);
  border-radius: 7px;
  color: var(--muted);
  background: rgba(13, 23, 36, 0.9);
  white-space: nowrap;
}

.staff-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 20px;
}

.staff-summary-card {
  position: relative;
  min-height: 88px;
  padding: 16px 18px;
  border: 1px solid rgba(140, 176, 214, 0.16);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(13, 28, 42, 0.96), rgba(9, 17, 27, 0.98));
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

.staff-summary-card::after {
  content: "IAD";
  position: absolute;
  right: 12px;
  top: 8px;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -2px;
  color: rgba(129, 163, 209, 0.08);
}

.staff-summary-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
}

.staff-summary-card strong {
  display: block;
  position: relative;
  z-index: 1;
  margin-top: 10px;
  color: var(--text);
  font-size: 30px;
  line-height: 1;
}

.personnel-card {
  padding: 20px;
  border-radius: 16px;
}

.personnel-card .section-head {
  margin-bottom: 18px;
  padding-bottom: 18px;
}

.personnel-card .section-head h2 {
  margin: 0 0 5px;
  font-size: 18px;
}

.personnel-table {
  min-width: 900px;
}

.admin-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0 20px;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
  margin-bottom: 20px;
}

.admin-panel {
  padding: 18px;
  background: linear-gradient(180deg, rgba(12, 24, 36, 0.98), rgba(8, 17, 25, 0.98));
  border: 1px solid rgba(140, 176, 214, 0.16);
  border-radius: 16px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.12);
}

.admin-switch-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  padding: 14px 16px;
  background: rgba(8, 19, 31, 0.9);
  border: 1px solid rgba(140, 176, 214, 0.16);
  border-radius: 12px;
}

.admin-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.quick-stat {
  min-height: 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 12px 14px;
  border: 1px solid rgba(140, 176, 214, 0.14);
  border-radius: 12px;
  background: rgba(8, 19, 31, 0.82);
}

.quick-stat span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.quick-stat strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.note-box {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(140, 176, 214, 0.16);
  border-radius: 12px;
  background: rgba(10, 21, 34, 0.8);
  color: var(--muted);
  line-height: 1.6;
  font-size: 13px;
}

@media (max-width: 900px) {
  .admin-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }
}

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

  .admin-action-row .btn {
    width: 100%;
  }
}

.personnel-table th,
.personnel-table td {
  vertical-align: middle;
}

.personnel-table th {
  white-space: nowrap;
}

.personnel-table tbody tr:last-child td {
  border-bottom: 0;
}

.role-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.access-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel2);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.access-chip.admin {
  border-color: #c46b1f;
  background: rgba(255, 149, 0, .14);
  color: #ffb15b;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--panel2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.status-badge::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  content: '';
}

.status-badge.online {
  color: var(--ok);
}

.status-badge.offline {
  color: var(--muted);
}

.readonly-admin #saveMaintenance,
.readonly-admin #bulkActivateUsers,
.readonly-admin #bulkSuspendUsers,
.readonly-admin [data-user-lock] {
  display: none;
}

.readonly-admin #maintenanceToggle,
.readonly-admin #maintenanceMessage {
  pointer-events: none;
  opacity: .55;
}

.role-pill.readonly {
  background: rgba(117, 184, 234, .14);
  color: #9ed6ff;
}

@media (max-width: 800px) {
  .staff-summary {
    grid-template-columns: 1fr;
  }

  .systembar {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .personnel-card {
    padding: 14px;
  }
}

/* Sidebar edge arrow */
.sidebar-toggle {
  position: absolute;
  top: 50%;
  right: -13px;
  z-index: 30;
  width: 26px;
  height: 38px;
  padding: 0;
  border: 1px solid #345d80;
  border-radius: 0 7px 7px 0;
  background: linear-gradient(145deg, #163a5b, #0c2339);
  color: #b9dcff;
  box-shadow: 7px 7px 18px rgba(0, 0, 0, 0.28);
  font-size: 0;
  transform: translateY(-50%);
}

.sidebar-toggle::before {
  content: '‹';
  font-size: 20px;
  line-height: 1;
}

.sidebar-toggle:hover {
  background: linear-gradient(145deg, #24567e, #173b5c);
  color: #fff;
}

body.sidebar-collapsed .layout.sidebar-collapsed .sidebar {
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  min-width: 0;
  height: 100vh;
  padding: 0;
  border: 0;
  overflow: visible;
  transform: none;
  z-index: 20;
}

body.sidebar-collapsed .sidebar> :not(.sidebar-top),
body.sidebar-collapsed .sidebar-top .side-brand {
  display: none;
}

body.sidebar-collapsed .sidebar-top {
  visibility: hidden;
  margin: 0;
}

body.sidebar-collapsed .sidebar-toggle {
  position: fixed;
  left: 2px;
  right: auto;
  visibility: visible;
}

body.sidebar-collapsed .sidebar-toggle::before {
  content: '›';
}

@media (max-width: 768px) {
  body.sidebar-collapsed .layout.sidebar-collapsed .sidebar {
    width: 0;
    min-width: 0;
  }
}

.sidebar {
  overflow: visible;
  z-index: 40;
}

.sidebar-toggle {
  position: fixed;
  left: 279px;
  right: auto;
  z-index: 100;
}

body.sidebar-collapsed .layout.sidebar-collapsed {
  grid-template-columns: 1fr;
}

body.sidebar-collapsed .layout.sidebar-collapsed .sidebar {
  display: block;
  width: 0;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.sidebar-collapsed .sidebar-toggle {
  left: 0;
}

@media (max-width: 768px) {
  .sidebar-toggle {
    left: 247px;
  }
}

/* Apple Switch für Admin Panel */
.apple-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.apple-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.apple-switch .slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 24px;
  transition: .3s;
  border: 1px solid var(--line);
}

.apple-switch .slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: var(--muted);
  border-radius: 50%;
  transition: .3s;
}

.apple-switch input:checked+.slider {
  background-color: var(--danger);
  border-color: var(--danger);
}

.apple-switch input:checked+.slider:before {
  transform: translateX(20px);
  background-color: #fff;
}