:root {
  --bg: #070a0f;
  --sidebar: #0d121c;
  --panel: #111827;
  --panel-2: #162033;
  --text: #edf3ff;
  --muted: #9aa8bd;
  --line: rgba(255, 255, 255, 0.1);
  --blue: #38bdf8;
  --green: #22c55e;
  --red: #ef4444;
  --yellow: #f59e0b;
  --shadow: 0 20px 70px rgba(0, 0, 0, 0.38);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.16), transparent 34%),
    radial-gradient(circle at bottom left, rgba(34, 197, 94, 0.10), transparent 36%),
    var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.55;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.app-shell {
  display: grid;
  grid-template-columns: 300px 1fr;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  background: linear-gradient(180deg, rgba(13, 18, 28, 0.96), rgba(7, 10, 15, 0.96));
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.45) rgba(255, 255, 255, 0.05);
}

.sidebar::-webkit-scrollbar {
  width: 8px;
}

.sidebar::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.45);
  border-radius: 999px;
}

.brand { display: flex; gap: 14px; align-items: center; }

.brand-mark {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(56, 189, 248, 0.22);
  box-shadow: 0 12px 30px rgba(56, 189, 248, 0.18);
  flex-shrink: 0;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.eyebrow, .small-title, .classified {
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-size: 12px;
  font-weight: 800;
  margin: 0 0 4px;
}

.brand h1 { margin: 0; font-size: 20px; line-height: 1.1; }

.login-box, .sidebar-card {
  padding: 16px;
  border-radius: 18px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.18);
}

.login-box p, .sidebar-card p {
  color: var(--muted);
  font-size: 14px;
  margin: 4px 0;
}

.login-actions {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.nav { display: grid; gap: 10px; }

.nav-item {
  text-align: left;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 13px 14px;
  color: var(--muted);
  background: transparent;
  transition: 0.18s ease;
}

.nav-item:hover, .nav-item.active {
  color: var(--text);
  background: rgba(56, 189, 248, 0.10);
  border-color: rgba(56, 189, 248, 0.24);
}

.sidebar-card { margin-top: auto; }
.sidebar-card .small-title { color: #bae6fd; }

.main {
  height: 100vh;
  padding: 24px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}

.topbar {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 0 30px;
}

.topbar h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 48px);
  letter-spacing: -0.05em;
}

.top-actions, .modal-actions, .panel-header, .section-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.status-pill {
  border-radius: 999px;
  padding: 10px 13px;
  font-weight: 900;
  color: #fecaca;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.status-pill.on {
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.25);
}

.primary-btn, .ghost-btn, .danger-btn, .text-btn, .quick-actions button {
  border: 0;
  border-radius: 13px;
  padding: 11px 15px;
  font-weight: 800;
}

.primary-btn { background: var(--blue); color: #061018; }
.ghost-btn { color: var(--text); background: transparent; border: 1px solid var(--line); }
.danger-btn { color: white; background: var(--red); }
.text-btn { padding: 0; background: transparent; color: var(--blue); }

.view { display: none; }
.active-view { display: block; }

.hero-panel, .panel, .card-item, .stat-card, .notice {
  background: linear-gradient(145deg, rgba(17, 24, 39, 0.94), rgba(22, 32, 51, 0.86));
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.hero-panel {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
  padding: 32px;
  margin-bottom: 22px;
}

.hero-panel h3 {
  margin: 10px 0;
  font-size: clamp(30px, 5vw, 62px);
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.hero-panel p, .panel p, .card-item p, .section-intro p, .notice { color: var(--muted); }

.terminal-box {
  border-radius: 18px;
  padding: 22px;
  background: #030712;
  color: #bbf7d0;
  font-family: Consolas, monospace;
  border: 1px solid rgba(34, 197, 94, 0.24);
  align-self: center;
}

.terminal-box p { margin: 8px 0; }
.terminal-box .ok { color: var(--green); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
  margin: 22px 0;
}

.stat-card { padding: 22px; }
.stat-card span { font-size: 42px; font-weight: 900; color: var(--blue); }
.stat-card p { margin: 0; color: var(--muted); }

.content-grid, .data-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.panel { padding: 24px; }
.panel h3, .card-item h3, .section-intro h3 { margin: 0 0 8px; }

.quick-actions { display: grid; gap: 12px; }

.quick-actions button {
  text-align: left;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
}

.section-intro {
  margin-bottom: 22px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.035);
}

.notice {
  padding: 16px 18px;
  margin-bottom: 18px;
}

.cards-list, .mini-list { display: grid; gap: 16px; }
.card-item { padding: 22px; position: relative; overflow: hidden; }

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.badge, .tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(56, 189, 248, 0.24);
  color: #bae6fd;
  background: rgba(56, 189, 248, 0.10);
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
}

.badge.green, .tag.green {
  color: #bbf7d0;
  border-color: rgba(34, 197, 94, 0.25);
  background: rgba(34, 197, 94, 0.10);
}

.badge.yellow, .tag.yellow {
  color: #fde68a;
  border-color: rgba(245, 158, 11, 0.25);
  background: rgba(245, 158, 11, 0.10);
}

.badge.red, .tag.red {
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.28);
  background: rgba(239, 68, 68, 0.12);
}


.badge.purple,
.tag.purple {
  color: #e9d5ff;
  border-color: rgba(168, 85, 247, 0.32);
  background: rgba(168, 85, 247, 0.14);
}

.item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.item-actions button, .signup-form button, .mini-delete {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
  font-weight: 800;
}

.item-actions .delete, .mini-delete {
  border-color: rgba(239, 68, 68, 0.28);
  color: #fecaca;
}

.participant-box {
  margin-top: 18px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.035);
}

.participant-box h4 { margin: 0 0 10px; }

.participant-list {
  margin: 10px 0 14px;
  padding-left: 20px;
  color: var(--muted);
}

.signup-form, .inline-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.signup-form input, .inline-form input {
  flex: 1;
  min-width: 220px;
}

.tabs, .filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.tab-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  padding: 10px 14px;
  font-weight: 800;
}

.tab-btn.active {
  color: #061018;
  background: var(--blue);
  border-color: var(--blue);
}

.filters input, .filters select {
  min-height: 44px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  padding: 0 14px;
}

.filters input { flex: 1; min-width: 260px; }
.filters select { min-width: 190px; }

.empty-state {
  padding: 28px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 20px;
}

.mini-row {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  color: var(--muted);
}

.modal {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  width: min(760px, calc(100% - 26px));
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
}

.modal-card {
  background: linear-gradient(145deg, #101827, #0b111d);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.large-modal { width: 100%; }

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.modal-header h3 {
  margin: 0;
  font-size: 26px;
  letter-spacing: -0.03em;
}

.modal-note {
  color: var(--muted);
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.16);
  border-radius: 16px;
  padding: 12px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  font-size: 24px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
  margin-bottom: 14px;
}

input, select, textarea {
  width: 100%;
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.055);
  border-radius: 14px;
  padding: 12px 13px;
  outline: none;
}

select option { color: #111827; }
textarea { min-height: 120px; resize: vertical; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.danger-panel { border-color: rgba(239, 68, 68, 0.25); }


.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
  border-radius: 16px;
  padding: 14px;
}

.switch-row span {
  display: grid;
  gap: 3px;
}

.switch-row strong {
  color: var(--text);
}

.switch-row small {
  color: var(--muted);
  font-weight: 600;
}

.switch-row input[type="checkbox"] {
  appearance: none;
  width: 54px;
  height: 30px;
  border-radius: 999px;
  padding: 0;
  flex: 0 0 auto;
  position: relative;
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.35);
  transition: 0.2s ease;
}

.switch-row input[type="checkbox"]::before {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  top: 3px;
  left: 3px;
  border-radius: 50%;
  background: #fff;
  transition: 0.2s ease;
}

.switch-row input[type="checkbox"]:checked {
  background: rgba(34, 197, 94, 0.22);
  border-color: rgba(34, 197, 94, 0.48);
}

.switch-row input[type="checkbox"]:checked::before {
  transform: translateX(24px);
}


.tag-picker {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.tag-picker > p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.tag-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.tag-options label {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
  border-radius: 14px;
  padding: 10px 12px;
  font-weight: 800;
}

.tag-options input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
  flex: 0 0 auto;
}


.access-gate,
.scp-login-loader {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(rgba(56, 189, 248, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.045) 1px, transparent 1px),
    radial-gradient(circle at center, rgba(56, 189, 248, 0.16), rgba(0, 0, 0, 0.92) 48%, rgba(0, 0, 0, 0.98));
  background-size: 34px 34px, 34px 34px, cover;
  backdrop-filter: blur(10px);
}

.access-card,
.scp-loader-card {
  width: min(760px, 94vw);
  border: 1px solid rgba(56, 189, 248, 0.32);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(2, 6, 23, 0.97));
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.65), inset 0 0 60px rgba(56, 189, 248, 0.045);
  padding: 28px;
  position: relative;
  overflow: hidden;
}

