/* Valley CID: neon-blue theme */

:root {
  --bg: #04070f;
  --bg-2: #070d1c;
  --panel: rgba(10, 20, 40, 0.72);
  --panel-solid: #0b1428;
  --line: rgba(64, 160, 255, 0.22);
  --line-strong: rgba(0, 220, 255, 0.55);
  --text: #e6f3ff;
  --muted: #7f97b8;
  --neon: #00e1ff;
  --neon-2: #2f7bff;
  --neon-soft: rgba(0, 225, 255, 0.14);
  --glow: 0 0 6px rgba(0, 225, 255, 0.55), 0 0 22px rgba(0, 160, 255, 0.35);
  --glow-sm: 0 0 4px rgba(0, 225, 255, 0.5), 0 0 12px rgba(0, 160, 255, 0.25);
  --danger: #ff3d71;
  --ok: #19f5aa;
  --warn: #ffb547;
  --radius: 14px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Orbitron", "Inter", system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--font);
  overflow-x: hidden;
}

/* Animated background: drifting neon glows over a slowly scrolling grid */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(600px 400px at 15% 10%, rgba(47, 123, 255, 0.18), transparent 70%),
    radial-gradient(700px 500px at 85% 90%, rgba(0, 225, 255, 0.12), transparent 70%),
    var(--bg);
  animation: glow-drift 18s ease-in-out infinite alternate;
}
.backdrop::before {
  content: "";
  position: absolute;
  inset: -60px;
  background-image:
    linear-gradient(rgba(0, 225, 255, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 225, 255, 0.1) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 80%);
  animation: grid-scroll 20s linear infinite;
}
.backdrop::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 140px;
  background: linear-gradient(transparent, rgba(0, 225, 255, 0.05), transparent);
  animation: scan 9s linear infinite;
}

@keyframes glow-drift {
  from { background-position: 0 0, 0 0, 0 0; filter: hue-rotate(0deg); }
  to { background-position: 80px 40px, -60px -30px, 0 0; filter: hue-rotate(-12deg); }
}
@keyframes grid-scroll { to { transform: translateY(60px); } }
@keyframes scan { from { top: -140px; } to { top: 100%; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { box-shadow: var(--glow-sm); } 50% { box-shadow: var(--glow); } }
@keyframes flicker { 0%, 19%, 21%, 23%, 55%, 57%, 100% { opacity: 1; } 20%, 22%, 56% { opacity: 0.55; } }
@keyframes shine { from { transform: translateX(-120%) skewX(-20deg); } to { transform: translateX(220%) skewX(-20deg); } }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-2px) rotate(-6deg); } }

/* --- Header --- */

header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  background: rgba(4, 8, 18, 0.78);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(0, 225, 255, 0.08), 0 8px 30px rgba(0, 0, 0, 0.35);
}
header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--neon), transparent);
  opacity: 0.7;
}

.brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.brand-mark {
  font-family: var(--display);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 2px;
  padding: 6px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--neon);
  text-shadow: var(--glow-sm);
  box-shadow: inset 0 0 12px var(--neon-soft), var(--glow-sm);
  animation: flicker 7s infinite;
}
.brand-text { display: flex; flex-direction: column; font-weight: 700; line-height: 1.15; }
.brand-text span { font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: 1.5px; text-transform: uppercase; }

nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
nav form { margin: 0; }

.robot {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, rgba(0, 225, 255, 0.25), rgba(4, 8, 18, 0.9) 70%);
  font-size: 20px;
  line-height: 1;
  text-decoration: none;
  animation: pulse 3s ease-in-out infinite;
  transition: transform 0.2s;
}
.robot span { display: inline-block; animation: bob 2.6s ease-in-out infinite; }
.robot:hover { transform: scale(1.1); box-shadow: var(--glow); }

.who { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.who img { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line-strong); }

/* --- Layout --- */

main { max-width: 1040px; margin: 0 auto; padding: 28px 16px 64px; }

