:root {
  --bg-void: #05070a;
  --bg-panel: #0d1420;
  --bg-panel-2: #101a29;
  --line: #1c2836;
  --police-blue: #2f7fd1;
  --police-blue-dim: #1c4f80;
  --police-red: #d43042;
  --amber: #ffb020;
  --text-primary: #e8edf4;
  --text-dim: #5c7089;
  color-scheme: dark;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  background: var(--bg-void);
  color: var(--text-primary);
  font-family: 'Rajdhani', sans-serif;
}

body {
  background-image:
    radial-gradient(circle at 50% 0%, rgba(47, 127, 209, 0.06), transparent 60%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.015) 0px, rgba(255, 255, 255, 0.015) 1px, transparent 1px, transparent 3px);
}

.mono {
  font-family: 'JetBrains Mono', monospace;
}

a {
  color: inherit;
}

/* lightbar + topbar */
.lightbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 100;
  background: linear-gradient(90deg, var(--police-blue) 0%, var(--police-blue) 48%, var(--police-red) 52%, var(--police-red) 100%);
  background-size: 200% 100%;
  animation: sweep 3.2s linear infinite;
  opacity: .9;
}

@keyframes sweep {
  0% {
    background-position: 0% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

.topbar {
  position: fixed;
  top: 3px;
  left: 0;
  right: 0;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: linear-gradient(180deg, rgba(13, 20, 32, 0.95), rgba(13, 20, 32, 0.8));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
  z-index: 80;
}

.menu-btn {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-panel-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  transition: border-color .2s, background .2s;
}

.menu-btn:hover {
  border-color: var(--police-blue-dim);
  background: #152233;
}

.menu-btn .bar {
  position: absolute;
  left: 10px;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  transition: transform .35s cubic-bezier(.65, 0, .35, 1), opacity .2s, top .35s;
}

.menu-btn .bar:nth-child(1) {
  top: 14px;
}

.menu-btn .bar:nth-child(2) {
  top: 20px;
}

.menu-btn .bar:nth-child(3) {
  top: 26px;
}

.menu-btn.active .bar:nth-child(1) {
  top: 20px;
  transform: rotate(45deg);
}

.menu-btn.active .bar:nth-child(2) {
  opacity: 0;
}

.menu-btn.active .bar:nth-child(3) {
  top: 20px;
  transform: rotate(-45deg);
}

.back-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: var(--bg-panel-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: .04em;
  font-size: .9rem;
  transition: border-color .2s, background .2s, padding-left .2s;
}

.back-btn:hover {
  border-color: var(--police-blue-dim);
  background: #152233;
  padding-left: 10px;
}

.back-btn svg {
  width: 16px;
  height: 16px;
  stroke: var(--police-blue);
  flex-shrink: 0;
}

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

.unit-id .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3ddc72;
  box-shadow: 0 0 8px #3ddc72;
  animation: blink 2s ease-in-out infinite;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: .35;
  }
}

.unit-id .label {
  font-size: .78rem;
  letter-spacing: .08em;
  color: var(--text-dim);
}

.unit-id .code {
  font-size: .85rem;
  color: var(--text-primary);
  font-weight: 600;
}

/* generic content container */
.page-main {
  max-width: 820px;
  margin: 0 auto;
  padding: 130px 24px 90px;
}

.eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: .72rem;
  letter-spacing: .18em;
  color: var(--police-blue);
  margin-bottom: 10px;
}

.page-main h1 {
  font-size: clamp(1.9rem, 5vw, 2.8rem);
  font-weight: 700;
  letter-spacing: .03em;
  line-height: 1.1;
  margin-bottom: 6px;
}

.page-main h1 .abbr {
  color: var(--amber);
}

.subtitle {
  font-family: 'JetBrains Mono', monospace;
  font-size: .8rem;
  color: var(--text-dim);
  letter-spacing: .05em;
  margin-bottom: 32px;
}

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
  border: 1px solid var(--line);
  border-left: 2px solid var(--police-blue);
  border-radius: 6px;
  padding: 26px 28px;
  line-height: 1.6;
  font-size: 1rem;
  color: #c3ccd8;
}

.card p {
  margin-bottom: 14px;
}

.card p:last-child {
  margin-bottom: 0;
}

.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 26px;
  font-family: 'JetBrains Mono', monospace;
  font-size: .72rem;
  letter-spacing: .1em;
  color: var(--text-dim);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px 14px;
}

.status-tag .pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 8px var(--amber);
  animation: blink 1.6s ease-in-out infinite;
}

.video-card {
  margin-top: 26px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
  border: 1px solid var(--line);
  border-left: 2px solid var(--amber);
  border-radius: 6px;
  padding: 22px 24px 24px;
}

.video-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: .7rem;
  letter-spacing: .15em;
  color: var(--amber);
  margin-bottom: 14px;
}

.video-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #000;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.video-wrap iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: .75rem;
  color: var(--text-dim);
  text-align: center;
  padding: 20px;
}

