* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.app { display: flex; flex-direction: column; height: 100vh; }
.topbar {
  background: #2c3e50; color: white; padding: 12px 16px;
  display: flex; justify-content: space-between; align-items: center;
}
.topbar h1 { font-size: 1.2rem; }
.admin-link { color: #f39c12; text-decoration: none; font-size: 0.9rem; }
#viewDiv { flex: 1; min-height: 40vh; }
.report-panel {
  background: white; padding: 16px; border-top: 2px solid #ecf0f1;
  overflow-y: auto; max-height: 50vh;
}
.report-panel h2 { font-size: 1rem; margin-bottom: 8px; color: #2c3e50; }
.hint { color: #7f8c8d; font-size: 0.85rem; margin-bottom: 12px; }
.coords {
  background: #ecf0f1; padding: 8px; border-radius: 4px;
  font-family: monospace; font-size: 0.85rem; margin-bottom: 12px;
}
form label {
  display: block; margin-bottom: 12px; font-size: 0.9rem; color: #34495e;
}
form input, form select, form textarea {
  width: 100%; padding: 8px; margin-top: 4px;
  border: 1px solid #bdc3c7; border-radius: 4px; font-size: 0.95rem;
  font-family: inherit;
}
button {
  width: 100%; padding: 12px; background: #27ae60; color: white;
  border: none; border-radius: 4px; font-size: 1rem; font-weight: bold;
  cursor: pointer;
}
button:disabled { background: #95a5a6; cursor: not-allowed; }
.status { margin-top: 12px; padding: 8px; border-radius: 4px; font-size: 0.9rem; }
.status.pending { background: #f4f6f6; color: #7f8c8d; }
.status.success { background: #d5f5e3; color: #196f3d; }
.status.error { background: #fadbd8; color: #922b21; }

@media (min-width: 768px) {
  .app { flex-direction: row; }
  #viewDiv { flex: 2; }
  .report-panel { flex: 1; max-height: 100vh; border-left: 2px solid #ecf0f1; border-top: none; }
}

/* ===== Photo preview ===== */
.photo-preview { margin-top: 8px; }

/* ===== Login ===== */
.login-screen {
  display: flex; align-items: center; justify-content: center;
  padding: 40px 20px; background: #ecf0f1; flex: 1;
}
.login-box {
  background: white; padding: 32px; border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1); max-width: 400px; width: 100%;
}
.login-box h2 { margin-bottom: 8px; color: #2c3e50; }

/* ===== Admin toolbar ===== */
.admin-toolbar {
  background: #34495e; padding: 12px 16px;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px;
}
.filter-row { display: flex; gap: 12px; align-items: center; color: white; font-size: 0.9rem; }
.filter-row select { padding: 4px 8px; border-radius: 4px; border: 1px solid #7f8c8d; margin-left: 4px; }
.view-toggle { display: flex; }
.toggle-btn {
  background: #7f8c8d; color: white; border: none; padding: 6px 14px;
  cursor: pointer; font-size: 0.9rem; width: auto;
}
.toggle-btn:first-child { border-radius: 4px 0 0 4px; }
.toggle-btn:last-child { border-radius: 0 4px 4px 0; }
.toggle-btn.active { background: #f39c12; }
.text-btn {
  background: #ecf0f1; color: #2c3e50; padding: 6px 12px;
  font-size: 0.85rem; width: auto; border: 1px solid #bdc3c7;
}

/* ===== Table view ===== */
.admin-view { padding: 12px 16px; overflow: auto; flex: 1; }
.report-count { padding: 8px 0; color: #7f8c8d; font-size: 0.9rem; }
.table-wrap { overflow-x: auto; background: white; border-radius: 4px; }
#reportsTable { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
#reportsTable th, #reportsTable td { padding: 8px; text-align: left; border-bottom: 1px solid #ecf0f1; }
#reportsTable th { background: #ecf0f1; font-weight: bold; }
#reportsTable td.sev-high { color: #c0392b; font-weight: bold; }
#reportsTable td.sev-medium { color: #d68910; }
#reportsTable td.sev-low { color: #7d6608; }
#reportsTable select, #reportsTable input { padding: 4px; font-size: 0.85rem; width: auto; }

/* ===== Map view (admin) ===== */
#adminMap { width: 100%; height: 70vh; border: 1px solid #ecf0f1; border-radius: 4px; }