.access-card::before,
.scp-loader-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,0.035), rgba(255,255,255,0.035) 1px, transparent 1px, transparent 6px);
  pointer-events: none;
  opacity: 0.25;
}

.access-terminal-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 20px;
  position: relative;
}

.access-terminal-header span {
  color: var(--blue);
  font-weight: 1000;
  letter-spacing: 0.18em;
  font-size: 12px;
}

.access-terminal-header h2 {
  margin: 4px 0 0;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1;
}

.access-scp-mark,
.scp-loader-logo {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 2px solid rgba(56, 189, 248, 0.55);
  display: grid;
  place-items: center;
  color: var(--text);
  font-weight: 1000;
  letter-spacing: 0.12em;
  background: rgba(56, 189, 248, 0.08);
  box-shadow: 0 0 40px rgba(56, 189, 248, 0.18);
}

.access-text,
.access-footnote {
  position: relative;
}

.access-guest-form {
  position: relative;
  display: grid;
  gap: 14px;
  margin: 22px 0;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
}

.access-choice-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.access-choice-grid button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  border-radius: 16px;
  padding: 14px 16px;
  font-weight: 1000;
}

.access-choice-grid button:hover {
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.12);
}

.scp-login-loader {
  z-index: 10000;
}

.scp-loader-card {
  text-align: center;
  width: min(620px, 94vw);
}

.scp-loader-logo {
  margin: 0 auto 20px;
  position: relative;
}

.scp-loader-ring {
  position: absolute;
  inset: -9px;
  border-radius: 50%;
  border: 2px dashed rgba(56, 189, 248, 0.65);
  animation: scpSpin 1.1s linear infinite;
}

.scp-loader-lines {
  display: grid;
  gap: 8px;
  margin: 18px auto;
  max-width: 420px;
  color: var(--muted);
  text-align: left;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.scp-progress {
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
}

.scp-progress i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(56,189,248,.35), var(--blue));
  animation: scpLoad 1.35s ease forwards;
}

@keyframes scpLoad { from { width: 0%; } to { width: 100%; } }
@keyframes scpSpin { to { transform: rotate(360deg); } }

@media (max-width: 720px) {
  .access-choice-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .tag-options {
    grid-template-columns: 1fr;
  }
}


.guide-embed {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.035);
}

.guide-embed iframe {
  width: 100%;
  height: 720px;
  border: 0;
  display: block;
  background: white;
}

.guide-link-note {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}

.guide-link-note a {
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
}

.guide-link-note a:hover {
  text-decoration: underline;
}


.guide-open-btn {
  display: inline-flex;
  width: fit-content;
  margin-top: 12px;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #061018;
  background: var(--blue);
  border-radius: 13px;
  padding: 11px 15px;
  font-weight: 900;
}

.guide-open-btn:hover {
  filter: brightness(1.08);
}


.db-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 12px;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 900;
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.10);
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.db-status.error {
  color: #fecaca;
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.28);
}


.complaint-private-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.complaint-token {
  display: inline-flex;
  margin-top: 10px;
  border-radius: 999px;
  padding: 6px 10px;
  color: #e9d5ff;
  background: rgba(168, 85, 247, 0.14);
  border: 1px solid rgba(168, 85, 247, 0.32);
  font-size: 12px;
  font-weight: 900;
}


.complaint-pin-display {
  margin-bottom: 18px;
  border: 1px solid rgba(168, 85, 247, 0.34);
  background: rgba(168, 85, 247, 0.13);
  color: #e9d5ff;
  border-radius: 20px;
  padding: 18px;
  font-weight: 800;
}

.complaint-pin-display strong {
  color: var(--text);
  font-size: 28px;
  letter-spacing: 0.08em;
}

.complaint-lookup-panel {
  margin-bottom: 18px;
}

.complaint-private-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.complaint-chat {
  margin-top: 18px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
}

.complaint-chat h4 {
  margin: 0 0 12px;
}

.complaint-messages {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.complaint-message {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 14px;
  padding: 12px;
}

.complaint-message.admin-message {
  border-color: rgba(56, 189, 248, 0.25);
  background: rgba(56, 189, 248, 0.08);
}

.complaint-message-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.complaint-chat-form {
  display: grid;
  gap: 10px;
}

.complaint-chat-form textarea {
  min-height: 90px;
}


.message-form {
  display: grid;
  gap: 12px;
}

.message-form textarea {
  min-height: 140px;
}

.message-body {
  margin-top: 12px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
}

.message-unread {
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.18), var(--shadow);
}


.findings-box {
  margin-top: 18px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
}

.findings-box h4 {
  margin: 0 0 12px;
}

.finding-item {
  margin-top: 12px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
}

.finding-item h5 {
  margin: 0 0 8px;
  font-size: 18px;
}

.finding-content {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.finding-content p {
  margin: 0;
}


.patient-folder {
  padding: 0;
  overflow: hidden;
}

.record-folder-header {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  text-align: left;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 24px;
  cursor: pointer;
  font: inherit;
}

.record-folder-header:hover {
  background: rgba(56, 189, 248, 0.045);
}

.record-folder-header h3 {
  margin: 0 0 12px;
}

.folder-toggle {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 9px 13px;
  font-weight: 900;
  color: #061018;
  background: var(--blue);
}

.record-folder-content {
  padding: 0 24px 24px;
  border-top: 1px solid var(--line);
}

@media (max-width: 720px) {
  .record-folder-header {
    flex-direction: column;
  }

  .folder-toggle {
    width: fit-content;
  }
}


.badge.pink,
.tag.pink {
  color: #fbcfe8;
  border-color: rgba(236, 72, 153, 0.32);
  background: rgba(236, 72, 153, 0.14);
}

.badge.orange,
.tag.orange {
  color: #fed7aa;
  border-color: rgba(249, 115, 22, 0.32);
  background: rgba(249, 115, 22, 0.14);
}


.modal-help {
  color: var(--muted);
  margin-top: -4px;
  margin-bottom: 16px;
}

.finding-type-grid {
  display: grid;
  gap: 12px;
}

.finding-type-card {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: rgba(56, 189, 248, 0.08);
  color: var(--text);
  border-radius: 18px;
  padding: 16px;
  cursor: pointer;
  display: grid;
  gap: 6px;
}

.finding-type-card strong {
  font-size: 18px;
}

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

.finding-type-card:hover {
  transform: translateY(-1px);
  border-color: rgba(56, 189, 248, 0.45);
}

.finding-type-card.purple-card {
  background: rgba(168, 85, 247, 0.10);
}

.finding-type-card.purple-card:hover {
  border-color: rgba(168, 85, 247, 0.45);
}

.finding-type-card.green-card {
  background: rgba(34, 197, 94, 0.10);
}

.finding-type-card.green-card:hover {
  border-color: rgba(34, 197, 94, 0.45);
}

.finding-type-card.orange-card {
  background: rgba(249, 115, 22, 0.10);
}

.finding-type-card.orange-card:hover {
  border-color: rgba(249, 115, 22, 0.45);
}


.finding-type-card.pink-card {
  background: rgba(236, 72, 153, 0.10);
}

.finding-type-card.pink-card:hover {
  border-color: rgba(236, 72, 153, 0.45);
}


.form-section-title {
  margin-top: 12px;
  margin-bottom: 4px;
  color: var(--blue);
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 13px;
}

.patient-master-data {
  margin-top: 16px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
}

.patient-master-data h4 {
  margin: 0 0 12px;
}

.master-data-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.master-data-grid div {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.master-data-grid strong {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 3px;
}

@media (max-width: 720px) {
  .master-data-grid {
    grid-template-columns: 1fr;
  }
}


.recipient-picker {
  position: relative;
  display: grid;
  gap: 8px;
}

.recipient-results {
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(10, 16, 26, 0.98);
  box-shadow: var(--shadow);
  padding: 6px;
}

.recipient-results.hidden {
  display: none;
}

.recipient-option {
  width: 100%;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 10px 12px;
  cursor: pointer;
  display: grid;
  gap: 3px;
  font: inherit;
}

.recipient-option:hover,
.recipient-option.active {
  background: rgba(56, 189, 248, 0.14);
}

.recipient-option strong {
  color: var(--text);
  font-size: 15px;
}

.recipient-option span {
  color: var(--muted);
  font-size: 13px;
}

select,
select option {
  color: var(--text);
  background: var(--panel);
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  .sidebar {
    position: relative;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .main {
    height: auto;
    overflow: visible;
  }
  .nav { grid-template-columns: repeat(2, 1fr); }
  .hero-panel, .content-grid, .data-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .topbar, .section-intro { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 620px) {
  .main, .sidebar { padding: 16px; }
  .nav, .stats-grid, .form-grid { grid-template-columns: 1fr; }
  .hero-panel { padding: 22px; }
  .top-actions { width: 100%; flex-direction: column; align-items: stretch; }
}



/* SCP Login-Animation V2 5s */

/* SCP Login-Animation */
.scp-auth-loading {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, rgba(56, 189, 248, 0.10), transparent 32%),
    linear-gradient(180deg, rgba(2, 6, 12, 0.98), rgba(0, 0, 0, 0.995));
  color: var(--text, #eef5ff);
  overflow: hidden;
}

.scp-auth-loading.hidden {
  display: none !important;
}

.scp-auth-loading::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.035) 0,
      rgba(255, 255, 255, 0.035) 1px,
      transparent 1px,
      transparent 6px
    );
  opacity: 0.28;
  pointer-events: none;
  animation: scpScanlines 1.2s linear infinite;
}

.scp-auth-loading::after {
  content: "SECURE • CONTAIN • PROTECT";
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(148, 163, 184, 0.36);
  letter-spacing: 0.35em;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.scp-loading-card {
  position: relative;
  width: min(560px, 92vw);
  min-height: 430px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 28px;
  background: rgba(5, 10, 18, 0.92);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.08),
    0 32px 90px rgba(0, 0, 0, 0.7),
    inset 0 0 38px rgba(56, 189, 248, 0.06);
  padding: 42px 34px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 14px;
  overflow: hidden;
}

.scp-loading-logo {
  width: 122px;
  height: 122px;
  border-radius: 50%;
  border: 2px solid rgba(56, 189, 248, 0.72);
  display: grid;
  place-items: center;
  font-size: 30px;
  font-weight: 1000;
  letter-spacing: 0.12em;
  color: #eaf6ff;
  background:
    radial-gradient(circle, rgba(56, 189, 248, 0.18), rgba(15, 23, 42, 0.2));
  animation: scpPulse 1.2s ease-in-out infinite;
}

.scp-loading-title {
  color: #e5f6ff;
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 1000;
  letter-spacing: 0.16em;
  text-align: center;
}

.scp-loading-subtitle {
  color: rgba(148, 163, 184, 0.9);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.26em;
  text-align: center;
}

.scp-loading-lines {
  width: min(420px, 100%);
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.scp-auth-line {
  min-height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  font-weight: 1000;
  letter-spacing: 0.08em;
  background: rgba(255, 255, 255, 0.035);
  opacity: 0.35;
}

.scp-auth-loading.active .auth-check {
  color: #fb923c;
  border-color: rgba(251, 146, 60, 0.38);
  background: rgba(251, 146, 60, 0.10);
  animation: scpLineIn 5s linear both;
}

.scp-auth-loading.active .clearance-load {
  color: #fb923c;
  border-color: rgba(251, 146, 60, 0.38);
  background: rgba(251, 146, 60, 0.10);
  animation: scpLineIn 5s linear both;
  animation-delay: 1.45s;
}

.scp-auth-loading.active .access-granted {
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.10);
  animation: scpAccessIn 5s linear both;
  animation-delay: 3.25s;
}

.scp-loading-bar {
  width: min(420px, 100%);
  height: 12px;
  margin-top: 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(56, 189, 248, 0.22);
  overflow: hidden;
}

.scp-loading-bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #38bdf8, #fb923c, #22c55e);
}