main > * { animation: rise 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
main > *:nth-child(2) { animation-delay: 0.06s; }
main > *:nth-child(3) { animation-delay: 0.12s; }
main > *:nth-child(4) { animation-delay: 0.18s; }
main > *:nth-child(5) { animation-delay: 0.24s; }
main > *:nth-child(n+6) { animation-delay: 0.3s; }

a { color: var(--neon); text-decoration: none; }
a:hover { text-shadow: var(--glow-sm); }

h1, h2 { font-family: var(--display); letter-spacing: 0.5px; }
h1 { margin: 0 0 4px; font-size: 26px; }
h2 { margin: 22px 0 10px; font-size: 14px; text-transform: uppercase; letter-spacing: 2px; color: var(--neon); text-shadow: var(--glow-sm); }
.card h2:first-child { margin-top: 0; }

.page-title { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.page-icon { filter: drop-shadow(0 0 8px rgba(0, 225, 255, 0.6)); }

.card {
  position: relative;
  background: var(--panel);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: border-color 0.3s, box-shadow 0.3s;
}
.card::before {
  /* neon corner accents */
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, var(--neon), transparent 30%, transparent 70%, var(--neon-2));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.45;
  pointer-events: none;
  transition: opacity 0.3s;
}
.card:hover { border-color: var(--line-strong); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35), 0 0 24px rgba(0, 160, 255, 0.12); }
.card:hover::before { opacity: 0.9; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 18px; margin-bottom: 18px; }
.grid .card { margin-bottom: 0; }

/* --- Landing --- */

.hero { text-align: center; padding: 72px 16px 40px; }
.eyebrow { margin: 0 0 12px; font-size: 12px; letter-spacing: 4px; text-transform: uppercase; color: var(--muted); }
.glow-title {
  font-size: clamp(40px, 9vw, 76px);
  font-weight: 800;
  margin: 0 0 16px;
  line-height: 1;
}
.glow-title span { color: var(--neon); text-shadow: var(--glow), 0 0 60px rgba(0, 160, 255, 0.5); animation: flicker 6s infinite; }
.lead { max-width: 560px; margin: 0 auto 30px; color: var(--muted); font-size: 16px; }

/* --- Dashboard --- */

.profile-card { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.avatar-lg { width: 84px; height: 84px; border-radius: 50%; border: 2px solid var(--neon); box-shadow: var(--glow); }
.profile-info { flex: 1; min-width: 200px; }
.profile-info p { margin: 0 0 10px; }
.profile-info .profile-roles { margin: 10px 0 0; display: flex; gap: 4px; flex-wrap: wrap; }
.profile-rank { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* --- Chips & badges --- */

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

.chip {
  --role: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 2px 0;
  padding: 3px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  font-size: 13px;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: border-color 0.2s, transform 0.2s;
}
.chip::before { content: ""; flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--role); box-shadow: 0 0 6px var(--role); }
.chip:hover { border-color: var(--line-strong); transform: translateY(-1px); }

.rank-badge {
  position: relative;
  overflow: hidden;
  display: inline-block;
  padding: 4px 14px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--neon-2), var(--neon));
  color: #001521;
  font-family: var(--display);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 1px;
  box-shadow: var(--glow-sm);
}
.rank-badge::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  animation: shine 4s ease-in-out infinite;
}

