* { margin: 0; padding: 0; box-sizing: border-box; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

html, body {
  background: #05070c;
  color: #e8ecf3;
  font-family: 'Segoe UI', Roboto, system-ui, sans-serif;
  min-height: 100vh;
  max-width: 100vw;
  overflow-x: hidden;
  overscroll-behavior: none;
  touch-action: pan-y;
}

body.modal-open {
  position: fixed;
  inset: 0;
  overflow: hidden;
  width: 100%;
}

input, textarea, select {
  font-size: 16px !important;
}

.admin-app { max-width: 1200px; margin: 0 auto; padding: 20px; }

.admin-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.back-link { color: #8b95a8; text-decoration: none; font-size: 0.9rem; font-weight: 600; }
.back-link:hover { color: #fff; }
.admin-header h1 { font-size: 1.3rem; }

.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.search-bar input {
  flex: 1 1 160px;
  min-width: 0;
  background: #0e1420;
  border: 1px solid #1e2636;
  border-radius: 12px;
  padding: 13px 16px;
  color: #fff;
  font-size: 0.94rem;
}
.search-bar input:focus { outline: none; border-color: #22d3ee; }
.result-count { color: #8b95a8; font-size: 0.85rem; white-space: nowrap; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.card {
  background: #0e1420;
  border: 1px solid #1e2636;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease;
}
.card:hover { transform: translateY(-3px); border-color: #22d3ee; }

.card-media { width: 100%; aspect-ratio: 4/3; background: #000; position: relative; }
.card-media img, .card-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-media .type-badge {
  position: absolute; top: 8px; right: 8px;
  background: rgba(0,0,0,0.6); color: #fff;
  font-size: 0.68rem; font-weight: 700;
  padding: 3px 8px; border-radius: 999px;
}

.card-body { padding: 12px; }
.card-object { font-weight: 700; font-size: 0.9rem; color: #ffb84d; margin-bottom: 4px; }
.card-address { font-size: 0.82rem; color: #e2e8f0; margin-bottom: 6px; line-height: 1.4; }
.card-meta { font-size: 0.72rem; color: #8b95a8; display: flex; justify-content: space-between; }

.empty-state {
  text-align: center;
  color: #8b95a8;
  padding: 60px 20px;
  font-size: 0.95rem;
}

.lightbox {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 100;
  padding: 76px 16px 40px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.lightbox-content { max-width: 900px; margin: 0 auto; text-align: center; }
.lightbox-content img, .lightbox-content video { max-width: 100%; max-height: 55vh; border-radius: 10px; }
.lightbox-info { color: #e8ecf3; margin-top: 16px; font-size: 0.9rem; line-height: 1.7; text-align: left; display: block; max-width: 100%; }
.lightbox-info b { color: #ffb84d; }

.gis-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  background: rgba(0,168,89,0.14);
  border: 1px solid rgba(0,168,89,0.4);
  color: #3ddc84;
  padding: 8px 14px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
}
.gis-link:hover { background: rgba(0,168,89,0.22); }
.gis-logo-img { width: 20px; height: 20px; border-radius: 5px; display: block; }
.lightbox-close {
  position: fixed; top: 20px; right: 24px;
  background: rgba(255,255,255,0.12); color: #fff;
  border: none; width: 40px; height: 40px; border-radius: 50%;
  font-size: 1.1rem;
  z-index: 101;
}

.tabs { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.tab-btn {
  border: 1px solid #1e2636;
  background: #0e1420;
  color: #8b95a8;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.88rem;
}
.tab-btn.active { background: #fff; color: #111; border-color: #fff; }

.users-list { display: flex; flex-direction: column; gap: 10px; }
.user-row {
  background: #0e1420;
  border: 1px solid #1e2636;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.user-row input {
  background: #131a28;
  border: 1px solid #1e2636;
  border-radius: 8px;
  padding: 9px 12px;
  color: #fff;
  font-size: 0.88rem;
}
.user-row .u-name { flex: 1.4; min-width: 160px; }
.user-row .u-profession { flex: 1; min-width: 140px; }
.user-row .u-meta { color: #8b95a8; font-size: 0.78rem; flex: 1; min-width: 140px; }
.user-row .admin-badge {
  background: rgba(255,184,77,0.15); color: #ffb84d;
  font-size: 0.7rem; font-weight: 700; padding: 3px 8px; border-radius: 999px;
}
.user-save-btn {
  border: none; background: linear-gradient(135deg, #22d3ee, #0ea5c4);
  color: #05070c; font-weight: 700; padding: 9px 16px; border-radius: 8px; font-size: 0.82rem;
}
.user-save-btn:disabled { opacity: 0.4; }

.lightbox-delete {
  position: fixed; top: 20px; left: 24px;
  background: rgba(255,59,78,0.85); color: #fff;
  border: none; padding: 10px 16px; border-radius: 10px;
  font-size: 0.85rem; font-weight: 700;
  z-index: 101;
}

.select-btn {
  border: 1px solid #1e2636;
  background: #0e1420;
  color: #e2e8f0;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
}
.select-btn.active { background: #22d3ee; color: #05070c; border-color: #22d3ee; }

.bulk-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #0e1420;
  border: 1px solid #1e2636;
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 0.86rem;
  color: #e2e8f0;
  flex-wrap: wrap;
}
.bulk-btn {
  border: none;
  background: rgba(255,255,255,0.1);
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.8rem;
}
.bulk-delete-btn { background: rgba(255,59,78,0.85); margin-left: auto; }

.card { position: relative; }
.card-checkbox {
  position: absolute;
  top: 8px; left: 8px;
  width: 24px; height: 24px;
  border-radius: 6px;
  border: 2px solid rgba(255,255,255,0.7);
  background: rgba(0,0,0,0.4);
  z-index: 5;
  display: none;
  align-items: center; justify-content: center;
  color: #fff; font-weight: 900; font-size: 0.9rem;
}
.select-mode .card-checkbox { display: flex; }
.card.selected .card-checkbox { background: #22d3ee; border-color: #22d3ee; color: #05070c; }
.card.selected { outline: 2px solid #22d3ee; }

.admin-toggle-btn {
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.78rem;
  white-space: nowrap;
}
.admin-toggle-btn.grant { background: rgba(255,184,77,0.18); color: #ffb84d; }
.admin-toggle-btn.revoke { background: rgba(255,59,78,0.15); color: #ff6b6b; }

.status-badge {
  font-size: 0.7rem; font-weight: 700; padding: 3px 8px; border-radius: 999px;
  margin-left: 6px; white-space: nowrap;
}
.status-pending { background: rgba(255,184,77,0.15); color: #ffb84d; }
.status-approved { background: rgba(63,191,95,0.15); color: #3fbf5f; }
.status-rejected { background: rgba(255,59,78,0.15); color: #ff6b6b; }

.status-btn {
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.78rem;
  white-space: nowrap;
}
.approve-btn { background: rgba(63,191,95,0.18); color: #3fbf5f; }
.reject-btn { background: rgba(255,59,78,0.15); color: #ff6b6b; }

.user-delete-btn {
  border: none;
  background: rgba(255,59,78,0.85);
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.78rem;
}

.hidden { display: none !important; }
