* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f5f5f5;
  color: #1a1a1a;
}

.hidden { display: none !important; }

.screen { min-height: 100vh; }

/* ── Login ─────────────────────────────────────────────── */
#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
}

.login-card {
  background: white;
  padding: 40px;
  border-radius: 12px;
  width: 360px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.login-card h1 {
  text-align: center;
  margin-bottom: 24px;
  font-size: 1.4rem;
}

.login-card input {
  display: block;
  width: 100%;
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
}

.login-card button {
  display: block;
  width: 100%;
  padding: 12px;
  background: #4361ee;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}

.login-card button:hover { background: #3a56d4; }

.error { color: #e74c3c; text-align: center; margin-top: 8px; font-size: 13px; }

/* ── Dashboard ─────────────────────────────────────────── */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

header h1 { font-size: 1.2rem; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-actions span { color: #666; font-size: 13px; }

#logout-btn {
  padding: 6px 16px;
  background: transparent;
  border: 1px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}

#logout-btn:hover { background: #f5f5f5; }

/* ── Search Bar ────────────────────────────────────────── */
.search-bar {
  display: flex;
  gap: 8px;
  padding: 12px 24px;
  background: white;
  border-bottom: 1px solid #eee;
  flex-wrap: wrap;
}

.search-bar input[type="text"] {
  flex: 1;
  min-width: 200px;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
}

.search-bar input[type="date"] {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
  width: 150px;
}

.search-bar button {
  padding: 8px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}

#search-btn {
  background: #4361ee;
  color: white;
}

#search-btn:hover { background: #3a56d4; }

.btn-clear {
  background: #e9ecef;
  color: #333;
}

.btn-clear:hover { background: #dee2e6; }

/* ── Tabs ──────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 0;
  padding: 0 24px;
  background: white;
  border-bottom: 1px solid #eee;
}

.tab {
  padding: 12px 24px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #666;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.tab.active { color: #4361ee; border-bottom-color: #4361ee; }
.tab:hover { color: #333; }

main { padding: 24px; }

/* ── Two-column layout ─────────────────────────────────── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.col-header {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e0e0e0;
  color: #333;
}

.card-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.empty-state {
  text-align: center;
  color: #999;
  padding: 40px 20px;
  font-size: 14px;
}

/* ── Card ──────────────────────────────────────────────── */
.mod-card {
  position: relative;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  cursor: pointer;
  transition: box-shadow 0.2s;
}

.mod-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.15); }

.mod-card-photo {
  height: 120px;
  background: #e0e0e0;
  background-size: cover;
  background-position: center;
}

.mod-card-body {
  padding: 10px 14px;
  padding-bottom: 14px;
}

.mod-card-body h3 {
  font-size: 14px;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mod-card-body .meta { color: #888; font-size: 11px; margin-top: 4px; }

.mod-card-body .card-location { color: #666; font-size: 11px; margin-top: 2px; }

/* ── Card action button (fixed bottom-right) ───────────── */
.card-action-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  padding: 6px 14px;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  transition: transform 0.15s, box-shadow 0.15s;
}

.card-action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}

.card-action-btn.approve {
  background: #28a745;
  color: white;
}

.card-action-btn.approve:hover { background: #218838; }

.card-action-btn.reject {
  background: #dc3545;
  color: white;
}

.card-action-btn.reject:hover { background: #c82333; }

/* ── Badges ────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  margin-right: 4px;
}

.badge-pending { background: #fff3cd; color: #856404; }
.badge-approved { background: #d4edda; color: #155724; }
.badge-rejected { background: #f8d7da; color: #721c24; }
.badge-active { background: #d4edda; color: #155724; }
.badge-inactive { background: #f8d7da; color: #721c24; }
.badge-category { background: #e0e7ff; color: #3730a3; }
.badge-hazard { background: #fff3cd; color: #856404; }

/* ── Detail Modal ──────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
}

.modal-content {
  position: relative;
  background: white;
  border-radius: 16px;
  width: 90%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: white;
  border: none;
  font-size: 24px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.photo-gallery {
  display: flex;
  gap: 4px;
  height: 240px;
  overflow: hidden;
}

.photo-gallery img {
  flex: 1;
  object-fit: cover;
  min-width: 0;
}

.review-map {
  height: 200px;
  background: #e0e0e0;
}

.review-info { padding: 20px 24px; }

.review-info h2 { margin-bottom: 8px; }

.review-info p { margin: 8px 0; color: #444; line-height: 1.5; }

.review-info .meta { color: #888; font-size: 13px; }

.rejection-info {
  margin-top: 12px;
  padding: 12px;
  background: #f8d7da;
  border-radius: 8px;
  color: #721c24;
  font-size: 13px;
}

.review-actions {
  padding: 16px 24px 24px;
  display: flex;
  gap: 12px;
  align-items: center;
  border-top: 1px solid #eee;
}

.btn-approve {
  padding: 10px 24px;
  background: #28a745;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

.btn-approve:hover { background: #218838; }

.reject-group {
  display: flex;
  gap: 8px;
  flex: 1;
}

.reject-group input {
  flex: 1;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 13px;
}

.btn-reject {
  padding: 10px 24px;
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

.btn-reject:hover { background: #c82333; }

/* ── Confirmation Modal ────────────────────────────────── */
.confirm-content {
  position: relative;
  background: white;
  border-radius: 12px;
  padding: 24px;
  width: 400px;
  max-width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  z-index: 1;
}

.confirm-content h3 { margin-bottom: 8px; }

.confirm-content p { color: #555; margin-bottom: 16px; font-size: 14px; }

.confirm-content input {
  display: block;
  width: 100%;
  padding: 10px;
  margin-bottom: 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 13px;
}

.confirm-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.btn-cancel {
  padding: 8px 20px;
  background: #e9ecef;
  color: #333;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}

.btn-cancel:hover { background: #dee2e6; }

.btn-danger {
  padding: 8px 20px;
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
}

.btn-danger:hover { background: #c82333; }

.btn-success {
  padding: 8px 20px;
  background: #28a745;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
}

.btn-success:hover { background: #218838; }

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
  .two-col { grid-template-columns: 1fr; }
  .search-bar { flex-direction: column; }
  .search-bar input[type="date"] { width: 100%; }
}