.scp-auth-loading.active .scp-loading-bar span {
  animation: scpLoadingBar 5s ease-in-out forwards;
}

@keyframes scpLoadingBar {
  0% { width: 0%; }
  35% { width: 38%; }
  68% { width: 72%; }
  100% { width: 100%; }
}

@keyframes scpPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 22px rgba(56, 189, 248, 0.18); }
  50% { transform: scale(1.035); box-shadow: 0 0 42px rgba(56, 189, 248, 0.34); }
}

@keyframes scpScanlines {
  from { transform: translateY(0); }
  to { transform: translateY(12px); }
}

@keyframes scpLineIn {
  0%, 15% { opacity: 0.35; transform: translateX(-8px); }
  25%, 100% { opacity: 1; transform: translateX(0); }
}

@keyframes scpAccessIn {
  0%, 5% { opacity: 0.25; transform: scale(0.96); }
  18%, 100% { opacity: 1; transform: scale(1); }
}

body.scp-auth-locked { overflow: hidden; }



/* SCP Login-Animation V3: rotierendes Emblem, Flackern, Ladebalken exakt 5s */
.scp-auth-loading.active {
  animation: scpScreenFlicker 5s linear both;
}

.scp-loading-card {
  animation: scpCardFlicker 5s linear both;
}

.scp-loading-logo {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  animation: scpLogoRotate 5s linear infinite, scpLogoFlicker 5s linear both !important;
  overflow: visible !important;
}

.scp-loading-logo img {
  width: 122px;
  height: 122px;
  object-fit: contain;
  display: block;
  filter:
    drop-shadow(0 0 12px rgba(56, 189, 248, 0.55))
    drop-shadow(0 0 24px rgba(56, 189, 248, 0.22));
}

.scp-auth-loading.active .scp-loading-title,
.scp-auth-loading.active .scp-loading-subtitle,
.scp-auth-loading.active .scp-loading-lines {
  animation: scpTextFlicker 5s linear both;
}

.scp-auth-loading.active .scp-loading-bar span {
  animation: scpLoadingBarExact 5s linear forwards !important;
}

@keyframes scpLoadingBarExact {
  from { width: 0%; }
  to { width: 100%; }
}

@keyframes scpLogoRotate {
  from { transform: rotate(0deg) scale(1); }
  to { transform: rotate(360deg) scale(1); }
}

@keyframes scpScreenFlicker {
  0%, 100% { opacity: 1; }
  4% { opacity: 0.94; }
  5% { opacity: 1; }
  9% { opacity: 0.97; }
  10% { opacity: 1; }
  21% { opacity: 0.95; }
  22% { opacity: 1; }
  43% { opacity: 0.98; }
  44% { opacity: 0.92; }
  45% { opacity: 1; }
  72% { opacity: 0.96; }
  73% { opacity: 1; }
}

@keyframes scpCardFlicker {
  0%, 100% {
    filter: brightness(1);
    transform: translateY(0);
  }
  7% {
    filter: brightness(1.25);
    transform: translateY(-1px);
  }
  8% {
    filter: brightness(0.86);
    transform: translateY(0);
  }
  9% {
    filter: brightness(1.05);
  }
  32% {
    filter: brightness(1.16);
  }
  33% {
    filter: brightness(0.92);
  }
  34% {
    filter: brightness(1);
  }
  66% {
    filter: brightness(1.18);
    transform: translateX(1px);
  }
  67% {
    filter: brightness(0.9);
    transform: translateX(0);
  }
}

@keyframes scpLogoFlicker {
  0%, 100% { opacity: 1; filter: none; }
  12% { opacity: 0.88; filter: blur(0.3px); }
  13% { opacity: 1; filter: none; }
  39% { opacity: 0.92; }
  40% { opacity: 1; }
  58% { opacity: 0.86; filter: contrast(1.2); }
  59% { opacity: 1; filter: none; }
  83% { opacity: 0.9; }
  84% { opacity: 1; }
}

@keyframes scpTextFlicker {
  0%, 100% { opacity: 1; text-shadow: 0 0 0 transparent; }
  6% { opacity: 0.82; text-shadow: 2px 0 rgba(56, 189, 248, 0.25); }
  7% { opacity: 1; text-shadow: none; }
  27% { opacity: 0.9; }
  28% { opacity: 1; }
  63% { opacity: 0.82; text-shadow: -2px 0 rgba(251, 146, 60, 0.22); }
  64% { opacity: 1; text-shadow: none; }
}


/* Inline SCP emblem fix */
.scp-loading-logo {
  width: 132px !important;
  height: 132px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #e8f7ff !important;
  display: grid !important;
  place-items: center !important;
  overflow: visible !important;
}

.scp-loading-logo img { display: none !important; }

.scp-loading-logo .scp-inline-emblem {
  width: 118px !important;
  height: 118px !important;
  display: block !important;
  overflow: visible !important;
  filter: drop-shadow(0 0 10px rgba(56,189,248,0.45)) drop-shadow(0 0 20px rgba(56,189,248,0.22));
}

.scp-loading-logo .scp-inline-emblem * {
  vector-effect: non-scaling-stroke;
}



/* SCP Terminal Login Design */
.scp-auth-loading {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: block;
  color: #f8fafc;
  background:
    radial-gradient(circle at 31% 32%, rgba(255,255,255,0.08), transparent 22%),
    radial-gradient(circle at 72% 38%, rgba(56,189,248,0.045), transparent 28%),
    linear-gradient(180deg, rgba(0,0,0,0.98), rgba(0,0,0,1));
  overflow: hidden;
  font-family: Consolas, "Courier New", monospace;
  isolation: isolate;
}

.scp-auth-loading.hidden {
  display: none !important;
}

body.scp-auth-locked {
  overflow: hidden !important;
}

