/* ========== RDCP Military Theme (Drop-in) ========== */
:root{
  /* Core palette */
  --bg: #070b0f;               /* deep near-black */
  --bg-2: #0c1218;             /* topbar/footer */
  --panel: #111922;            /* primary panels */
  --panel-2: #151f2a;          /* card/row backgrounds */
  --border: #273326;           /* military green border */
  --border-2: #33463a;

  /* Text */
  --text: #d7ddd4;             /* off-white */
  --muted: #98a59a;            /* muted gray-green */
  --muted-2: #7c8a80;

  /* Accents */
  --olive: #556b2f;            /* olive drab */
  --olive-2: #6b7f3a;          /* slightly brighter */
  --khaki: #b7a76a;            /* muted gold/khaki */
  --danger: #8b1e1e;           /* deep red */
  --danger-2: #ff6b6b;

  /* UI */
  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 10px 26px rgba(0,0,0,0.55);
}

* {
  box-sizing: border-box;
  font-family: "Segoe UI", sans-serif;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  background: radial-gradient(1200px 600px at 50% -200px, rgba(85,107,47,0.18), transparent 55%),
              radial-gradient(900px 500px at 15% 10%, rgba(183,167,106,0.08), transparent 55%),
              var(--bg);
  color: var(--text);
}

