/* ===== CSS Variables ===== */
:root {
  --bg-primary: #1a2e1a;
  --bg-secondary: #243524;
  --bg-card: #2a3f2a;
  --bg-input: #1e331e;
  --text-primary: #e8f0e8;
  --text-secondary: #a8c0a8;
  --text-muted: #6b8a6b;
  --accent: #4caf50;
  --accent-hover: #66bb6a;
  --accent-dark: #388e3c;
  --danger: #e53935;
  --danger-hover: #ef5350;
  --warning: #ff9800;
  --info: #29b6f6;
  --border: #3a5a3a;
  --shadow: rgba(0, 0, 0, 0.4);
  --nav-height: 60px;
  --topbar-height: 50px;
  --stand-open: #4caf50;
  --stand-occupied: #e53935;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

/* ===== Utility ===== */
.view {
  display: none;
}
.view.active-view {
  display: flex;
  flex-direction: column;
}

/* ===== iOS Install Banner ===== */
.ios-install-banner {
  position: fixed;
  bottom: 70px;
  left: 12px;
  right: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  z-index: 9998;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}
.ios-install-text {
  color: var(--text-primary);
  font-size: 13px;
  margin-bottom: 8px;
  line-height: 1.4;
}
.ios-install-text i {
  color: var(--info);
}
.ios-install-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ios-install-remember {
  color: var(--text-muted);
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.ios-install-remember input {
  width: auto;
  margin: 0;
}
.ios-install-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
}

/* ===== Offline Bar ===== */
.offline-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--warning);
  color: #000;
  text-align: center;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  z-index: 10000;
}

/* ===== Notification Toast ===== */
.notification {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 20px var(--shadow);
  z-index: 9999;
  font-size: 14px;
  border-left: 4px solid var(--accent);
  max-width: 90%;
  animation: slideDown 0.3s ease;
}
.notification.error {
  border-left-color: var(--danger);
}
@keyframes slideDown {
  from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ===== Spinner ===== */
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== Login View ===== */
#login-view {
  height: 100vh;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #0d1f0d 0%, #1a2e1a 50%, #243524 100%);
}
/* Splash / auth loading screen */
.splash-screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  z-index: 9999;
}

.login-container {
  text-align: center;
  padding: 40px 30px;
}
.login-logo {
  font-size: 64px;
  color: var(--accent);
  margin-bottom: 16px;
}
.login-title {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 4px;
}
.login-subtitle {
  color: var(--text-secondary);
  font-size: 16px;
  margin-bottom: 40px;
}
.google-login-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  color: #333;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: box-shadow 0.2s;
}
.google-login-btn img {
  width: 22px;
  height: 22px;
}
.google-login-btn:active {
  box-shadow: 0 2px 8px var(--shadow);
}
.login-error {
  margin-top: 20px;
  color: var(--danger);
  font-size: 14px;
  padding: 10px;
  background: rgba(229, 57, 53, 0.15);
  border-radius: 6px;
}
.login-loading {
  margin-top: 20px;
  color: var(--text-secondary);
}

/* ===== Top Bar ===== */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-secondary);
  padding: 0 16px;
  height: var(--topbar-height);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.top-bar-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
}
.top-bar-title i {
  margin-right: 6px;
}
.top-bar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-name {
  font-size: 13px;
  color: var(--text-secondary);
}
.icon-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  padding: 6px;
}
.icon-btn:active {
  color: var(--text-primary);
}

/* ===== App Container ===== */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

/* ===== Dashboard ===== */
#dashboard-view {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--nav-height) + 20px);
}

/* ===== Map ===== */
.map-container {
  position: relative;
  width: 100%;
  height: 40vh;
  min-height: 220px;
  flex-shrink: 0;
  touch-action: none;
}
.map {
  width: 100%;
  height: 100%;
}
.admin-map-container {
  height: 35vh;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  touch-action: none;
}

/* ===== Map Buttons ===== */
.map-btn-left {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 10;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: none;
  background: var(--bg-card);
  color: var(--accent);
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}
.map-btn-left:active {
  background: var(--bg-input);
}