.scp-auth-loading::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 42px 42px;
  opacity: 0.34;
  z-index: -3;
}

.scp-auth-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255,255,255,0.045) 0,
      rgba(255,255,255,0.045) 1px,
      transparent 1px,
      transparent 5px
    ),
    radial-gradient(circle at center, transparent 0%, rgba(0,0,0,0.55) 78%);
  opacity: 0.22;
  pointer-events: none;
  animation: scpTerminalScanlines 0.9s linear infinite;
  z-index: 15;
}

.scp-auth-loading.active {
  animation: scpTerminalFlicker 5s linear both;
}

.scp-corner {
  position: absolute;
  width: 46px;
  height: 46px;
  border-color: rgba(255,255,255,0.55);
  opacity: 0.72;
}

.scp-corner-tl { top: 34px; left: 34px; border-top: 2px solid; border-left: 2px solid; }
.scp-corner-tr { top: 34px; right: 34px; border-top: 2px solid; border-right: 2px solid; }
.scp-corner-bl { bottom: 34px; left: 34px; border-bottom: 2px solid; border-left: 2px solid; }
.scp-corner-br { bottom: 34px; right: 34px; border-bottom: 2px solid; border-right: 2px solid; }

.scp-terminal-top-left,
.scp-terminal-top-right,
.scp-terminal-footer-left,
.scp-terminal-footer-right,
.scp-terminal-side-left,
.scp-terminal-side-right {
  position: absolute;
  color: rgba(226,232,240,0.58);
  font-size: clamp(10px, 1vw, 14px);
  letter-spacing: 0.06em;
  line-height: 1.55;
  text-transform: uppercase;
  z-index: 2;
  text-shadow: 0 0 10px rgba(255,255,255,0.12);
}

.scp-terminal-top-left { top: 60px; left: 72px; }
.scp-terminal-top-right { top: 60px; right: 72px; text-align: right; }
.scp-terminal-footer-left { left: 72px; bottom: 58px; }
.scp-terminal-footer-right { right: 72px; bottom: 58px; }
.scp-terminal-side-left { left: 72px; top: 34%; max-width: 330px; opacity: 0.42; }
.scp-terminal-side-right { right: 90px; top: 34%; text-align: left; max-width: 280px; opacity: 0.35; }
.scp-dim { opacity: 0.72; }

.scp-mini-bars {
  display: inline-flex;
  gap: 5px;
  margin-top: 14px;
}

.scp-mini-bars span {
  display: block;
  width: 6px;
  height: 16px;
  background: rgba(255,255,255,0.35);
}

.scp-terminal-stage {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-content: center;
  padding: clamp(24px, 4vw, 70px);
}

.scp-terminal-brand {
  width: min(1120px, 88vw);
  display: grid;
  grid-template-columns: minmax(220px, 370px) minmax(320px, 1fr);
  align-items: center;
  gap: clamp(28px, 6vw, 80px);
  transform: translateY(-5vh);
}

.scp-emblem-hud {
  position: relative;
  width: min(340px, 30vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.scp-hud-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  opacity: 0.38;
  pointer-events: none;
}

.ring-one {
  border: 1px solid rgba(255,255,255,0.32);
  animation: scpRingRotate 12s linear infinite;
}

.ring-two {
  inset: 9%;
  border: 1px dashed rgba(255,255,255,0.26);
  animation: scpRingRotateReverse 9s linear infinite;
}

.ring-three {
  inset: -9%;
  border: 1px solid rgba(255,255,255,0.12);
  border-left-color: rgba(255,255,255,0.36);
  border-right-color: rgba(255,255,255,0.02);
  animation: scpRingRotate 16s linear infinite;
}

.scp-loading-logo {
  width: 78%;
  height: 78%;
  display: grid;
  place-items: center;
  color: #ffffff;
  filter:
    drop-shadow(0 0 8px rgba(255,255,255,0.72))
    drop-shadow(0 0 22px rgba(255,255,255,0.34));
  animation: scpLogoPulse 5s linear both;
}

.scp-terminal-emblem {
  width: 100%;
  height: 100%;
  display: block;
}

.scp-brand-text {
  min-width: 0;
  text-shadow:
    0 0 8px rgba(255,255,255,0.42),
    0 0 32px rgba(255,255,255,0.20);
  animation: scpTextGlitch 5s linear both;
}

.scp-loading-title {
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: clamp(42px, 7vw, 88px);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 0.98;
  color: #ffffff;
  text-transform: none;
  white-space: nowrap;
}

.scp-loading-subtitle {
  margin-top: 12px;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: clamp(22px, 3.1vw, 44px);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: rgba(255,255,255,0.92);
  text-transform: none;
}

.scp-terminal-loading {
  width: min(900px, 72vw);
  margin: clamp(18px, 2vw, 30px) auto 0;
  transform: translateY(-2vh);
}

.scp-loading-label {
  color: rgba(255,255,255,0.86);
  font-size: clamp(16px, 1.6vw, 22px);
  letter-spacing: 0.46em;
  margin-bottom: 10px;
}

.terminal-bar {
  position: relative;
  width: 100%;
  height: 42px;
  border: 2px solid rgba(255,255,255,0.86);
  background: rgba(0,0,0,0.68);
  box-shadow:
    0 0 10px rgba(255,255,255,0.22),
    inset 0 0 18px rgba(255,255,255,0.06);
  overflow: hidden;
  border-radius: 2px;
}

.terminal-bar::before {
  content: "";
  position: absolute;
  inset: 7px 70px 7px 9px;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255,255,255,0.95) 0 8px,
      transparent 8px 13px
    );
  transform-origin: left center;
  transform: scaleX(0);
  animation: scpSegmentFill 5s linear forwards;
  filter: drop-shadow(0 0 4px rgba(255,255,255,0.42));
}

.terminal-bar span {
  display: none !important;
}

.scp-progress-percent {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  font-size: clamp(16px, 1.3vw, 20px);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.scp-auth-loading.active .scp-progress-percent::before {
  content: "0%";
  animation: scpPercentText 5s steps(20, end) forwards;
}

.scp-progress-percent {
  font-size: 0;
}

.scp-loading-lines {
  margin-top: 18px;
  display: grid;
  gap: 9px;
  font-size: clamp(17px, 1.7vw, 23px);
  letter-spacing: 0.06em;
  font-weight: 700;
  text-shadow: 0 0 14px currentColor;
}

.scp-auth-line {
  opacity: 0.35;
  filter: saturate(0.7);
}

.scp-auth-loading.active .auth-check {
  color: #fb923c;
  animation: scpStatusOne 5s linear both;
}

.scp-auth-loading.active .clearance-load {
  color: #fb923c;
  animation: scpStatusTwo 5s linear both;
}

.scp-auth-loading.active .access-granted {
  color: #67ff3f;
  animation: scpStatusThree 5s linear both;
}

@keyframes scpSegmentFill {
  0% { transform: scaleX(0); }
  100% { transform: scaleX(1); }
}

@keyframes scpPercentText {
  0% { content: "0%"; }
  10% { content: "12%"; }
  20% { content: "24%"; }
  30% { content: "37%"; }
  40% { content: "48%"; }
  50% { content: "59%"; }
  60% { content: "71%"; }
  70% { content: "82%"; }
  80% { content: "91%"; }
  90% { content: "96%"; }
  100% { content: "100%"; }
}

@keyframes scpStatusOne {
  0%, 8% { opacity: 0.15; transform: translateX(-12px); }
  18%, 100% { opacity: 1; transform: translateX(0); }
}

@keyframes scpStatusTwo {
  0%, 24% { opacity: 0.12; transform: translateX(-12px); }
  34%, 100% { opacity: 1; transform: translateX(0); }
}

@keyframes scpStatusThree {
  0%, 62% { opacity: 0.1; transform: translateX(-12px); }
  72%, 100% { opacity: 1; transform: translateX(0); }
}

@keyframes scpRingRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes scpRingRotateReverse {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

@keyframes scpLogoPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  7% { opacity: 0.86; transform: scale(1.01); }
  8% { opacity: 1; }
  44% { opacity: 0.92; }
  45% { opacity: 1; }
  68% { opacity: 0.84; transform: scale(1.015); }
  69% { opacity: 1; transform: scale(1); }
}

@keyframes scpTextGlitch {
  0%, 100% { transform: translate(0); opacity: 1; }
  12% { transform: translate(1px, 0); opacity: 0.88; }
  13% { transform: translate(0); opacity: 1; }
  31% { transform: translate(-1px, 1px); opacity: 0.92; }
  32% { transform: translate(0); opacity: 1; }
  79% { transform: translate(2px, 0); opacity: 0.86; }
  80% { transform: translate(0); opacity: 1; }
}

@keyframes scpTerminalFlicker {
  0%, 100% { filter: brightness(1); }
  5% { filter: brightness(1.18) contrast(1.04); }
  6% { filter: brightness(0.88); }
  7% { filter: brightness(1); }
  29% { filter: brightness(1.12); }
  30% { filter: brightness(0.92); }
  31% { filter: brightness(1); }
  65% { filter: brightness(1.16) contrast(1.06); }
  66% { filter: brightness(0.9); }
  67% { filter: brightness(1); }
}

@keyframes scpTerminalScanlines {
  from { transform: translateY(0); }
  to { transform: translateY(10px); }
}

@media (max-width: 900px) {
  .scp-terminal-top-left,
  .scp-terminal-top-right,
  .scp-terminal-side-left,
  .scp-terminal-side-right,
  .scp-terminal-footer-left,
  .scp-terminal-footer-right {
    display: none;
  }

  .scp-terminal-stage {
    padding: 22px;
  }

  .scp-terminal-brand {
    width: 92vw;
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 22px;
    transform: translateY(-4vh);
  }

  .scp-emblem-hud {
    width: min(260px, 62vw);
  }

  .scp-loading-title {
    font-size: clamp(34px, 11vw, 58px);
    white-space: normal;
  }

  .scp-loading-subtitle {
    font-size: clamp(20px, 7vw, 34px);
  }

  .scp-terminal-loading {
    width: 90vw;
    transform: translateY(0);
  }

  .scp-loading-lines {
    font-size: 15px;
  }
}



/* SCP Terminal Login Design - final replacement */
.scp-login-loader {
  display: none !important;
}

.scp-auth-loading {
  position: fixed !important;
  inset: 0 !important;
  z-index: 999999 !important;
  display: block;
  color: #f8fafc;
  background:
    radial-gradient(circle at 30% 34%, rgba(255,255,255,0.08), transparent 22%),
    radial-gradient(circle at 72% 38%, rgba(56,189,248,0.045), transparent 28%),
    linear-gradient(180deg, rgba(0,0,0,0.985), rgba(0,0,0,1));
  overflow: hidden;
  font-family: Consolas, "Courier New", monospace;
  isolation: isolate;
}

.scp-auth-loading.hidden {
  display: none !important;
}

body.scp-auth-locked {
  overflow: hidden !important;
}

.scp-auth-loading::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 42px 42px;
  opacity: 0.34;
  z-index: -3;
}