/* ========== Top Bar ========== */
.top-bar {
  background: linear-gradient(180deg, #0c141c, var(--bg-2));
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid rgba(85,107,47,0.75);
}

.logo {
  font-weight: 800;
  color: #b8c7a2;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.nav a {
  margin-left: 18px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.95rem;
  user-select: none;
  text-decoration: none;
}

.nav a:hover {
  color: var(--text);
}

/* ========== Layout ========== */
.container {
  padding: 28px;
}

/* ========== Panels ========== */
.panel {
  background: linear-gradient(180deg, rgba(17,25,34,0.98), rgba(17,25,34,0.92));
  border: 1px solid rgba(39,51,38,0.95);
  padding: 18px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel h2 {
  color: #c7d4b2;
  margin: 0 0 14px;
  letter-spacing: 0.3px;
}

/* ========== Warrant Carousel ========== */
.warrant-carousel {
  overflow: hidden;
  width: 100%;
  position: relative;
}

.warrant-track {
  display: flex;
  gap: 20px;
  width: max-content;
  animation: scrollLeft 60s linear infinite;
}

/* Pause on hover (nice for reading) */
.warrant-carousel:hover .warrant-track {
  animation-play-state: paused;
}

.warrant-card {
  background: linear-gradient(180deg, rgba(21,31,42,0.95), rgba(18,26,35,0.92));
  border: 1px solid rgba(51,70,58,0.85);
  padding: 10px;
  width: 150px;
  text-align: center;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.warrant-card:hover {
  transform: translateY(-2px);
  border-color: rgba(183,167,106,0.55);
}

.warrant-card img {
  width: 100%;
  border-radius: 4px;
  margin-bottom: 8px;
  border: 1px solid rgba(0,0,0,0.25);
}

.warrant-card span {
  display: block;
  font-weight: 700;
  color: var(--text);
}

.warrant-card small {
  color: var(--khaki);
}

@keyframes scrollLeft {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(-100%);
  }
}

/* ========== Footer ========== */
.footer {
  background: linear-gradient(180deg, var(--bg-2), #0a1016);
  text-align: center;
  padding: 12px;
  font-size: 12px;
  color: var(--muted-2);
  border-top: 2px solid rgba(85,107,47,0.75);
}

/* ========== Search styles ========== */
.search-box {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 220px;
  padding: 10px 12px;
  background: var(--panel-2);
  border: 1px solid rgba(51,70,58,0.85);
  border-radius: var(--radius-sm);
  color: var(--text);
}

.search-input:focus {
  outline: none;
  border-color: rgba(183,167,106,0.6);
  box-shadow: 0 0 0 3px rgba(183,167,106,0.12);
}

/* Buttons */
.search-button, .add-citizen-button {
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.search-button {
  background: linear-gradient(180deg, #6b7f3a, #556b2f);
  color: #0b0f14;
}

.search-button:hover {
  filter: brightness(1.05);
}

.add-citizen-button {
  background: transparent;
  color: #c7d4b2;
  border: 2px solid rgba(85,107,47,0.9);
}

.add-citizen-button:hover {
  border-color: rgba(183,167,106,0.65);
  color: var(--text);
}

/* ========== Citizen list ========== */
.citizen-list-header {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr 1fr 1fr;
  padding: 10px 12px;
  background: rgba(21,31,42,0.9);
  margin-top: 18px;
  font-weight: 800;
  color: #c7d4b2;
  border: 1px solid rgba(39,51,38,0.8);
  border-radius: var(--radius-sm);
}

.citizen-item {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr 1fr 1fr;
  padding: 14px 12px;
  border-bottom: 1px solid rgba(39,51,38,0.6);
}

.citizen-item:hover {
  background: rgba(21,31,42,0.35);
}

.action-buttons button {
  margin: 0 4px;
  padding: 6px 10px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

/* Action buttons */
.view-btn {
  background: rgba(39,51,38,0.9);
  color: var(--text);
}

.edit-btn {
  background: linear-gradient(180deg, #6b7f3a, #556b2f);
  color: #0b0f14;
}

.delete-btn {
  background: linear-gradient(180deg, #9a2b2b, var(--danger));
  color: #fff;
}

/* ========== Dashboard grid ========== */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 18px;
}

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

.stat-box {
  background: rgba(21,31,42,0.9);
  padding: 14px;
  border-radius: var(--radius-sm);
  text-align: center;
  border: 1px solid rgba(39,51,38,0.8);
}

/* ========== Password Gate (Front-end) ========== */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.86);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 460px;
  background: linear-gradient(180deg, rgba(17,25,34,0.98), rgba(17,25,34,0.92));
  border: 1px solid rgba(39,51,38,0.95);
  border-radius: 12px;
  padding: 26px;
  box-shadow: var(--shadow);
  text-align: center;
}

.auth-card h2 {
  margin: 0 0 8px;
  color: #c7d4b2;
}

.auth-card p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

.auth-form {
  display: flex;
  gap: 10px;
}

.auth-input {
  flex: 1;
  padding: 12px;
  background: var(--panel-2);
  border: 1px solid rgba(51,70,58,0.85);
  border-radius: var(--radius-sm);
  color: var(--text);
}

.auth-input:focus {
  outline: none;
  border-color: rgba(183,167,106,0.6);
  box-shadow: 0 0 0 3px rgba(183,167,106,0.12);
}

.auth-button {
  padding: 12px 16px;
  background: linear-gradient(180deg, #6b7f3a, #556b2f);
  color: #0b0f14;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 900;
}

.auth-button:hover {
  filter: brightness(1.05);
}

.auth-error {
  margin-top: 12px;
  padding: 10px 12px;
  background: rgba(139,30,30,0.18);
  border: 1px solid rgba(255,107,107,0.55);
  color: var(--danger-2);
  border-radius: var(--radius-sm);
  text-align: left;
  font-size: 0.95rem;
}

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

@media (max-width: 520px) {
  .auth-form { flex-direction: column; }
}
/* ===== Nav links like buttons (matches citizen look) ===== */
.nav .btn-link{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(85,107,47,0.55);
  color: var(--text);
  text-decoration: none;
}
.nav .btn-link:hover{
  border-color: rgba(183,167,106,0.6);
}

/* Make warrant cards clickable buttons without ugly default styles */
.warrant-clickable{
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: none;
  padding: 0;
  text-align: inherit;
}

/* ===== Modal (View Window) ===== */
.modal-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20000;
  padding: 18px;
}

.modal-card{
  width: 100%;
  max-width: 820px;
  background: linear-gradient(180deg, rgba(17,25,34,0.98), rgba(17,25,34,0.92));
  border: 1px solid rgba(39,51,38,0.95);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.55);
  overflow: hidden;
}

.modal-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(39,51,38,0.65);
  color: #c7d4b2;
}

.modal-close{
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(85,107,47,0.55);
  background: rgba(21,31,42,0.9);
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
}

.modal-body{
  padding: 16px;
}

.modal-footer{
  padding: 14px 16px;
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid rgba(39,51,38,0.65);
}

/* View layout */
.view-grid{
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 16px;
}

.view-photo img{
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(39,51,38,0.65);
}

.view-fields{
  display: grid;
  gap: 10px;
}

.view-row{
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(21,31,42,0.85);
  border: 1px solid rgba(39,51,38,0.55);
  border-radius: 10px;
}

.view-label{
  color: rgba(215,221,212,0.7);
  font-weight: 700;
}

.view-value{
  color: var(--text);
  font-weight: 650;
}

.status-pill{
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(139,30,30,0.25);
  border: 1px solid rgba(255,107,107,0.35);
  color: #ff8a8a;
  font-weight: 800;
}

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

