:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --primary: #1b4b82;
  --primary-hover: #133760;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --ok: #15803d;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}
header {
  background: var(--primary);
  color: #fff;
  padding: 16px 24px;
}
.wrap {
  max-width: 1020px;
  margin: 0 auto;
}
.topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.brand {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
}
.brand small {
  display: block;
  font-size: 12px;
  font-weight: 400;
  opacity: 0.85;
}
nav a {
  color: #e5eef8;
  text-decoration: none;
  margin-left: 18px;
  font-size: 14px;
  padding-bottom: 4px;
}
nav a.active, nav a:hover {
  color: #fff;
  border-bottom: 2px solid #fff;
}
main { padding: 28px 24px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 20px;
}
h1 { margin-top: 0; font-size: 24px; color: #111827; }
h2 { font-size: 18px; margin-top: 0; color: #111827; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 12px;
  border-radius: 12px;
  background: #dcfce7;
  color: var(--ok);
  font-weight: 600;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
th { background: #f9fafb; font-weight: 600; }
input, select, textarea, button {
  font: inherit;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
}
button {
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
}
button:hover { background: var(--primary-hover); }
.form-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.form-row > * { flex: 1 1 200px; }
footer {
  border-top: 1px solid var(--border);
  padding: 20px 24px;
  color: var(--muted);
  font-size: 13px;
}

.hero-media {
  margin-top: 16px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #e5e7eb;
}
.hero-media img {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: cover;
}
.hero-caption {
  padding: 8px 12px;
  font-size: 13px;
  color: var(--muted);
  background: #f9fafb;
  border-top: 1px solid var(--border);
}
.cam-previews {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.cam-box {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #111827;
}
.cam-box img {
  display: block;
  width: 100%;
  height: 165px;
  object-fit: cover;
  opacity: 0.92;
}
.cam-osd {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  justify-content: space-between;
  font-family: monospace;
  font-size: 12px;
  color: #fff;
  background: rgba(0, 0, 0, 0.58);
  padding: 4px 8px;
  border-radius: 4px;
}