.scp-auth-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255,255,255,0.045) 0,
      rgba(255,255,255,0.045) 1px,
      transparent 1px,
      transparent 5px
    ),
    radial-gradient(circle at center, transparent 0%, rgba(0,0,0,0.52) 78%);
  opacity: 0.22;
  pointer-events: none;
  animation: scpTerminalScanlines 0.9s linear infinite;
  z-index: 15;
}

.scp-auth-loading.active {
  animation: scpTerminalFlicker 5s linear both;
}

.scp-corner {
  position: absolute;
  width: 46px;
  height: 46px;
  border-color: rgba(255,255,255,0.55);
  opacity: 0.72;
}

.scp-corner-tl { top: 34px; left: 34px; border-top: 2px solid; border-left: 2px solid; }
.scp-corner-tr { top: 34px; right: 34px; border-top: 2px solid; border-right: 2px solid; }
.scp-corner-bl { bottom: 34px; left: 34px; border-bottom: 2px solid; border-left: 2px solid; }
.scp-corner-br { bottom: 34px; right: 34px; border-bottom: 2px solid; border-right: 2px solid; }

.scp-terminal-top-left,
.scp-terminal-top-right,
.scp-terminal-footer-left,
.scp-terminal-footer-right,
.scp-terminal-side-left,
.scp-terminal-side-right {
  position: absolute;
  color: rgba(226,232,240,0.58);
  font-size: clamp(10px, 1vw, 14px);
  letter-spacing: 0.06em;
  line-height: 1.55;
  text-transform: uppercase;
  z-index: 2;
  text-shadow: 0 0 10px rgba(255,255,255,0.12);
}

.scp-terminal-top-left { top: 60px; left: 72px; }
.scp-terminal-top-right { top: 60px; right: 72px; text-align: right; }
.scp-terminal-footer-left { left: 72px; bottom: 58px; }
.scp-terminal-footer-right { right: 72px; bottom: 58px; }
.scp-terminal-side-left { left: 72px; top: 34%; max-width: 330px; opacity: 0.42; }
.scp-terminal-side-right { right: 90px; top: 34%; text-align: left; max-width: 280px; opacity: 0.35; }
.scp-dim { opacity: 0.72; }

.scp-mini-bars {
  display: inline-flex;
  gap: 5px;
  margin-top: 14px;
}

.scp-mini-bars span {
  display: block;
  width: 6px;
  height: 16px;
  background: rgba(255,255,255,0.35);
}

.scp-terminal-stage {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-content: center;
  padding: clamp(24px, 4vw, 70px);
}

.scp-terminal-brand {
  width: min(1120px, 88vw);
  display: grid;
  grid-template-columns: minmax(220px, 370px) minmax(320px, 1fr);
  align-items: center;
  gap: clamp(28px, 6vw, 80px);
  transform: translateY(-5vh);
}

.scp-emblem-hud {
  position: relative;
  width: min(340px, 30vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.scp-hud-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  opacity: 0.38;
  pointer-events: none;
}

.ring-one {
  border: 1px solid rgba(255,255,255,0.32);
  animation: scpRingRotate 12s linear infinite;
}

.ring-two {
  inset: 9%;
  border: 1px dashed rgba(255,255,255,0.26);
  animation: scpRingRotateReverse 9s linear infinite;
}

.ring-three {
  inset: -9%;
  border: 1px solid rgba(255,255,255,0.12);
  border-left-color: rgba(255,255,255,0.36);
  border-right-color: rgba(255,255,255,0.02);
  animation: scpRingRotate 16s linear infinite;
}

.scp-loading-logo {
  width: 78%;
  height: 78%;
  display: grid;
  place-items: center;
  color: #ffffff;
  filter:
    drop-shadow(0 0 8px rgba(255,255,255,0.72))
    drop-shadow(0 0 22px rgba(255,255,255,0.34));
  animation: scpLogoPulse 5s linear both;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.scp-terminal-emblem {
  width: 100%;
  height: 100%;
  display: block;
}

.scp-brand-text {
  min-width: 0;
  text-shadow:
    0 0 8px rgba(255,255,255,0.42),
    0 0 32px rgba(255,255,255,0.20);
  animation: scpTextGlitch 5s linear both;
}

.scp-loading-title {
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: clamp(42px, 7vw, 88px);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 0.98;
  color: #ffffff;
  text-transform: none;
  white-space: nowrap;
}

.scp-loading-subtitle {
  margin-top: 12px;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: clamp(22px, 3.1vw, 44px);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: rgba(255,255,255,0.92);
  text-transform: none;
}

.scp-terminal-loading {
  width: min(900px, 72vw);
  margin: clamp(18px, 2vw, 30px) auto 0;
  transform: translateY(-2vh);
}

.scp-loading-label {
  color: rgba(255,255,255,0.86);
  font-size: clamp(16px, 1.6vw, 22px);
  letter-spacing: 0.46em;
  margin-bottom: 10px;
}

.terminal-bar {
  position: relative;
  width: 100%;
  height: 42px;
  border: 2px solid rgba(255,255,255,0.86);
  background: rgba(0,0,0,0.68);
  box-shadow:
    0 0 10px rgba(255,255,255,0.22),
    inset 0 0 18px rgba(255,255,255,0.06);
  overflow: hidden;
  border-radius: 2px;
}

.terminal-bar::before {
  content: "";
  position: absolute;
  inset: 7px 70px 7px 9px;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255,255,255,0.95) 0 8px,
      transparent 8px 13px
    );
  transform-origin: left center;
  transform: scaleX(0);
  animation: scpSegmentFill 5s linear forwards;
  filter: drop-shadow(0 0 4px rgba(255,255,255,0.42));
}

.terminal-bar span {
  display: none !important;
}

