:root {
  --bg: #14213d;
  --panel: #1b2c52;
  --panel-alt: #182648;
  --accent: #d03026;
  --accent-navy: #243c80;
  --text: #f4f5f8;
  --muted: #a7b2d1;
  --border: #2c3f70;
  --heading-font: 'Alatsi', Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Open Sans', -apple-system, sans-serif;
}
a { color: #8fb4f5; }

header.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--panel);
  border-bottom: 3px solid var(--accent);
}
header.admin-header h1 {
  font-family: var(--heading-font);
  font-weight: 400;
  font-size: 18px;
  margin: 0;
}
header.admin-header nav a {
  color: var(--text);
  text-decoration: none;
  margin-left: 16px;
  font-size: 14px;
}
header.admin-header nav a:hover { color: var(--accent); }

.container { max-width: 1100px; margin: 0 auto; padding: 24px 20px; }
.auth-container { max-width: 420px; margin: 60px auto; padding: 32px; background: var(--panel); border-radius: 10px; border-top: 3px solid var(--accent); }
.auth-container h1 { font-family: var(--heading-font); font-weight: 400; font-size: 22px; }

.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; font-size: 14px; }
.flash-error { background: rgba(208,48,38,0.2); border: 1px solid var(--accent); }
.flash-success { background: rgba(60,150,90,0.2); border: 1px solid #3c965a; }

label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 4px; }
input[type=text], input[type=password], input[type=number], input[type=file], textarea, select {
  width: 100%;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}
textarea { min-height: 120px; resize: vertical; }

button, .btn {
  background: var(--accent);
  border: none;
  color: white;
  padding: 9px 18px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button.secondary, .btn.secondary { background: var(--accent-navy); }
button.danger { background: #7a1f1f; }
button:disabled { opacity: 0.35; cursor: not-allowed; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: 11px; }

.filter-row th { padding: 6px 6px 10px; }
.filter-row input, .filter-row select {
  width: 100%;
  padding: 6px 8px;
  font-size: 12px;
  text-transform: none;
  font-weight: 400;
}
.filter-row input::placeholder { color: var(--muted); opacity: 0.7; }
tr:hover td { background: rgba(255,255,255,0.03); }

.badge { display: inline-block; background: var(--accent-navy); color: white; border-radius: 4px; padding: 2px 8px; font-size: 11px; }
.badge.warn { background: #a05a1a; }

.filterbar { display: flex; gap: 10px; margin-bottom: 16px; }
.filterbar input, .filterbar select { width: auto; flex: 0 0 240px; }

.pagination { display: flex; gap: 6px; margin-top: 16px; }
.pagination a { color: var(--text); border: 1px solid var(--border); border-radius: 4px; padding: 4px 10px; text-decoration: none; font-size: 13px; }
.pagination a.active { background: var(--accent); border-color: var(--accent); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.form-grid .full { grid-column: 1 / -1; }

.qr-box { text-align: center; background: white; padding: 16px; border-radius: 8px; display: inline-block; }
.secret-code { font-family: monospace; font-size: 15px; letter-spacing: 2px; background: var(--panel-alt); padding: 8px; border-radius: 6px; display: block; margin: 8px 0; word-break: break-all; }

.image-grid { display: flex; flex-wrap: wrap; gap: 12px; margin: 12px 0; }
.image-card { width: 140px; background: var(--panel-alt); border-radius: 6px; overflow: hidden; border: 1px solid var(--border); }
.image-card img { width: 100%; height: 100px; object-fit: cover; display: block; }
.image-card .cap { padding: 6px; font-size: 11px; color: var(--muted); }
.image-card form { padding: 0 6px 6px; }
.image-card button { width: 100%; font-size: 11px; padding: 4px; }

#admin-map { height: 320px; border-radius: 8px; margin: 8px 0; }

.chip-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chip { background: var(--accent-navy); border-radius: 14px; padding: 4px 10px 4px 12px; font-size: 12px; display: flex; align-items: center; gap: 6px; }
.chip button { background: none; border: none; color: white; cursor: pointer; padding: 0; font-size: 13px; }

.checkbox-list { max-height: 220px; overflow-y: auto; border: 1px solid var(--border); border-radius: 6px; padding: 8px; background: var(--panel-alt); }
.checkbox-list label { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 13px; margin: 4px 0; }
.checkbox-list input { width: auto; }

.search-results { border: 1px solid var(--border); border-radius: 6px; margin-top: 4px; max-height: 180px; overflow-y: auto; background: var(--panel-alt); }
.search-results div { padding: 6px 10px; cursor: pointer; font-size: 13px; }
.search-results div:hover { background: var(--accent-navy); }