footer {
  border-top: 1px solid var(--line);
  padding: 22px 20px 26px;
  text-align: center;
}

footer .copy {
  font-family: 'JetBrains Mono', monospace;
  font-size: .7rem;
  letter-spacing: .08em;
  color: var(--text-dim);
}

footer .copy .amp {
  color: var(--police-blue);
  padding: 0 2px;
}

footer .copy .names {
  color: #8a99ad;
}

footer .tag {
  margin-top: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: .62rem;
  letter-spacing: .18em;
  color: #33465c;
}

footer .admin-link {
  display: inline-block;
  margin-top: 14px;
  font-size: .64rem;
  letter-spacing: .1em;
  color: #3a4b60;
  text-decoration: none;
  border-bottom: 1px dotted transparent;
  transition: color .2s, border-color .2s;
}

footer .admin-link:hover {
  color: var(--police-blue);
  border-color: var(--police-blue-dim);
}

/* gallery grid + lightbox */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

.thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4/3;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #000;
  overflow: hidden;
  cursor: zoom-in;
  transition: border-color .2s, transform .2s;
}

.thumb:hover {
  border-color: var(--police-blue-dim);
  transform: translateY(-2px);
}

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

.thumb-num {
  position: absolute;
  bottom: 6px;
  right: 8px;
  font-size: .64rem;
  letter-spacing: .06em;
  color: rgba(232, 237, 244, 0.55);
  background: rgba(5, 7, 10, 0.55);
  padding: 2px 6px;
  border-radius: 3px;
  pointer-events: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 10, 0.92);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
  z-index: 200;
  padding: 60px 24px;
}

.lightbox.show {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-inner {
  position: relative;
  max-width: min(90vw, 1000px);
  max-height: 80vh;
  transform: scale(.96);
  transition: transform .25s ease;
}

.lightbox.show .lightbox-inner {
  transform: scale(1);
}

.lightbox-inner img {
  display: block;
  max-width: 100%;
  max-height: 80vh;
  border-radius: 6px;
  border: 1px solid var(--line);
  box-shadow: 0 0 60px rgba(0, 0, 0, .6);
}

.lightbox-caption {
  margin-top: 12px;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: .72rem;
  letter-spacing: .1em;
  color: var(--text-dim);
}

.lightbox-close {
  position: fixed;
  top: 20px;
  right: 24px;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-panel-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text-primary);
  cursor: pointer;
  z-index: 201;
}

.lightbox-close:hover {
  border-color: var(--police-red);
}

.lightbox-close svg {
  width: 18px;
  height: 18px;
  stroke: var(--text-primary);
}

.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-panel-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text-primary);
  cursor: pointer;
  z-index: 201;
}

.lightbox-nav:hover {
  border-color: var(--police-blue-dim);
}

.lightbox-nav svg {
  width: 20px;
  height: 20px;
  stroke: var(--text-primary);
}

.lightbox-prev {
  left: 24px;
}

.lightbox-next {
  right: 24px;
}

/* forms (admin) */
.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: .68rem;
  letter-spacing: .1em;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.field input[type=text],
.field input[type=url],
.field input[type=password],
.field textarea {
  width: 100%;
  background: var(--bg-panel-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 10px 12px;
  color: var(--text-primary);
  font-family: 'Rajdhani', sans-serif;
  font-size: .98rem;
  font-weight: 600;
  letter-spacing: .02em;
  transition: border-color .2s, background .2s;
  -webkit-appearance: none;
  appearance: none;
}

.field textarea {
  font-weight: 500;
  line-height: 1.5;
  resize: vertical;
  min-height: 70px;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--police-blue);
  background: #0d1826;
}

.field input[type=file] {
  width: 100%;
  background: var(--bg-panel-2);
  border: 1px dashed var(--line);
  border-radius: 5px;
  padding: 14px 12px;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
  font-size: .8rem;
  -webkit-appearance: none;
  appearance: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  background: var(--police-blue);
  border: none;
  border-radius: 5px;
  color: #eef4fb;
  font-family: 'Rajdhani', sans-serif;
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .06em;
  cursor: pointer;
  transition: background .2s, transform .1s;
  text-decoration: none;
}

.btn:hover {
  background: #3a8ee0;
}

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

.btn.danger {
  background: var(--police-red);
}

.btn.danger:hover {
  background: #e14556;
}

.btn.ghost {
  background: var(--bg-panel-2);
  border: 1px solid var(--line);
  color: var(--text-primary);
}

.btn.ghost:hover {
  border-color: var(--police-blue-dim);
}

.alert {
  margin-bottom: 20px;
  padding: 12px 14px;
  border-radius: 5px;
  font-family: 'JetBrains Mono', monospace;
  font-size: .78rem;
  letter-spacing: .03em;
}

.alert.ok {
  background: rgba(61, 220, 114, 0.08);
  border: 1px solid rgba(61, 220, 114, .35);
  color: #8be8a6;
}