.scp-progress-percent {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  font-size: 0;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.scp-auth-loading.active .scp-progress-percent::before {
  content: "0%";
  font-size: clamp(16px, 1.3vw, 20px);
  animation: scpPercentText 5s steps(20, end) forwards;
}

.scp-loading-lines {
  margin-top: 18px;
  display: grid;
  gap: 9px;
  font-size: clamp(17px, 1.7vw, 23px);
  letter-spacing: 0.06em;
  font-weight: 700;
  text-shadow: 0 0 14px currentColor;
}

.scp-auth-line {
  opacity: 0.35;
  filter: saturate(0.7);
}

.scp-auth-loading.active .auth-check {
  color: #fb923c;
  animation: scpStatusOne 5s linear both;
}

.scp-auth-loading.active .clearance-load {
  color: #fb923c;
  animation: scpStatusTwo 5s linear both;
}

.scp-auth-loading.active .access-granted {
  color: #67ff3f;
  animation: scpStatusThree 5s linear both;
}

@keyframes scpSegmentFill {
  0% { transform: scaleX(0); }
  100% { transform: scaleX(1); }
}

@keyframes scpPercentText {
  0% { content: "0%"; }
  10% { content: "12%"; }
  20% { content: "24%"; }
  30% { content: "37%"; }
  40% { content: "48%"; }
  50% { content: "59%"; }
  60% { content: "71%"; }
  70% { content: "82%"; }
  80% { content: "91%"; }
  90% { content: "96%"; }
  100% { content: "100%"; }
}

@keyframes scpStatusOne {
  0%, 8% { opacity: 0.15; transform: translateX(-12px); }
  18%, 100% { opacity: 1; transform: translateX(0); }
}

@keyframes scpStatusTwo {
  0%, 24% { opacity: 0.12; transform: translateX(-12px); }
  34%, 100% { opacity: 1; transform: translateX(0); }
}

@keyframes scpStatusThree {
  0%, 62% { opacity: 0.1; transform: translateX(-12px); }
  72%, 100% { opacity: 1; transform: translateX(0); }
}

@keyframes scpRingRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes scpRingRotateReverse {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

@keyframes scpLogoPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  7% { opacity: 0.86; transform: scale(1.01); }
  8% { opacity: 1; }
  44% { opacity: 0.92; }
  45% { opacity: 1; }
  68% { opacity: 0.84; transform: scale(1.015); }
  69% { opacity: 1; transform: scale(1); }
}

@keyframes scpTextGlitch {
  0%, 100% { transform: translate(0); opacity: 1; }
  12% { transform: translate(1px, 0); opacity: 0.88; }
  13% { transform: translate(0); opacity: 1; }
  31% { transform: translate(-1px, 1px); opacity: 0.92; }
  32% { transform: translate(0); opacity: 1; }
  79% { transform: translate(2px, 0); opacity: 0.86; }
  80% { transform: translate(0); opacity: 1; }
}

@keyframes scpTerminalFlicker {
  0%, 100% { filter: brightness(1); }
  5% { filter: brightness(1.18) contrast(1.04); }
  6% { filter: brightness(0.88); }
  7% { filter: brightness(1); }
  29% { filter: brightness(1.12); }
  30% { filter: brightness(0.92); }
  31% { filter: brightness(1); }
  65% { filter: brightness(1.16) contrast(1.06); }
  66% { filter: brightness(0.9); }
  67% { filter: brightness(1); }
}

@keyframes scpTerminalScanlines {
  from { transform: translateY(0); }
  to { transform: translateY(10px); }
}

@media (max-width: 900px) {
  .scp-terminal-top-left,
  .scp-terminal-top-right,
  .scp-terminal-side-left,
  .scp-terminal-side-right,
  .scp-terminal-footer-left,
  .scp-terminal-footer-right {
    display: none;
  }

  .scp-terminal-stage {
    padding: 22px;
  }

  .scp-terminal-brand {
    width: 92vw;
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 22px;
    transform: translateY(-4vh);
  }

  .scp-emblem-hud {
    width: min(260px, 62vw);
  }

  .scp-loading-title {
    font-size: clamp(34px, 11vw, 58px);
    white-space: normal;
  }

  .scp-loading-subtitle {
    font-size: clamp(20px, 7vw, 34px);
  }

  .scp-terminal-loading {
    width: 90vw;
    transform: translateY(0);
  }

  .scp-loading-lines {
    font-size: 15px;
  }
}

/* ===== SCP TERMINAL FULL-SITE THEME OVERRIDE ===== */
:root {
  --bg: #050607;
  --sidebar: rgba(4, 5, 7, 0.96);
  --panel: rgba(7, 8, 11, 0.92);
  --panel-2: rgba(11, 12, 16, 0.94);
  --text: #f5f7fb;
  --muted: #a9afb8;
  --line: rgba(255, 255, 255, 0.16);
  --blue: #ffffff;
  --green: #77ff4d;
  --red: #ff5d5d;
  --yellow: #ff9b2f;
  --shadow: 0 0 0 1px rgba(255,255,255,0.06), 0 18px 50px rgba(0,0,0,0.6);
}

html {
  background: #000;
}

body {
  position: relative;
  background:
    radial-gradient(circle at 34% 28%, rgba(255,255,255,0.04), transparent 18%),
    radial-gradient(circle at 72% 34%, rgba(255,255,255,0.03), transparent 22%),
    linear-gradient(180deg, #020304 0%, #050608 52%, #020304 100%) !important;
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255,255,255,0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.028) 1px, transparent 1px);
  background-size: 44px 44px;
  opacity: 0.32;
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.03) 0,
    rgba(255,255,255,0.03) 1px,
    transparent 1px,
    transparent 4px
  );
  opacity: 0.13;
  mix-blend-mode: screen;
  z-index: 0;
}

.app-shell,
.sidebar,
.main,
.topbar,
.view,
.hero-panel,
.panel,
.card-item,
.stat-card,
.notice,
.modal-card,
.large-modal,
.login-box,
.sidebar-card,
.access-card,
.patient-folder,
.record-folder-content,
.record-folder-header,
.finding-item,
.complaint-message,
.message-body,
.participant-box,
.tag-picker,
.recipient-picker,
.recipient-results,
.complaint-lookup-panel,
.danger-panel,
.findings-box,
.master-data-grid,
.data-grid,
.green-card,
.orange-card,
.pink-card,
.purple-card {
  position: relative;
  z-index: 1;
}

.sidebar {
  background:
    linear-gradient(180deg, rgba(0,0,0,0.95), rgba(6,8,10,0.96)) !important;
  border-right: 1px solid rgba(255,255,255,0.12) !important;
  box-shadow: inset -1px 0 0 rgba(255,255,255,0.05);
}

.brand {
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.09);
}

.brand-mark {
  border-radius: 10px;
  background: rgba(255,255,255,0.04) !important;
  border: 1px solid rgba(255,255,255,0.14) !important;
  box-shadow: 0 0 18px rgba(255,255,255,0.08) !important;
}

.brand h1,
.topbar h2,
.hero-panel h3,
.panel h3,
.notice h3,
.modal-header h3,
.stat-card strong,
.card-item h3 {
  font-family: "Segoe UI", Arial, sans-serif;
  letter-spacing: 0.01em;
}

.eyebrow,
.small-title,
.classified,
.form-section-title,
.section-intro p:first-child,
.panel-header .small-title {
  color: #d5d9df !important;
  font-family: Consolas, "Courier New", monospace;
  letter-spacing: 0.18em;
}

.brand h1,
.topbar h2 {
  text-transform: uppercase;
}

.login-box,
.sidebar-card,
.hero-panel,
.panel,
.card-item,
.stat-card,
.notice,
.modal-card,
.large-modal,
.access-card,
.patient-folder,
.record-folder-content,
.finding-item,
.complaint-message,
.message-body,
.participant-box,
.recipient-results,
.complaint-lookup-panel,
.danger-panel,
.findings-box {
  background:
    linear-gradient(180deg, rgba(5,6,8,0.96), rgba(9,11,14,0.94)) !important;
  border: 1px solid rgba(255,255,255,0.14) !important;
  border-radius: 10px !important;
  box-shadow: var(--shadow) !important;
}

.hero-panel::before,
.panel::before,
.card-item::before,
.stat-card::before,
.notice::before,
.modal-card::before,
.access-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03), inset 0 0 24px rgba(255,255,255,0.015);
}

.nav-item,
.quick-actions button,
.tab-btn,
.folder-toggle,
.primary-btn,
.ghost-btn,
.danger-btn,
.text-btn,
.icon-btn,
.access-choice-grid button,
#guestAccessForm button,
button.primary,
button.secondary {
  border-radius: 4px !important;
  font-family: Consolas, "Courier New", monospace;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: 0.18s ease;
}

.nav-item,
.quick-actions button,
.tab-btn,
.folder-toggle,
.ghost-btn,
.icon-btn,
.access-choice-grid button,
button.secondary {
  background: rgba(255,255,255,0.025) !important;
  color: var(--text) !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
}

.nav-item:hover,
.nav-item.active,
.quick-actions button:hover,
.tab-btn.active,
.folder-toggle:hover,
.folder-toggle.active,
.ghost-btn:hover,
.icon-btn:hover,
.access-choice-grid button:hover,
button.secondary:hover {
  background: rgba(255,255,255,0.09) !important;
  border-color: rgba(255,255,255,0.28) !important;
  box-shadow: 0 0 18px rgba(255,255,255,0.06);
}

.primary-btn,
#guestAccessForm button,
button.primary {
  background: #f3f6fb !important;
  color: #060709 !important;
  border: 1px solid rgba(255,255,255,0.85) !important;
  box-shadow: 0 0 18px rgba(255,255,255,0.08);
}

.primary-btn:hover,
#guestAccessForm button:hover,
button.primary:hover {
  background: #ffffff !important;
}

