:root {
  --bg: #0a0a0a;
  --panel: #121212;
  --text: #e5e7eb;
  --crimson: #b91c1c;
  --redaccent: #ef4444;
}

@font-face {
  font-family: 'Special Elite';
  src: url('/static/fonts/SpecialElite.ttf') format('truetype');
}
body {
  background: var(--bg);
  color: var(--text);
}
.panel {
  background: var(--panel);
  border-radius: 0.5rem;
  padding: 1.5rem;
}
.btn {
  background: var(--crimson);
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
}
.btn:hover {
  background: #a11212;
}
.link {
  color: var(--crimson);
}
.link:hover {
  color: var(--redaccent);
}
@keyframes pulse-red {
  0%,
  100% {
    box-shadow: 0 0 0px var(--crimson);
  }
  50% {
    box-shadow: 0 0 10px var(--redaccent);
  }
}
.pulse-red:hover,
.pulse-red:focus {
  animation: pulse-red 1.5s infinite;
  outline: none;
}
input[type="text"],
input[type="username"],
input[type="password"],
input[type="email"],
input[type="number"],
textarea,
select {
  background: #1a1a1a;
  color: var(--text);
  border: 1px solid #2a2a2a;
  border-radius: 0.375rem;
  padding: 0.4rem 0.6rem;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--crimson);
  box-shadow: 0 0 6px var(--redaccent);
}
a.nav-pill {
  background: var(--crimson);
  padding: 0.35rem 0.6rem;
  border-radius: 0.375rem;
}
a.nav-pill:hover {
  background: #a11212;
  animation: pulse-red 1.5s infinite;
}
.icon64 {
  width: 64px;
  height: 64px;
  object-fit: contain; /* instead of cover */
  background-color: #0e0e0e; /* subtle backing so transparent icons still show */
  border-radius: .5rem;
  padding: 4px; /* prevents edge clipping */
  vertical-align: middle;
  margin-right: .6rem;
}

.rank-name {
  font-size: 1.5rem;
  font-weight: 700;
}
.medal-name {
  font-size: 1.125rem;
  font-weight: 600;
}
.table-row:hover {
  animation: pulse-red 1.5s infinite;
}
.avatar {
  width: 64px;
  height: 64px;
  border-radius: 9999px;
  object-fit: cover;
}
.avatar.missing {
  background: #1f2937;
  border: 2px solid rgba(185, 28, 28, 0.5);
}
.pagination {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 1rem;
}
.pagination button {
  background: #1f2937;
  border: 1px solid #2a2a2a;
  color: #e5e7eb;
  padding: 0.35rem 0.6rem;
  border-radius: 0.375rem;
}
.pagination button[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ID Card Styling - Military ID Card Design */
.id-card {
  background: #000000;
  border: 3px solid #b91c1c;
  border-radius: 0.375rem;
  padding: 0;
  max-width: 480px;
  margin-top: 1.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(185, 28, 28, 0.3);
  aspect-ratio: 85.6 / 53.98;
  display: flex;
  flex-direction: column;
  font-family: 'Special Elite', 'Courier New', monospace;
}

.id-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 35px;
  background: #000000;
  border-bottom: 2px solid #b91c1c;
  z-index: 10;
}

.id-card::after {
  content: 'VIKING TACTICAL IDENTIFICATION CARD';
  position: absolute;
  top: 8px;
  left: 0;
  right: 0;
  text-align: center;
  color: #b91c1c;
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.15em;
  z-index: 11;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.id-card-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1;
  gap: 0;
  padding-top: 35px;
}

.id-card-photo-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #000000;
  padding: 1.5rem 1rem;
  border-right: 2px solid rgba(185, 28, 28, 0.3);
  min-width: 140px;
  flex-shrink: 0;
  gap: 1.5rem;
}

.id-card-photo-section .id-card-avatar {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border: 2px solid #b91c1c;
  flex-shrink: 0;
  border-radius: 0;
}

.id-card-header {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0.75rem 1.25rem;
  flex: 1;
  justify-content: flex-start;
  padding-top: 0.5rem;
}

.id-card-name-section {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.id-card-rank-icon-inline {
  width: 36px;
  height: 36px;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(185, 28, 28, 0.5);
  padding: 2px;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.id-card-name {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  line-height: 1.1;
}

.id-card-rank-name-inline {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.15rem;
}

.id-card-header-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.id-card-field {
  display: flex;
  gap: 0.5rem;
  font-size: 0.75rem;
  line-height: 1.2;
}

.id-card-field-label {
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  min-width: 70px;
}

.id-card-field-value {
  color: #f3f4f6;
  font-weight: 500;
}

.id-card-field-pid {
  display: flex;
  gap: 0.5rem;
  font-size: 0.75rem;
  line-height: 1.2;
  margin-top: 0.25rem;
}

.id-card-field-pid-label {
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  min-width: 70px;
}

.id-card-field-pid-value {
  color: #f3f4f6;
  font-weight: 600;
  font-family: 'Courier New', monospace;
  letter-spacing: 0.1em;
}

.id-card-rank-section {
  display: none;
}

.id-card-rank-icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(185, 28, 28, 0.5);
  padding: 2px;
  flex-shrink: 0;
}

.id-card-rank-info {
  flex: 1;
}

.id-card-rank-label {
  font-size: 0.65rem;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.id-card-rank-name {
  font-size: 0.95rem;
  font-weight: 700;
  margin-top: 0.1rem;
}

.id-card-department {
  font-size: 0.75rem;
  line-height: 1.1;
  margin-top: 0.3rem;
}

.id-card-department-label {
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.id-card-department-name {
  color: #f3f4f6;
  font-weight: 500;
}

.id-card-none {
  color: #6b7280;
  font-style: italic;
}

.id-card-medals {
  font-size: 0.75rem;
  line-height: 1.1;
  margin-top: 0.3rem;
}

.id-card-medals-label {
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.id-card-medals-list {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.3rem;
}

.id-card-medal-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(185, 28, 28, 0.1);
  padding: 0.2rem 0.4rem;
  border-radius: 0.25rem;
  border: 1px solid rgba(185, 28, 28, 0.3);
  font-size: 0.65rem;
  color: #f3f4f6;
}

.id-card-medal-icon {
  width: 14px;
  height: 14px;
  object-fit: contain;
}

.id-card-qrcode {
  width: 100px;
  height: 100px;
  border: 2px solid #b91c1c;
  flex-shrink: 0;
}