/* Global reset + variables */
* { box-sizing: border-box; }

:root {
  --bg-start: #2c3e50;
  --bg-end: #3498db;

  --card-bg: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;

  --primary: #3498db;
  --primary-hover: #2980b9;

  --border: #d1d5db;
  --shadow: 0 4px 15px rgba(0, 0, 0, 0.2);

  --success-bg: #ecfdf5;
  --success-text: #065f46;

  --error-bg: #fef2f2;
  --error-text: #991b1b;

  --radius: 12px;
}

/* Sticky footer foundation */
html, body { height: 100%; }

/* Base page styling */
body {
  font-family: Arial, sans-serif;
  background: linear-gradient(135deg, var(--bg-start), var(--bg-end));
  margin: 0;
  min-height: 100vh;
  color: var(--text);

  display: flex;
  flex-direction: column;
}

/* Centered page layout */
body.center-page {
  flex: 1;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

/* Main page wrapper */
.page {
  padding: 28px 14px 16px;
  flex: 1;
}

.page__inner {
  max-width: 1100px;
  margin: 0 auto;
}

/* Header / navbar */
.site-header {
  position: sticky;
  top: 0;
  z-index: 999;
  background: rgba(44, 62, 80, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.site-header__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.nav {
  display: flex;
  gap: 10px;
  flex: 1;
  align-items: center;
  flex-wrap: wrap;
}

.nav a {
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 10px;
  font-weight: 650;
}

.nav a:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* Push */
.nav__right { margin-left: auto; }

.user-pill {
  color: rgba(255, 255, 255, 0.92);
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

/* Footer */
.site-footer {
  margin-top: auto;
  flex-shrink: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(44, 62, 80, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.site-footer__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 16px;
  color: rgba(255, 255, 255, 0.75);
}

/* Containers */
.container {
  background: var(--card-bg);
  padding: 30px;
  border-radius: var(--radius);
  width: 340px;
  box-shadow: var(--shadow);
  text-align: center;
}

.container--home {
  width: 460px;
  max-width: 92vw;
  padding: 38px;
}

.card {
  background: var(--card-bg);
  padding: 22px;
  border-radius: 16px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Typography */
h1, h2, h3 {
  margin: 0 0 14px 0;
  color: #111827;
}

.subtext {
  margin: -8px 0 16px 0;
  color: var(--muted);
  line-height: 1.4;
}

/* Form elements */
label {
  display: block;
  text-align: left;
  margin-top: 10px;
  font-weight: bold;
}

input, select {
  width: 100%;
  padding: 10px;
  margin-top: 6px;
  border-radius: 8px;
  border: 1px solid var(--border);
  outline: none;
  font-size: 0.98rem;
}

input:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.18);
}

input[type="file"] {
  padding: 8px;
  background: #f9fafb;
}

/* Buttons */
button, .btn {
  margin-top: 18px;
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  font-weight: bold;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.15s ease, transform 0.05s ease;
}

button:hover, .btn:hover { background: var(--primary-hover); }
button:active, .btn:active { transform: translateY(1px); }

a.btn {
  display: block;
  text-decoration: none;
  text-align: center;
  line-height: 1.2;
}

.btn-stack {
  margin-top: 16px;
  display: grid;
  gap: 14px;
}

.btn-stack .btn { margin-top: 0; }

.btn-inline {
  width: auto !important;
  padding: 8px 10px;
  margin-top: 0 !important;
  display: inline-block;
}

.police-actions {
  margin-top: 14px;
  display: grid;
  gap: 14px;
}

.police-actions .btn { margin-top: 0; }

.action-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}

/* Links */
a { color: #1f5fbf; }
a:hover { text-decoration: underline; }

/* Messages */
.msg-success {
  margin-top: 14px;
  background: var(--success-bg);
  color: var(--success-text);
  border-radius: 10px;
  padding: 10px 12px;
  text-align: left;
}

.msg-error {
  margin-top: 14px;
  background: var(--error-bg);
  color: var(--error-text);
  border-radius: 10px;
  padding: 10px 12px;
  text-align: left;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

thead {
  background: rgba(44, 62, 80, 0.9);
  color: #fff;
}

th, td {
  padding: 12px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
}

tr:hover td { background: #f9fafb; }

.table-scroll {
  max-height: 320px;
  overflow: auto;
  border-radius: 12px;
}

.police-center {
  max-width: 650px;
  margin: 0 auto;
}

/* Dashboard map */
.map-wrap {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.map-wrap iframe {
  width: 100%;
  height: 320px;
  border: 0;
}

/* Responsive */
@media (max-width: 600px) {
  .site-header__inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .container { width: 92vw; }
}