.danger-btn {
  background: rgba(255,93,93,0.16) !important;
  color: #ffd9d9 !important;
  border: 1px solid rgba(255,93,93,0.28) !important;
}

.text-btn {
  background: transparent !important;
  color: #f0f2f6 !important;
  border: 0 !important;
}

input,
select,
textarea,
.signup-form input,
.message-form input,
.message-form textarea,
.message-form select,
.form-grid input,
.form-grid textarea,
.form-grid select,
.inline-form input,
.inline-form textarea,
.inline-form select {
  background: rgba(255,255,255,0.035) !important;
  color: var(--text) !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  border-radius: 4px !important;
  box-shadow: none !important;
}

input::placeholder,
textarea::placeholder {
  color: #8f98a3 !important;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(255,155,47,0.88) !important;
  box-shadow: 0 0 0 1px rgba(255,155,47,0.45), 0 0 18px rgba(255,155,47,0.14) !important;
}

.status-pill,
.badge,
.tag {
  border-radius: 4px !important;
  font-family: Consolas, "Courier New", monospace;
  font-weight: 700;
}

.status-pill {
  color: #ffd8bd !important;
  background: rgba(255,155,47,0.10) !important;
  border: 1px solid rgba(255,155,47,0.26) !important;
}

.status-pill.on,
.green,
.ok {
  color: #bfffb0 !important;
  background: rgba(119,255,77,0.10) !important;
  border-color: rgba(119,255,77,0.30) !important;
}

.orange,
.yellow {
  color: #ffd0a0 !important;
}

.red,
.error {
  color: #ffb3b3 !important;
}

.stat-card {
  min-height: 150px;
}

.stat-card > div:first-child,
.stat-card strong,
.stats-grid .stat-card .value {
  color: #ffffff !important;
  text-shadow: 0 0 14px rgba(255,255,255,0.1);
}

.modal {
  background: rgba(0,0,0,0.72) !important;
  backdrop-filter: blur(4px);
}

.modal-card,
.large-modal {
  max-width: min(1100px, 95vw);
}

.access-gate {
  background:
    radial-gradient(circle at center, rgba(255,255,255,0.03), transparent 28%),
    rgba(0,0,0,0.90) !important;
  backdrop-filter: blur(5px);
}

.access-card {
  max-width: 920px;
}

.access-terminal-header span,
.access-footnote,
.card-meta,
.login-box p,
.sidebar-card p,
.notice p,
.panel p,
.section-intro p,
.empty-state,
.modal-help,
.modal-note {
  color: var(--muted) !important;
}

.guide-embed {
  background: rgba(255,255,255,0.03) !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  border-radius: 8px !important;
}

.complaint-chat,
.complaint-messages,
.cards-list,
.mini-list,
.participant-list {
  gap: 12px;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.04);
}

::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.18);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.28);
}

@media (max-width: 900px) {
  .hero-panel,
  .content-grid,
  .master-data-grid,
  .data-grid,
  .stats-grid {
    gap: 14px !important;
  }

  .topbar {
    padding-top: 10px;
  }
}


/* ===== SCP TERMINAL LOGOUT ANIMATION ===== */
.scp-auth-loading.logout-mode {
  background:
    radial-gradient(circle at 30% 34%, rgba(255,155,47,0.065), transparent 22%),
    radial-gradient(circle at 72% 38%, rgba(255,93,93,0.04), transparent 28%),
    linear-gradient(180deg, rgba(0,0,0,0.99), rgba(0,0,0,1)) !important;
}

.scp-auth-loading.logout-mode .scp-loading-label {
  color: rgba(255, 200, 150, 0.92) !important;
}

.scp-auth-loading.logout-mode .terminal-bar {
  border-color: rgba(255,155,47,0.88) !important;
  box-shadow:
    0 0 12px rgba(255,155,47,0.22),
    inset 0 0 18px rgba(255,155,47,0.06) !important;
}

.scp-auth-loading.logout-mode .terminal-bar::before {
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255,155,47,0.95) 0 8px,
      transparent 8px 13px
    ) !important;
  filter: drop-shadow(0 0 5px rgba(255,155,47,0.45)) !important;
}

.scp-auth-loading.logout-mode .auth-check {
  color: #fb923c !important;
}

.scp-auth-loading.logout-mode .clearance-load {
  color: #fb923c !important;
}

.scp-auth-loading.logout-mode .access-granted {
  color: #77ff4d !important;
}

.scp-auth-loading.logout-mode .scp-loading-logo {
  filter:
    drop-shadow(0 0 8px rgba(255,155,47,0.5))
    drop-shadow(0 0 24px rgba(255,255,255,0.16)) !important;
}


/* ===== ACCESS WINDOW DESIGN REWORK ===== */
.access-gate {
  display: grid !important;
  place-items: center !important;
  padding: clamp(18px, 4vw, 48px) !important;
  background:
    radial-gradient(circle at 50% 35%, rgba(255,255,255,0.045), transparent 30%),
    radial-gradient(circle at 18% 70%, rgba(255,155,47,0.035), transparent 24%),
    rgba(0,0,0,0.88) !important;
  backdrop-filter: blur(8px) brightness(0.72) !important;
}

.access-card {
  width: min(920px, 94vw) !important;
  max-height: min(88vh, 820px) !important;
  overflow: auto !important;
  padding: clamp(26px, 3.5vw, 44px) !important;
  border-radius: 14px !important;
  background:
    linear-gradient(180deg, rgba(8,9,11,0.97), rgba(2,3,4,0.98)) !important;
  border: 1px solid rgba(255,255,255,0.18) !important;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.045),
    0 0 45px rgba(255,255,255,0.06),
    0 28px 90px rgba(0,0,0,0.78) !important;
}

.access-card::after {
  content: "";
  position: absolute;
  inset: 18px;
  pointer-events: none;
  border: 1px solid rgba(255,255,255,0.055);
  border-radius: 10px;
}

.access-terminal-header {
  display: grid !important;
  grid-template-columns: 104px 1fr !important;
  gap: 24px !important;
  align-items: center !important;
  margin-bottom: 26px !important;
  padding-bottom: 22px !important;
  border-bottom: 1px solid rgba(255,255,255,0.10) !important;
}

.access-scp-mark {
  width: 92px !important;
  height: 92px !important;
  border-radius: 50% !important;
  display: grid !important;
  place-items: center !important;
  color: #ffffff !important;
  background: radial-gradient(circle, rgba(255,255,255,0.06), rgba(255,255,255,0.015)) !important;
  border: 1px solid rgba(255,255,255,0.42) !important;
  box-shadow:
    0 0 0 8px rgba(255,255,255,0.025),
    0 0 28px rgba(255,255,255,0.10) !important;
  font-family: Consolas, "Courier New", monospace !important;
  font-size: 22px !important;
  font-weight: 900 !important;
  letter-spacing: 0.12em !important;
}

.access-terminal-header span {
  display: block !important;
  margin-bottom: 8px !important;
  color: rgba(255,255,255,0.62) !important;
  font-family: Consolas, "Courier New", monospace !important;
  font-size: 13px !important;
  font-weight: 900 !important;
  letter-spacing: 0.34em !important;
  text-transform: uppercase !important;
}

.access-terminal-header h2 {
  margin: 0 !important;
  color: #ffffff !important;
  font-size: clamp(38px, 5.5vw, 64px) !important;
  line-height: 0.94 !important;
  letter-spacing: -0.055em !important;
  text-transform: uppercase !important;
  text-shadow: 0 0 18px rgba(255,255,255,0.10) !important;
}

.access-text {
  width: min(760px, 100%) !important;
  margin: 0 0 24px !important;
  color: rgba(245,247,251,0.82) !important;
  font-size: 16px !important;
  line-height: 1.65 !important;
  border-left: 3px solid rgba(255,155,47,0.72) !important;
  padding: 10px 0 10px 18px !important;
  background: linear-gradient(90deg, rgba(255,155,47,0.055), transparent) !important;
}

.access-guest-form {
  position: relative !important;
  padding: 22px !important;
  margin: 0 0 20px !important;
  border-radius: 10px !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.018)) !important;
  border: 1px solid rgba(255,255,255,0.14) !important;
}

.access-guest-form h3 {
  margin: 0 0 18px !important;
  color: #ffffff !important;
  font-size: 20px !important;
  letter-spacing: 0.02em !important;
}

.access-guest-form label {
  color: rgba(255,255,255,0.68) !important;
  font-family: Consolas, "Courier New", monospace !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  letter-spacing: 0.04em !important;
}

.access-guest-form .form-grid {
  gap: 14px !important;
}

.access-guest-form input {
  height: 54px !important;
  margin-top: 8px !important;
  padding: 0 16px !important;
  background: rgba(0,0,0,0.34) !important;
  border-color: rgba(255,255,255,0.15) !important;
  color: #ffffff !important;
  font-size: 15px !important;
}