.map-btn-stack {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.my-location-btn {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: none;
  background: #4285f4;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.my-location-btn:active {
  background: #3367d6;
}

.follow-btn {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: none;
  background: var(--danger);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.follow-btn:active {
  opacity: 0.8;
}
.follow-btn.active {
  background: var(--accent);
}

/* Blue Location Dot */
.location-dot {
  width: 16px;
  height: 16px;
  position: relative;
}
.location-dot-inner {
  width: 16px;
  height: 16px;
  background: #4285f4;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(66, 133, 244, 0.6);
  position: absolute;
  top: 0;
  left: 0;
}
.location-dot-pulse {
  width: 16px;
  height: 16px;
  background: rgba(66, 133, 244, 0.3);
  border-radius: 50%;
  position: absolute;
  top: 0;
  left: 0;
  animation: loc-pulse 2s ease-out infinite;
}
@keyframes loc-pulse {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(3); opacity: 0; }
}

/* ===== Dashboard Panel ===== */
.dashboard-panel {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
}
.panel-header h3 {
  font-size: 15px;
  font-weight: 600;
}
.panel-header h3 i {
  margin-right: 8px;
  color: var(--accent);
}
.badge {
  background: var(--accent);
  color: #fff;
  border-radius: 12px;
  padding: 2px 10px;
  font-size: 13px;
  font-weight: 700;
}
.on-property-list {
  padding: 0 16px 12px;
}
.empty-message {
  color: var(--text-muted);
  font-size: 14px;
  font-style: italic;
}
.on-property-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  background: var(--bg-card);
}
.on-property-item:last-child {
  margin-bottom: 0;
}
.on-property-item .member-name {
  font-weight: 600;
  font-size: 14px;
}
.on-property-item .stand-label {
  color: var(--text-secondary);
  font-size: 13px;
}
.on-property-item .check-in-time {
  color: var(--text-muted);
  font-size: 12px;
}
.on-property-me {
  flex-wrap: wrap;
}
.on-property-actions {
  display: flex;
  gap: 8px;
  width: 100%;
  margin-top: 6px;
}
.on-property-actions .btn {
  flex: 1;
  justify-content: center;
  padding: 6px 10px;
  font-size: 12px;
}

