:root {
  --blue: #2563eb;
  --orange: #ea580c;
  --green: #16a34a;
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --danger: #dc2626;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

header.app-header {
  background: #111827;
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
header.app-header h1 { font-size: 18px; margin: 0; }
header.app-header nav { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
header.app-header nav a {
  color: #d1d5db;
  text-decoration: none;
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 6px;
}
header.app-header nav a:hover, header.app-header nav a.active {
  background: #374151;
  color: #fff;
}

main { max-width: 960px; margin: 0 auto; padding: 16px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 16px;
}

h2 { font-size: 20px; margin-top: 0; }

label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 14px; }

input[type="text"], input[type="file"] {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 16px; /* >=16px avoids iOS zoom-on-focus */
  background: #fff;
}

button, .btn {
  display: inline-block;
  border: none;
  border-radius: 8px;
  padding: 12px 18px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  background: var(--blue);
  color: #fff;
  text-decoration: none;
  text-align: center;
}
button:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-blue { background: var(--blue); }
.btn-orange { background: var(--orange); }
.btn-grey { background: #4b5563; }
button.full { width: 100%; }

.muted { color: var(--muted); font-size: 14px; }
.error { color: var(--danger); font-weight: 600; }

.stats { display: flex; gap: 12px; flex-wrap: wrap; }
.stat {
  flex: 1 1 120px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
}
.stat .num { font-size: 28px; font-weight: 800; }
.stat .lbl { font-size: 13px; color: var(--muted); }
.stat.placed .num { color: var(--blue); }
.stat.posted .num { color: var(--orange); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); }
th { background: #f9fafb; font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); }
.bar { height: 8px; border-radius: 4px; background: #e5e7eb; overflow: hidden; display: flex; }
.bar .b-placed { background: var(--blue); }
.bar .b-posted { background: var(--orange); }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge.PLACED { background: #dbeafe; color: var(--blue); }
.badge.POSTED { background: #ffedd5; color: var(--orange); }
.badge.UNCERTAIN { background: #fef9c3; color: #a16207; }

.review-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.review-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.review-card img { width: 100%; height: 220px; object-fit: cover; background: #000; display: block; }
.review-card .body { padding: 12px; }
.review-card .actions { display: flex; gap: 8px; margin-top: 10px; }
.review-card .actions button { flex: 1; padding: 10px; }

#map { height: 70vh; min-height: 400px; border-radius: 12px; }
.legend { display: flex; gap: 16px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.legend .item { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.2); }
.dot.blue { background: var(--blue); }
.dot.orange { background: var(--orange); }
.dot.grey { background: #9ca3af; }
.swatch-green { width: 16px; height: 16px; background: rgba(22,163,74,.35); border: 2px solid var(--green); display: inline-block; }

.spinner { display: inline-block; width: 18px; height: 18px; border: 3px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

.home-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.home-links a { padding: 22px; font-size: 17px; }

/* Role chooser */
.chooser { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.chooser a { display: block; text-decoration: none; color: inherit; border: 1px solid var(--border); border-radius: 14px; padding: 28px; text-align: center; background: var(--card); }
.chooser a:hover { border-color: var(--blue); box-shadow: 0 4px 14px rgba(0,0,0,.06); }
.chooser .emoji { font-size: 40px; }
.chooser h3 { margin: 10px 0 4px; }

/* Date filter bar */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.filters .f { display: flex; flex-direction: column; }
.filters label { margin-bottom: 4px; }
.filters input, .filters select { padding: 8px; font-size: 15px; border: 1px solid var(--border); border-radius: 8px; }
.filters input[type="date"] { min-width: 150px; }

/* Forms / lists used in admin */
.row-actions { display: flex; gap: 6px; }
.row-actions button { padding: 6px 10px; font-size: 13px; }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.inline-form .f { flex: 1 1 180px; }
.danger { background: var(--danger); }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: none; }
.list-item .grow { flex: 1; }
.pill { display:inline-block; padding:2px 10px; border-radius:999px; background:#eef2ff; color:#3730a3; font-size:12px; font-weight:600;}

/* Login */
.login-wrap { max-width: 380px; margin: 60px auto; }

.dup-compare { display: flex; gap: 8px; }
.dup-compare figure { flex: 1; margin: 0; }
.dup-compare img { width: 100%; height: 130px; object-fit: cover; border-radius: 6px; background:#000; }
.dup-compare figcaption { font-size: 11px; color: var(--muted); text-align: center; margin-top: 2px; }
.banner { background:#fffbeb; border:1px solid #fde68a; color:#92400e; padding:10px 14px; border-radius:8px; font-size:14px; margin-bottom:14px;}