.access-guest-form button {
  width: 100% !important;
  height: 48px !important;
  margin-top: 18px !important;
  background: rgba(255,255,255,0.92) !important;
  color: #050607 !important;
  border: 1px solid rgba(255,255,255,0.86) !important;
  border-radius: 4px !important;
  font-family: Consolas, "Courier New", monospace !important;
  font-size: 14px !important;
  font-weight: 900 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
}

.access-guest-form button:hover {
  background: #ffffff !important;
  box-shadow: 0 0 24px rgba(255,255,255,0.12) !important;
}

.access-choice-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 14px !important;
  margin-top: 14px !important;
}

.access-choice-grid button {
  position: relative !important;
  min-height: 60px !important;
  padding: 14px 18px !important;
  border-radius: 6px !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.038), rgba(255,255,255,0.016)) !important;
  border: 1px solid rgba(255,255,255,0.16) !important;
  color: rgba(255,255,255,0.88) !important;
  font-family: Consolas, "Courier New", monospace !important;
  font-size: 15px !important;
  font-weight: 900 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
}

.access-choice-grid button::before {
  content: "> ";
  color: #ff9b2f;
}

.access-choice-grid button:hover {
  color: #ffffff !important;
  border-color: rgba(255,155,47,0.55) !important;
  background:
    linear-gradient(180deg, rgba(255,155,47,0.10), rgba(255,255,255,0.025)) !important;
  box-shadow: 0 0 24px rgba(255,155,47,0.08) !important;
}

.access-footnote {
  margin: 18px 0 0 !important;
  padding-top: 18px !important;
  border-top: 1px solid rgba(255,255,255,0.08) !important;
  color: rgba(245,247,251,0.56) !important;
  font-size: 14px !important;
  line-height: 1.55 !important;
}

.access-footnote::before {
  content: "LOG: ";
  color: #ff9b2f;
  font-family: Consolas, "Courier New", monospace;
  font-weight: 900;
}

@media (max-width: 720px) {
  .access-card {
    padding: 22px !important;
  }

  .access-terminal-header {
    grid-template-columns: 1fr !important;
    justify-items: center !important;
    text-align: center !important;
    gap: 14px !important;
  }

  .access-scp-mark {
    width: 78px !important;
    height: 78px !important;
    font-size: 18px !important;
  }

  .access-terminal-header h2 {
    font-size: clamp(32px, 12vw, 48px) !important;
  }

  .access-choice-grid {
    grid-template-columns: 1fr !important;
  }

  .access-text {
    font-size: 14px !important;
  }
}


/* ===== CRITICAL ACCESS GATE DISPLAY FIX ===== */
/* Muss nach .access-gate { display:grid !important; } stehen. */
#accessGate.hidden,
.access-gate.hidden {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

#accessGate:not(.hidden) {
  display: grid !important;
  visibility: visible !important;
  pointer-events: auto !important;
}


/* ===== MEDICAL HEADER LOGO REPLACEMENT ===== */
.brand-mark.medical-hud-logo {
  width: 82px !important;
  height: 82px !important;
  padding: 4px !important;
  border-radius: 18px !important;
  background:
    radial-gradient(circle at 50% 45%, rgba(255,255,255,0.12), rgba(0,0,0,0.92) 72%),
    linear-gradient(135deg, rgba(255,255,255,0.14), rgba(10,10,10,0.96)) !important;
  border: 1px solid rgba(255,255,255,0.22) !important;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.10),
    0 0 24px rgba(255,255,255,0.10),
    inset 0 0 20px rgba(255,255,255,0.035) !important;
  overflow: hidden !important;
  display: grid !important;
  place-items: center !important;
  flex-shrink: 0 !important;
}

.brand-mark.medical-hud-logo img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  border-radius: 14px !important;
  display: block !important;
  filter:
    contrast(1.08)
    brightness(1.08)
    drop-shadow(0 0 6px rgba(255,255,255,0.18));
}


/* ===== MEDICAL RANK SYSTEM ===== */
.rank-badge {
  border-color: rgba(255,255,255,0.34) !important;
  background: rgba(255,255,255,0.08) !important;
}

.rank-log-box {
  margin-top: 14px;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.24);
}

.rank-log-title {
  margin-bottom: 10px;
  font-family: Consolas, "Courier New", monospace;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.82);
}

.rank-log-list {
  display: grid;
  gap: 10px;
}

.rank-log-entry {
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.035);
}

.rank-log-entry small,
.rank-log-loading,
.rank-log-empty {
  color: rgba(245,247,251,0.68);
}

.item-actions button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}


/* ===== DEPARTMENT HEADER LOGO: medical-hud-logo ===== */
.logo.medical-hud-logo,
.brand-mark.medical-hud-logo {
  width: 96px !important;
  height: 96px !important;
  min-width: 96px !important;
  padding: 5px !important;
  border-radius: 20px !important;
  background:
    radial-gradient(circle at 50% 45%, rgba(255,255,255,0.13), rgba(0,0,0,0.90) 72%),
    linear-gradient(135deg, rgba(255,255,255,0.16), rgba(10,10,10,0.96)) !important;
  border: 1px solid rgba(255,255,255,0.22) !important;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.10),
    0 0 24px rgba(255,255,255,0.10),
    inset 0 0 20px rgba(255,255,255,0.035) !important;
  overflow: hidden !important;
  display: grid !important;
  place-items: center !important;
  color: transparent !important;
  flex-shrink: 0 !important;
}

.logo.medical-hud-logo img,
.brand-mark.medical-hud-logo img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  border-radius: 16px !important;
  display: block !important;
  filter:
    contrast(1.08)
    brightness(1.08)
    drop-shadow(0 0 6px rgba(255,255,255,0.18));
}


/* ===== POSTFACH ANHÄNGE / ARZTBRIEFE ===== */
.message-attachment-panel {
  margin-top: 14px;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.24);
}

.message-attachment-panel h4 {
  margin: 0 0 12px;
  font-family: Consolas, "Courier New", monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.84);
}

.message-attachment-panel textarea {
  min-height: 130px;
}

.message-attachment-card {
  margin-top: 14px;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.14);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.018));
}

.message-attachment-card h4 {
  margin: 0 0 8px;
  color: #ffffff;
  font-family: Consolas, "Courier New", monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.message-attachment-body {
  margin-top: 10px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.25);
  color: rgba(245,247,251,0.88);
}

.sick-note-button {
  border-color: rgba(255,155,47,0.42) !important;
  color: #ffd0a0 !important;
}


/* ===== KRANKSCHREIBUNGEN / DEPARTMENT-ZUWEISUNG ===== */
.sick-note-button,
.sick-note-assign-button {
  border-color: rgba(255,155,47,0.42) !important;
  color: #ffd0a0 !important;
}

.sick-note-panel {
  margin-top: 14px;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid rgba(255,155,47,0.20);
  background:
    linear-gradient(180deg, rgba(255,155,47,0.060), rgba(255,255,255,0.018));
}

.sick-note-panel-title {
  margin-bottom: 10px;
  font-family: Consolas, "Courier New", monospace;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,220,180,0.92);
}

.sick-note-entry {
  display: grid;
  gap: 8px;
  padding: 12px;
  margin-top: 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.26);
}

.sick-note-entry small,
.sick-note-empty,
.sick-note-loading {
  color: rgba(245,247,251,0.68);
}

.sick-note-body {
  white-space: pre-wrap;
  padding: 10px;
  border-radius: 8px;
  background: rgba(0,0,0,0.26);
  border: 1px solid rgba(255,255,255,0.10);
}

.postfach-sick-note-toolbar {
  margin: 10px 0 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}


/* ===== KRANKSCHREIBUNG ALS BEFUND + POSTFACH-VERSAND ===== */
.sick-note-finding {
  border-color: rgba(255,155,47,0.24) !important;
  background:
    linear-gradient(180deg, rgba(255,155,47,0.060), rgba(255,255,255,0.018)) !important;
}

.sick-note-send-btn {
  border-color: rgba(255,155,47,0.42) !important;
  color: #ffd0a0 !important;
}

.sick-note-template-hint {
  margin: 10px 0 0;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,155,47,0.24);
  background: rgba(255,155,47,0.06);
  color: rgba(255,225,190,0.92);
}


/* ===== V74 EMAIL-DUPLIKATE + KRANKMELDUNG ===== */
.sick-report-finding,
.sick-note-finding {
  border-color: rgba(255,155,47,0.24) !important;
  background:
    linear-gradient(180deg, rgba(255,155,47,0.060), rgba(255,255,255,0.018)) !important;
}

.sick-report-send-btn,
.sick-note-send-btn {
  border-color: rgba(255,155,47,0.42) !important;
  color: #ffd0a0 !important;
}

.sick-report-template-hint {
  margin: 10px 0 0;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,155,47,0.24);
  background: rgba(255,155,47,0.06);
  color: rgba(255,225,190,0.92);
}