/* ===== Active Hunt View ===== */
#hunt-view {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--nav-height) + 20px);
}
.hunt-view-content {
  text-align: center;
}
.hunt-header {
  margin-bottom: 20px;
}
.hunt-timer-large {
  display: block;
  font-size: 48px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  margin-top: 8px;
}
.hunt-stand-card {
  background: var(--bg-card);
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 16px;
  margin-bottom: 20px;
}
.hunt-stand-name-lg {
  font-size: 18px;
  font-weight: 600;
}
.hunt-stand-name-lg i {
  color: var(--accent);
  margin-right: 8px;
}
.hunt-action-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}
.btn-lg {
  padding: 14px 20px;
  font-size: 16px;
  justify-content: center;
}
.sightings-summary {
  background: var(--bg-card);
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 14px 16px;
  text-align: left;
}
.sightings-summary h4 {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.sightings-list {
  list-style: none;
}
.sightings-list li {
  font-size: 13px;
  padding: 4px 0;
  color: var(--text-primary);
}
.sightings-list li i {
  color: var(--accent);
  margin-right: 6px;
  width: 16px;
  text-align: center;
}
.hunt-nav-active {
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  border-radius: 6px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:active {
  background: var(--accent-hover);
}
.btn-secondary {
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:active {
  background: var(--border);
}
.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:active {
  background: var(--danger-hover);
}

/* ===== Bottom Navigation ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  height: var(--nav-height);
  z-index: 1000;
}
.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  transition: color 0.2s;
  padding: 0;
}
.nav-btn i {
  font-size: 20px;
}
.nav-btn.active {
  color: var(--accent);
}
.nav-btn:active {
  color: var(--accent-hover);
}

/* ===== View Content (scrollable views) ===== */
#stats-view, #admin-view {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--nav-height) + 20px);
  padding-top: 0;
}
.view-content {
  padding: 16px;
  padding-top: 16px;
}
.view-title {
  font-size: 20px;
  margin-bottom: 16px;
}
.view-title i {
  color: var(--accent);
  margin-right: 8px;
}

/* ===== Stats ===== */
.stats-filters {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}
.filter-group {
  flex: 1;
}
.filter-group label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.filter-group select {
  width: 100%;
  padding: 8px 10px;
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
}
.stats-card {
  background: var(--bg-card);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
}
.stats-card h3 {
  font-size: 15px;
  margin-bottom: 4px;
}
.stats-card h3 i {
  color: var(--accent);
  margin-right: 6px;
}
.stats-description {
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 12px;
}
.chart-container {
  position: relative;
  width: 100%;
  height: 220px;
}
.chart-container canvas {
  max-height: 100%;
}
.summary-table {
  font-size: 14px;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.summary-row:last-child {
  border-bottom: none;
}
.summary-label {
  color: var(--text-secondary);
}
.summary-value {
  font-weight: 600;
}

/* ===== Admin ===== */
.admin-section {
  margin-bottom: 24px;
}
.admin-section h3 {
  font-size: 16px;
  margin-bottom: 8px;
}
.admin-section h3 i {
  color: var(--accent);
  margin-right: 6px;
}
.admin-hint {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 10px;
}
.admin-list {
  margin-top: 12px;
}
.admin-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--bg-card);
  border-radius: 8px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
}
.admin-list-item .item-info {
  flex: 1;
}
.admin-list-item .item-name {
  font-weight: 600;
  font-size: 14px;
}
.admin-list-item .item-detail {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 2px;
}
.admin-list-item .item-actions {
  display: flex;
  gap: 6px;
}
.admin-list-item .item-actions button {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 6px;
}
.admin-list-item .item-actions button:active {
  color: var(--text-primary);
}

/* Add Member Form */
.add-member-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.add-member-form input {
  flex: 1;
  min-width: 120px;
  padding: 8px 12px;
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
}

/* History */
.history-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.history-filters select, .history-filters input {
  flex: 1;
  min-width: 100px;
  padding: 8px 10px;
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
}
.history-list .admin-list-item {
  flex-direction: column;
  align-items: flex-start;
}
.history-item-header {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 4px;
}
.history-item-details {
  font-size: 12px;
  color: var(--text-muted);
}
.admin-force-checkout {
  margin-top: 8px;
}

/* ===== Modals ===== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 5000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.modal-content {
  background: var(--bg-secondary);
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-width: 500px;
  max-height: 85vh;
  overflow-y: auto;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 {
  font-size: 17px;
}
.modal-header h3 i {
  margin-right: 8px;
  color: var(--accent);
}
.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
}
.modal-body {
  padding: 16px;
}
.modal-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Form Groups */
.form-group {
  margin-bottom: 14px;
}
.form-group label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}
.form-group textarea {
  min-height: 60px;
  resize: vertical;
}
.form-group input[type="file"] {
  padding: 8px;
  font-size: 13px;
}

/* Photo Preview */
.photo-preview {
  margin-top: 8px;
  border-radius: 8px;
  overflow: hidden;
}
/* Hidden file inputs (visually hidden but accessible for mobile) */
.file-input-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
  pointer-events: none;
}

/* Photo button row */
.photo-btn-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.photo-btn-row .btn {
  flex: 1;
}

.photo-preview img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
}

/* Stand Info */
.stand-info-photo {
  margin-bottom: 12px;
  border-radius: 8px;
  overflow: hidden;
}
.stand-info-photo img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
}
.stand-info-notes {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 10px;
}
.stand-info-status {
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 8px;
}
.stand-info-status.open {
  background: rgba(76, 175, 80, 0.15);
  color: var(--stand-open);
}
.stand-info-status.occupied {
  background: rgba(229, 57, 53, 0.15);
  color: var(--stand-occupied);
}
.occupied-msg {
  color: var(--danger);
  font-size: 14px;
  font-weight: 600;
}

/* Check-In Hint Banner */
.checkin-hint-banner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: auto;
  min-width: 75%;
  background: rgba(255, 255, 255, 0.97);
  border: 2px solid #ff9800;
  border-radius: 10px;
  animation: hint-pulse 2s ease-in-out infinite;
  padding: 14px 24px;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