.level {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.level-member { color: var(--muted); }
.level-supervisor { color: var(--warn); box-shadow: 0 0 10px rgba(255, 181, 71, 0.2); }
.level-command { color: var(--danger); box-shadow: 0 0 10px rgba(255, 61, 113, 0.25); }
.level-super { color: var(--neon); box-shadow: var(--glow-sm); }

.notice { padding: 11px 16px; border-radius: 10px; border: 1px solid; }
.notice.ok { color: var(--ok); border-color: rgba(25, 245, 170, 0.35); background: rgba(25, 245, 170, 0.07); }
.notice.error { color: #ff8fab; border-color: rgba(255, 61, 113, 0.4); background: rgba(255, 61, 113, 0.08); }

/* --- Forms --- */

label { display: block; margin-bottom: 14px; font-weight: 600; font-size: 13px; color: #b9d4f2; }
input, select, textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(2, 6, 16, 0.75);
  color: var(--text);
  font: inherit;
  font-weight: 400;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--neon); box-shadow: 0 0 0 3px var(--neon-soft), var(--glow-sm); }
select option { background: var(--panel-solid); }

button, .button {
  position: relative;
  overflow: hidden;
  display: inline-block;
  padding: 10px 18px;
  border: 1px solid var(--neon);
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(47, 123, 255, 0.35), rgba(0, 225, 255, 0.25));
  color: #eaffff;
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--glow-sm);
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
}
button::after, .button::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 35%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: translateX(-120%) skewX(-20deg);
}
button:hover, .button:hover { transform: translateY(-1px); box-shadow: var(--glow); background: linear-gradient(135deg, rgba(47, 123, 255, 0.55), rgba(0, 225, 255, 0.4)); text-shadow: none; }
button:hover::after, .button:hover::after { animation: shine 0.8s ease-out; }
button:active, .button:active { transform: translateY(1px); }
button.danger { border-color: var(--danger); background: rgba(255, 61, 113, 0.18); box-shadow: 0 0 10px rgba(255, 61, 113, 0.3); }
button.danger:hover { background: rgba(255, 61, 113, 0.35); box-shadow: 0 0 18px rgba(255, 61, 113, 0.5); }
button.link { border: 0; background: none; box-shadow: none; color: var(--neon); padding: 0; font-weight: 500; }
button.link::after { display: none; }
button.link:hover { transform: none; text-shadow: var(--glow-sm); background: none; box-shadow: none; }
button.icon { padding: 4px 11px; background: rgba(2, 6, 16, 0.6); border-color: var(--line); box-shadow: none; }
button.icon:hover { border-color: var(--neon); box-shadow: var(--glow-sm); }
button:disabled { opacity: 0.3; cursor: default; transform: none; box-shadow: none; }
.button.big { padding: 14px 32px; font-size: 16px; }

.row { display: flex; gap: 10px; flex-wrap: wrap; }

/* --- Ranks --- */

.ranks { list-style: none; margin: 0 0 16px; padding: 0; }
.rank {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: rgba(2, 6, 16, 0.45);
  transition: border-color 0.2s, transform 0.2s;
}
.rank:hover { border-color: var(--line-strong); transform: translateX(3px); }
.rank-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rank-pos { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); color: var(--neon); font-family: var(--display); font-size: 12px; }
.rank-roles { flex: 1 1 180px; min-width: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.rank-move { display: flex; gap: 4px; margin: 0; }
.rank details { margin-top: 10px; }
.rank summary, .add-rank summary { cursor: pointer; color: var(--neon); font-weight: 600; }
.rank details[open] summary, .add-rank[open] summary { margin-bottom: 14px; }
.delete-row { align-items: center; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }

.role-picker { border: 1px solid var(--line); border-radius: 9px; margin: 0 0 14px; padding: 8px 12px; max-height: 240px; overflow-y: auto; }
.role-picker legend { font-weight: 600; font-size: 13px; padding: 0 4px; color: #b9d4f2; }
label.check { display: flex; align-items: center; gap: 8px; margin: 5px 0; font-weight: 400; }
label.check input { width: auto; margin: 0; accent-color: var(--neon); }

ul.plain { list-style: none; padding: 0; margin: 0 0 16px; }
ul.plain li { padding: 8px 0; border-bottom: 1px solid var(--line); }
form.inline { display: inline; }
.danger-text { color: var(--danger); }
code { font-family: ui-monospace, Consolas, monospace; color: var(--neon); }

/* --- Tables --- */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 9px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--muted); }
tbody tr { transition: background 0.2s; }
tbody tr:hover { background: rgba(0, 225, 255, 0.04); }


/* --- Section navigation --- */

.sections { display: flex; gap: 4px; margin-right: auto; margin-left: 12px; }
.sections a {
  position: relative;
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  transition: color 0.2s, background 0.2s;
}
.sections a:hover { color: var(--text); background: rgba(0, 225, 255, 0.06); text-shadow: none; }
.sections a.active { color: var(--neon); }
.sections a.active::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--neon);
  box-shadow: var(--glow-sm);
}

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .page-title { margin: 0; }
.page-head input[type=search] { max-width: 320px; margin: 0; }
.count {
  font-size: 13px;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--neon);
  vertical-align: middle;
}
.crumbs { margin: 0 0 12px; }

/* --- Roster --- */