.alert.err {
  background: rgba(212, 48, 66, 0.1);
  border: 1px solid rgba(212, 48, 66, .4);
  color: #ff8b97;
}

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

  .lightbar,
  .unit-id .dot,
  .status-tag .pulse {
    animation: none;
  }
}

/* ===== hamburger + sidebar (nawigacja, wspólna dla wszystkich stron) ===== */
.menu-btn {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-panel-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  transition: border-color .2s, background .2s;
  flex-shrink: 0;
}

.menu-btn:hover {
  border-color: var(--police-blue-dim);
  background: #152233;
}

.menu-btn .bar {
  position: absolute;
  left: 10px;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  transition: transform .35s cubic-bezier(.65, 0, .35, 1), opacity .2s, top .35s;
}

.menu-btn .bar:nth-child(1) {
  top: 14px;
}

.menu-btn .bar:nth-child(2) {
  top: 20px;
}

.menu-btn .bar:nth-child(3) {
  top: 26px;
}

.menu-btn.active .bar:nth-child(1) {
  top: 20px;
  transform: rotate(45deg);
}

.menu-btn.active .bar:nth-child(2) {
  opacity: 0;
}

.menu-btn.active .bar:nth-child(3) {
  top: 20px;
  transform: rotate(-45deg);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 10, 0.6);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease;
  z-index: 60;
}

.scrim.show {
  opacity: 1;
  pointer-events: auto;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 300px;
  background: linear-gradient(180deg, var(--bg-panel), #0a1119);
  border-right: 1px solid var(--line);
  transform: translateX(-100%);
  transition: transform .45s cubic-bezier(.65, 0, .35, 1);
  z-index: 70;
  display: flex;
  flex-direction: column;
  padding-top: 88px;
  overflow-y: auto;
}

.sidebar.open {
  transform: translateX(0);
}

.sidebar-head {
  padding: 0 24px 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}

.sidebar-head .eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: .68rem;
  letter-spacing: .15em;
  color: var(--police-blue);
  margin-bottom: 0;
}

.sidebar-head h2 {
  font-size: 1.15rem;
  letter-spacing: .04em;
  margin-top: 4px;
  font-weight: 700;
}

.nav-list {
  list-style: none;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-list>li {
  opacity: 0;
  transform: translateX(-16px);
}

.sidebar.open .nav-list>li {
  animation: slideIn .45s cubic-bezier(.2, .9, .3, 1) forwards;
}

.sidebar.open .nav-list>li:nth-child(1) {
  animation-delay: .08s;
}

.sidebar.open .nav-list>li:nth-child(2) {
  animation-delay: .16s;
}

.sidebar.open .nav-list>li:nth-child(3) {
  animation-delay: .24s;
}

.sidebar.open .nav-list>li:nth-child(4) {
  animation-delay: .30s;
}

.sidebar.open .nav-list>li:nth-child(5) {
  animation-delay: .36s;
}

@keyframes slideIn {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.acc-section {
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.015);
}

.acc-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  font-family: 'Rajdhani', sans-serif;
  font-size: 1rem;
  letter-spacing: .04em;
  font-weight: 700;
  text-align: left;
}

.acc-trigger:hover {
  background: rgba(47, 127, 209, 0.08);
}

.acc-trigger .ico {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: var(--police-blue);
}

.acc-trigger .chev {
  margin-left: auto;
  width: 16px;
  height: 16px;
  stroke: var(--text-dim);
  transition: transform .3s ease;
}

.acc-section.expanded .acc-trigger .chev {
  transform: rotate(90deg);
}

.acc-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height .4s cubic-bezier(.2, .9, .3, 1);
}

.acc-section.expanded .acc-panel {
  max-height: 900px;
}

.acc-panel ul {
  list-style: none;
  padding: 2px 10px 10px 44px;
  display: flex;
  flex-direction: column;
}

.acc-panel a {
  display: block;
  padding: 9px 10px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: .88rem;
  letter-spacing: .02em;
  font-weight: 600;
  border-left: 2px solid transparent;
  transition: color .2s, border-color .2s, padding-left .2s;
}

.acc-panel a:hover {
  color: var(--text-primary);
  border-left-color: var(--police-blue);
  padding-left: 14px;
}

.nav-simple-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px;
  color: var(--text-primary);
  text-decoration: none;
  border-radius: 6px;
  border: 1px solid var(--line);
  font-size: 1rem;
  letter-spacing: .04em;
  font-weight: 700;
  transition: background .2s, border-color .2s, padding-left .2s;
}

.nav-simple-link:hover {
  background: rgba(47, 127, 209, 0.08);
  border-color: var(--police-blue-dim);
  padding-left: 18px;
}

.nav-simple-link .ico {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: var(--police-blue);
}

@media (max-width:520px) {
  .sidebar {
    width: 82%;
  }
}