@keyframes hint-pulse {
  0%, 100% { box-shadow: 0 4px 12px rgba(0,0,0,0.4); border-color: #ff9800; }
  50% { box-shadow: 0 4px 20px rgba(255, 152, 0, 0.6); border-color: #ffb74d; }
}
.checkin-hint-text {
  color: #333;
  font-size: 13px;
  margin-bottom: 8px;
}
.checkin-hint-text i {
  color: #e65100;
  margin-right: 4px;
}
.checkin-hint-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.checkin-hint-remember {
  color: #555;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.checkin-hint-remember input {
  width: auto;
  margin: 0;
}
.checkin-hint-close {
  background: none;
  border: none;
  color: #555;
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
}
.checkin-hint-sub {
  width: 100%;
  font-size: 11px;
  font-weight: 400;
  color: rgba(255, 152, 0, 0.7);
  margin-top: 0;
}

/* Activity Check-In Button */
.btn-activity {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 600;
  background: rgba(255, 152, 0, 0.15);
  color: #ff9800;
  border: 2px dashed #ff9800;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-activity:active {
  background: rgba(255, 152, 0, 0.3);
}
.btn-activity i {
  font-size: 18px;
}

/* Activity Type Grid */
.activity-type-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}
.activity-type-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}
.activity-type-btn i {
  font-size: 20px;
}
.activity-type-btn span {
  font-size: 11px;
}
.activity-type-btn.selected {
  border-color: #ff9800;
  color: #ff9800;
  background: rgba(255, 152, 0, 0.1);
}

/* Sighting Type Grid */
.sighting-type-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.sighting-type-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}
.sighting-type-btn i {
  font-size: 20px;
}
.sighting-emoji {
  font-size: 24px;
  line-height: 1;
}
.sighting-icon-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: brightness(0) invert(60%);
}
.sighting-type-btn.selected .sighting-icon-img {
  filter: brightness(0) saturate(100%) invert(55%) sepia(65%) saturate(500%) hue-rotate(93deg) brightness(95%) contrast(90%);
}
.sighting-type-btn span {
  font-size: 11px;
}
.sighting-type-btn.selected {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(76, 175, 80, 0.1);
}

/* Sighting Thumbnail */
.sighting-thumb {
  display: block;
  max-width: 160px;
  max-height: 120px;
  border-radius: 6px;
  margin-top: 6px;
  object-fit: cover;
}
.sighting-stats-thumb {
  display: block;
  max-width: 120px;
  max-height: 90px;
  border-radius: 4px;
  margin-top: 4px;
  object-fit: cover;
}

/* Photo Lightbox */
.photo-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  cursor: pointer;
  padding: 20px;
}
.photo-lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

/* Count Picker */
.count-picker {
  display: flex;
  align-items: center;
  gap: 0;
  width: 140px;
}
.count-btn {
  width: 40px;
  height: 40px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.count-btn:first-child {
  border-radius: 6px 0 0 6px;
}
.count-btn:last-child {
  border-radius: 0 6px 6px 0;
}
.count-picker input {
  width: 60px;
  text-align: center;
  border-radius: 0;
  border-left: none;
  border-right: none;
  height: 40px;
  padding: 0;
  -moz-appearance: textfield;
}
.count-picker input::-webkit-outer-spin-button,
.count-picker input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Harvest Toggle */
.harvest-toggle {
  display: flex;
  gap: 10px;
  margin: 12px 0;
}
.harvest-choice {
  flex: 1;
}
.harvest-choice.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.harvest-form {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* ===== Custom Map Markers ===== */
.stand-marker {
  text-align: center;
  cursor: pointer;
  position: relative;
}
.stand-marker-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  box-shadow: 0 2px 6px var(--shadow);
  margin: 0 auto;
}
.stand-marker-icon.open {
  background: var(--stand-open);
}
.stand-marker-icon.occupied {
  background: var(--stand-occupied);
}
.stand-marker-label {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  white-space: nowrap;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 2px;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

/* ===== Safe Area (notch support) ===== */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .bottom-nav {
    padding-bottom: env(safe-area-inset-bottom);
    height: calc(var(--nav-height) + env(safe-area-inset-bottom));
  }
  #dashboard-view {
    padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom) + 20px);
  }
  #stats-view, #admin-view {
    padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom) + 20px);
  }
}