.roster-rank-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.roster-table { table-layout: fixed; min-width: 560px; }
.roster-table td { vertical-align: middle; overflow: hidden; text-overflow: ellipsis; }
.roster-table th:nth-child(1) { width: 120px; }
.roster-table th:nth-child(2) { width: 32%; }
.roster-table th:nth-child(4) { width: 90px; }
.roster-table th:nth-child(5) { width: 100px; }
.roster-table .who { color: var(--text); }
.roster-table .who:hover { color: var(--neon); }
.callsign { font-family: var(--display); font-size: 13px; letter-spacing: 1px; color: var(--neon); text-shadow: var(--glow-sm); white-space: nowrap; width: 110px; }
.suspended-section { border-color: rgba(255, 61, 113, 0.35); }

.cert {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 2px 0;
  padding: 2px 10px;
  border-radius: 6px;
  background: rgba(47, 123, 255, 0.14);
  border: 1px solid rgba(47, 123, 255, 0.45);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.tally {
  display: inline-block;
  margin-right: 4px;
  padding: 1px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border: 1px solid currentColor;
}
.tally.warn { color: var(--warn); }
.tally.strike { color: var(--danger); }

details.hire summary { cursor: pointer; color: var(--neon); font-weight: 700; }
details.hire[open] summary { margin-bottom: 14px; }

/* --- Profile --- */

.profile-certs { margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.callsign-big {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 20px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  font-family: var(--display);
  font-size: 26px;
  font-weight: 800;
  color: var(--neon);
  text-shadow: var(--glow);
  box-shadow: inset 0 0 18px var(--neon-soft);
}
.callsign-big .muted { font-family: var(--font); font-size: 10px; letter-spacing: 2px; text-transform: uppercase; text-shadow: none; }

.actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
details.action { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; background: rgba(2, 6, 16, 0.45); transition: border-color 0.2s; }
details.action:hover, details.action[open] { border-color: var(--line-strong); }
details.action[open] { grid-column: 1 / -1; }
details.action summary { cursor: pointer; font-weight: 700; color: var(--neon); }
details.action[open] summary { margin-bottom: 12px; }
details.danger-zone summary { color: var(--danger); }
details.danger-zone { border-color: rgba(255, 61, 113, 0.3); }
details.inline-action summary { cursor: pointer; color: var(--muted); font-size: 13px; }
details.inline-action[open] summary { margin-bottom: 8px; }

.records { list-style: none; margin: 0; padding: 0; }
.record { padding: 12px 0; border-bottom: 1px solid var(--line); }
.record:last-child { border-bottom: 0; }
.record.removed { opacity: 0.55; }
.record.removed .reason { text-decoration: line-through; }
.record-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.reason { margin: 6px 0; white-space: pre-wrap; }
.proof { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0; font-size: 13px; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 6px; border-left: 1px solid var(--line-strong); }
.timeline-item .small { display: block; margin-top: 2px; }
.timeline-item { position: relative; display: flex; gap: 14px; padding: 0 0 18px 16px; animation: rise 0.4s both; }
.timeline-dot { position: absolute; left: -12px; top: 5px; width: 11px; height: 11px; border-radius: 50%; background: var(--neon); box-shadow: var(--glow-sm); }
.action-terminate .timeline-dot, .action-strike .timeline-dot, .action-suspend .timeline-dot { background: var(--danger); box-shadow: 0 0 8px var(--danger); }
.action-warning .timeline-dot { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.action-promote .timeline-dot, .action-hire .timeline-dot { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.action-callsign .timeline-dot, .action-rank_change .timeline-dot { background: var(--muted); box-shadow: none; }

/* --- Superadmin extras --- */

.callsign-fields { border: 1px solid var(--line); border-radius: 9px; margin: 0 0 14px; padding: 8px 12px; }
.callsign-fields legend { font-weight: 600; font-size: 13px; padding: 0 4px; color: #b9d4f2; }
.callsign-fields .row label { flex: 1; min-width: 90px; }
.sync-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.emoji-input { width: 90px; }
.grow { flex: 1; }

/* --- Investigations & reports --- */

h3 { margin: 18px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: 1.5px; color: #b9d4f2; }

.status, .priority, .rtype {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.status-open { color: var(--neon); box-shadow: var(--glow-sm); }
.status-active { color: var(--ok); box-shadow: 0 0 10px rgba(25, 245, 170, 0.25); }
.status-cold { color: #8fb8ff; }
.status-closed { color: var(--muted); }
.priority-low { color: var(--muted); }
.priority-normal { color: #b9d4f2; }
.priority-high { color: var(--warn); }
.priority-critical { color: var(--danger); animation: pulse-red 2s ease-in-out infinite; }
@keyframes pulse-red { 0%, 100% { box-shadow: 0 0 4px rgba(255, 61, 113, 0.3); } 50% { box-shadow: 0 0 14px rgba(255, 61, 113, 0.7); } }
.rtype { color: #c7b8ff; border-color: rgba(199, 184, 255, 0.5); }

.case-no { font-family: var(--display); font-size: 12px; letter-spacing: 1px; color: var(--neon); white-space: nowrap; }
.case-no.big { font-size: 16px; text-shadow: var(--glow-sm); }
.case-table .row-title { color: var(--text); font-weight: 600; }
.case-table .row-title:hover { color: var(--neon); }
.case-head-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.case-head h1 { margin-bottom: 6px; }
.summary { margin: 14px 0; }
.push-right { margin-left: auto; }
.small-button { padding: 6px 12px; font-size: 13px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.section-head h2 { margin: 0; }

.filter-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 600; transition: all 0.2s; }
.tabs a:hover { color: var(--text); border-color: var(--line-strong); text-shadow: none; }
.tabs a.active { color: #001521; background: var(--neon); border-color: var(--neon); box-shadow: var(--glow-sm); }
.search-inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; }
.search-inline input[type=search] { margin: 0; width: 240px; }
.search-inline label.check { margin: 0; font-size: 13px; }
.search-big { display: flex; gap: 10px; }
.search-big input { margin: 0; font-size: 16px; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 9px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list li > a { color: var(--text); min-width: 0; }
.list li > a:hover { color: var(--neon); }
.list-meta { display: flex; align-items: center; gap: 6px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
a.stat:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: var(--glow-sm); text-shadow: none; }
.stat-n { font-family: var(--display); font-size: 30px; font-weight: 800; color: var(--neon); text-shadow: var(--glow-sm); }
.stat-label { font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.small-stat { padding: 10px 14px; }
.small-stat .stat-n { font-size: 22px; }
.quick { display: flex; flex-direction: column; gap: 8px; }

.subjects li { display: block; }
.kind { font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.subject-suspect .kind { color: var(--danger); }
.subject-poi .kind { color: var(--warn); }
.subject-victim .kind { color: #8fb8ff; }
.subject-witness .kind { color: var(--ok); }
.team-member { display: flex; align-items: center; gap: 8px; }

.note-form { margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.timeline-item.note .timeline-dot { background: var(--neon-2); }
.note-body { margin-top: 0; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 20px; margin: 16px 0 20px; }
.facts dt { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 2px 0 0; }
.report-body { white-space: pre-wrap; line-height: 1.7; padding: 18px; border-radius: 10px; background: rgba(2, 6, 16, 0.55); border: 1px solid var(--line); }

.officer-picker { max-height: 200px; }
.callsign-sm { font-family: var(--display); font-size: 11px; color: var(--neon); }

.danger-zone-card summary { cursor: pointer; color: var(--danger); font-weight: 700; }
.danger-zone-card[open] summary { margin-bottom: 12px; }
.danger-zone-card { border-color: rgba(255, 61, 113, 0.3); }

/* --- Member picker --- */

.picker-list { list-style: none; margin: 0 0 12px; padding: 4px; max-height: 300px; overflow-y: auto; border: 1px solid var(--line); border-radius: 9px; background: rgba(2, 6, 16, 0.55); }
.picker-item {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  grid-template-areas: "img name tag" "img sub tag";
  align-items: center;
  column-gap: 10px;
  width: 100%;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: none;
  box-shadow: none;
  text-align: left;
  font-weight: 400;
}
.picker-item::after { display: none; }
.picker-item:hover { background: rgba(0, 225, 255, 0.07); border-color: var(--line); transform: none; box-shadow: none; }
.picker-item:disabled { opacity: 0.45; }
.picker-item img { grid-area: img; width: 30px; height: 30px; border-radius: 50%; }
.picker-name { grid-area: name; font-weight: 600; }
.picker-sub { grid-area: sub; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-item .level { grid-area: tag; }
.picker-list li.chosen .picker-item { border-color: var(--neon); background: var(--neon-soft); box-shadow: var(--glow-sm); }
.picker-more { padding: 8px 10px; }
.picker-selected { margin: 0 0 8px; }

/* --- Map --- */

main.wide { max-width: none; padding: 16px; }
.map-page { display: grid; grid-template-columns: 320px 1fr; gap: 16px; height: calc(100vh - 100px); min-height: 520px; }
.map-side { display: flex; flex-direction: column; margin: 0; overflow: hidden; }
.map-side-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.map-side-head .page-title { margin: 0; font-size: 22px; }
.map-side #pin-search { margin: 0 0 10px; }
#add-pin[aria-pressed="true"] { border-color: var(--danger); background: rgba(255, 61, 113, 0.2); }
.pin-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.pin-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: none;
  box-shadow: none;
  text-align: left;
  font-weight: 400;
}
.pin-item::after { display: none; }
.pin-item:hover { background: rgba(0, 225, 255, 0.07); border-color: var(--line); box-shadow: none; transform: none; }
.pin-item-text { display: flex; flex-direction: column; min-width: 0; }
.pin-item-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pin-item-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pin-emoji { font-size: 20px; line-height: 1; }
.pin-empty { padding: 10px; }

.map-wrap { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line-strong); box-shadow: 0 0 30px rgba(0, 160, 255, 0.15); }
.map-canvas { width: 100%; height: 100%; background: #0a1a2e; font: inherit; }
.map-canvas.placing { cursor: crosshair; }
.map-canvas.placing .leaflet-interactive { cursor: crosshair; }

.pin-icon { display: grid; place-items: center; }
.pin-icon span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50% 50% 50% 4px;
  transform: rotate(-45deg);
  background: radial-gradient(circle at 40% 35%, #10284a, #050b18);
  border: 2px solid var(--neon);
  box-shadow: var(--glow);
  animation: pin-drop 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.3) both;
}
/* The marker shape is a rotated square; turn the emoji back upright. */
.pin-icon b { display: block; transform: rotate(45deg); font-size: 17px; font-weight: 400; line-height: 1; }
.pin-icon.draft span { border-color: var(--warn); animation: pin-drop 0.45s both, pulse 1.2s ease-in-out infinite; }
.leaflet-marker-icon.pin-icon:hover span { border-color: #fff; }
@keyframes pin-drop { from { opacity: 0; transform: translateY(-24px) rotate(-45deg); } to { opacity: 1; transform: rotate(-45deg); } }

.leaflet-popup-content-wrapper, .leaflet-popup-tip {
  background: var(--panel-solid);
  color: var(--text);
  border: 1px solid var(--line-strong);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), var(--glow-sm);
}
.leaflet-popup-content { margin: 14px 16px; font: 14px/1.5 var(--font); }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); }
.leaflet-container a.leaflet-popup-close-button:hover { color: var(--neon); }
.pin-popup .pin-title { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.pin-notes { margin: 8px 0; white-space: pre-wrap; }
.pin-case { display: block; margin: 6px 0; font-weight: 600; }
.pin-meta { margin: 6px 0 10px; font-size: 12px; color: var(--muted); }
.pin-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.pin-actions button { padding: 5px 10px; font-size: 12px; }
.pin-form label { margin-bottom: 10px; font-size: 12px; }
.pin-form input, .pin-form select, .pin-form textarea { padding: 7px 9px; font-size: 13px; }
.pin-error { color: #ff8fab; font-size: 12px; margin: 0 0 8px; }
.pin-error:empty { display: none; }
.emoji-row { display: flex; flex-direction: column; gap: 6px; }
.emoji-field { width: 70px !important; text-align: center; font-size: 18px !important; }
.emoji-palette { display: flex; flex-wrap: wrap; gap: 3px; }
.emoji-choice { padding: 3px 5px; border: 1px solid var(--line); background: rgba(2, 6, 16, 0.6); box-shadow: none; font-size: 16px; line-height: 1; }
.emoji-choice::after { display: none; }
.emoji-choice:hover { border-color: var(--neon); transform: scale(1.15); }

.leaflet-bar a { background: var(--panel-solid); color: var(--neon); border-color: var(--line) !important; }
.leaflet-bar a:hover { background: #10223f; color: #fff; }
.leaflet-bar { border: 1px solid var(--line-strong) !important; box-shadow: var(--glow-sm) !important; }

.map-toast {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 1000;
  transform: translate(-50%, 20px);
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--panel-solid);
  border: 1px solid var(--neon);
  box-shadow: var(--glow-sm);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}
.map-toast.show { opacity: 1; transform: translate(-50%, 0); }
.map-toast.error { border-color: var(--danger); color: #ff8fab; }

@media (max-width: 800px) {
  .map-page { grid-template-columns: 1fr; grid-template-rows: auto 70vh; height: auto; }
  .map-side { max-height: 260px; }
}

/* --- Interview recordings --- */

.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.vcard {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  animation: rise 0.5s both;
}
.vcard:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: var(--glow); text-shadow: none; }
.vthumb { position: relative; aspect-ratio: 16 / 9; background: radial-gradient(circle at 50% 40%, #10284a, #050b18); display: grid; place-items: center; overflow: hidden; }
.vthumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.vcard:hover .vthumb img { transform: scale(1.05); }
.vthumb-empty { font-size: 40px; opacity: 0.6; }
.vduration { position: absolute; right: 8px; bottom: 8px; padding: 1px 7px; border-radius: 5px; background: rgba(0, 0, 0, 0.75); font-size: 12px; font-weight: 600; }
.vstatus { position: absolute; left: 8px; top: 8px; padding: 2px 9px; border-radius: 999px; background: rgba(0, 0, 0, 0.75); border: 1px solid currentColor; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.8px; color: var(--neon); }
.list .vstatus { position: static; }
.vstatus-failed { color: var(--danger); }
.vstatus-queued { color: var(--warn); }
.vinfo { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px 14px; }
.vtitle { font-size: 15px; }

.video-card h1 { margin-top: 18px; }
.player { display: block; width: 100%; max-height: 70vh; border-radius: 10px; background: #000; border: 1px solid var(--line-strong); box-shadow: var(--glow-sm); }
.player-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  aspect-ratio: 16 / 9;
  max-height: 60vh;
  padding: 20px;
  border-radius: 10px;
  border: 1px dashed var(--line-strong);
  background: radial-gradient(circle at 50% 40%, #0c2040, #050b18);
  text-align: center;
}
.player-placeholder > span:first-child { font-size: 40px; }
.player-placeholder.failed { border-color: var(--danger); }
.player-placeholder p { margin: 0; }
.vstate { font-family: var(--display); color: var(--neon); text-shadow: var(--glow-sm); }
.spinner { width: 42px; height: 42px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--neon); animation: spin 0.9s linear infinite; box-shadow: var(--glow-sm); }
@keyframes spin { to { transform: rotate(360deg); } }

.bar { width: 100%; max-width: 420px; height: 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); overflow: hidden; border: 1px solid var(--line); }
.bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--neon-2), var(--neon)); box-shadow: var(--glow-sm); transition: width 0.4s; }
.upload-progress { margin: 4px 0 14px; }
.upload-progress .bar { max-width: none; }
.upload-status { margin: 6px 0 0; }
.source-tabs { margin-bottom: 14px; }
form.filter-bar { justify-content: flex-start; }
form.filter-bar select { flex: 1 1 260px; width: auto; max-width: 420px; margin: 0; }
form.filter-bar input[type=search] { flex: 1 1 220px; width: auto; }

/* Scrollbars */
* { scrollbar-color: rgba(0, 225, 255, 0.35) transparent; }

@media (max-width: 600px) {
  header { padding: 10px 16px; }
  .brand-text span { display: none; }
  header .who { display: none; }
  .sections { order: 3; width: 100%; margin: 4px 0 0; overflow-x: auto; }
  header { flex-wrap: wrap; }
  .callsign-big { width: 100%; }
  .card { padding: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
