/* ===== CSS Variables ===== */
:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #21262d;
  --bg-input: #0d1117;
  --border: #30363d;
  --border-subtle: #21262d;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #484f58;
  --accent: #d97706;
  --accent-hover: #b45309;
  --accent-dim: rgba(217, 119, 6, 0.15);
  --success: #1a7f37;
  --success-bg: rgba(35, 134, 54, 0.15);
  --success-text: #3fb950;
  --danger: #b91c1c;
  --danger-bg: rgba(218, 54, 51, 0.15);
  --danger-text: #f85149;
  --warning-bg: rgba(158, 106, 3, 0.2);
  --warning-text: #d29922;
  --info-bg: rgba(31, 111, 235, 0.15);
  --info-text: #58a6ff;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.6);
  --nav-height: 60px;
  --bottom-nav-height: 68px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

button { cursor: pointer; font-family: var(--font); }

/* ===== Layout ===== */
.main-content {
  padding: 16px;
  padding-top: calc(var(--nav-height) + 16px);
  padding-bottom: calc(var(--bottom-nav-height) + 16px);
  max-width: 900px;
  margin: 0 auto;
}

/* ===== Top Nav ===== */
.topnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 8px;
  z-index: 100;
}

.nav-brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent) !important;
  text-decoration: none !important;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-links {
  display: none;
  gap: 4px;
  flex: 1;
  margin-left: 16px;
}

.nav-link {
  color: var(--text-secondary) !important;
  text-decoration: none !important;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.nav-link:hover { background: var(--bg-tertiary); color: var(--text-primary) !important; }
.nav-link.active { background: var(--accent-dim); color: var(--accent) !important; }
.nav-link.nav-admin { color: var(--warning-text) !important; }

.nav-user {
  display: none;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  flex-shrink: 0;
}
.nav-username { color: var(--text-secondary); font-size: 0.9rem; }

.btn-link {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding: 4px 0;
  cursor: pointer;
}
.btn-link:hover { color: var(--text-primary); }

@media (min-width: 768px) {
  .nav-links { display: flex; }
  .nav-user { display: flex; }
  .bottomnav { display: none; }
  .main-content {
    padding-bottom: 32px;
  }
}

/* ===== Bottom Nav ===== */
.bottomnav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--bottom-nav-height);
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bn-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 12px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: color 0.15s;
  flex: 1;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}
.bn-item:hover, .bn-item.active { color: var(--accent); text-decoration: none; }
.bn-icon { font-size: 1.4rem; line-height: 1; }
.bn-label { font-size: 0.65rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.03em; }

/* ===== Cards ===== */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.card-action {
  font-size: 0.85rem;
  color: var(--accent);
}

.card-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 12px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
}

.btn:active { transform: scale(0.97); }
.btn:hover { text-decoration: none; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #15652d; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #991b1b; }

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--text-secondary); color: var(--text-primary); }

.btn-lg { padding: 14px 24px; font-size: 1.05rem; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-full { width: 100%; }

.btn-icon {
  background: none;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-secondary);
  transition: color 0.15s;
}
.btn-icon:hover { color: var(--text-primary); }
.btn-icon-danger:hover { color: var(--danger-text); }

/* ===== Forms ===== */
.form-group { margin-bottom: 12px; }
.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 1rem;
  font-family: var(--font);
  transition: border-color 0.15s;
  -webkit-appearance: none;
}
.form-input:focus { outline: none; border-color: var(--accent); }
.form-input::placeholder { color: var(--text-muted); }

.form-textarea { resize: vertical; min-height: 80px; }
.form-select { cursor: pointer; }

.form-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.form-row .form-input.form-select { flex: 1; }
.form-row .btn { flex-shrink: 0; align-self: flex-end; }

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  cursor: pointer;
}
.form-check input { width: 16px; height: 16px; cursor: pointer; accent-color: var(--accent); }

.flex-1 { flex: 1; }

/* ===== Page Header ===== */
.page-header {
  margin-bottom: 16px;
}
.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.page-date { color: var(--text-secondary); font-size: 0.9rem; }

.page-header-back { margin-bottom: 12px; }
.back-link { color: var(--text-secondary); font-size: 0.9rem; }
.back-link:hover { color: var(--text-primary); }

/* ===== Login Page ===== */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background: var(--bg-primary);
}

.login-container {
  width: 100%;
  max-width: 380px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px 28px;
  box-shadow: var(--shadow-lg);
}

.login-logo {
  font-size: 3.5rem;
  text-align: center;
  margin-bottom: 8px;
}

.login-title {
  text-align: center;
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.login-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.login-form { margin-top: 4px; }

.login-note {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 20px;
}

/* ===== Alert Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-overlay.hidden { display: none; }

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.alert-modal { border-color: var(--danger-text); }

.modal-icon { font-size: 3rem; margin-bottom: 12px; }
.modal h2 { font-size: 1.4rem; margin-bottom: 12px; }

.alert-text {
  color: var(--text-primary);
  font-size: 1rem;
  line-height: 1.6;
  background: var(--danger-bg);
  border: 1px solid var(--danger-text);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 10px;
  text-align: left;
}

.alert-meta {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 8px;
}

.alert-count {
  color: var(--warning-text);
  font-size: 0.85rem;
  margin-bottom: 16px;
}

.modal-subtitle { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 16px; }

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
}

/* ===== Alert Banners ===== */
.alert-banner {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 0.9rem;
}
.alert-banner.error { background: var(--danger-bg); border: 1px solid var(--danger-text); color: var(--danger-text); }
.alert-banner.success { background: var(--success-bg); border: 1px solid var(--success-text); color: var(--success-text); }

/* ===== Dashboard ===== */
.checkin-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--success-bg);
  border: 1px solid var(--success-text);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
  gap: 12px;
}
.checkin-banner-info { display: flex; align-items: center; gap: 8px; font-size: 0.95rem; }
.checkin-dot {
  width: 10px; height: 10px;
  background: var(--success-text);
  border-radius: 50%;
  animation: pulse 1.5s infinite;
  flex-shrink: 0;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.3); }
}

.stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}
.stat-number { font-size: 2.2rem; font-weight: 700; color: var(--accent); line-height: 1; }
.stat-label { font-size: 0.8rem; color: var(--text-secondary); margin-top: 4px; }

/* ===== Weather Widget ===== */
.weather-card { margin-bottom: 16px; }

.weather-updated { font-size: 0.75rem; color: var(--text-muted); }

.weather-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  padding: 8px 0;
}

.weather-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.weather-temp {
  display: flex;
  align-items: center;
  gap: 12px;
}

.weather-temp-icon { font-size: 2.5rem; }
.weather-temp-value { font-size: 2.8rem; font-weight: 700; color: var(--text-primary); line-height: 1; }
.weather-temp-unit { font-size: 1.2rem; color: var(--text-secondary); align-self: flex-start; margin-top: 4px; }
.weather-condition { font-size: 0.9rem; color: var(--text-secondary); margin-top: 4px; }

.weather-wind { display: flex; align-items: center; gap: 14px; }
.wind-compass {
  width: 64px; height: 64px;
  border: 2px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
  background: var(--bg-tertiary);
}
.wind-arrow {
  font-size: 1.5rem;
  display: inline-block;
  color: var(--accent);
  line-height: 1;
}
.wind-info {}
.wind-speed { font-size: 1.4rem; font-weight: 700; color: var(--text-primary); }
.wind-unit { font-size: 0.8rem; color: var(--text-secondary); }
.wind-dir { font-size: 1rem; color: var(--accent); font-weight: 600; margin-top: 2px; }

.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Tip Card ===== */
.tip-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--accent-dim);
  border-color: var(--accent);
  margin-bottom: 16px;
}
.tip-icon { font-size: 1.4rem; flex-shrink: 0; margin-top: 1px; }
.tip-text { font-size: 0.95rem; color: var(--text-primary); line-height: 1.5; }

/* ===== Notes ===== */
.notes-list { display: flex; flex-direction: column; gap: 1px; }

.note-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.note-item:last-child { border-bottom: none; }

.note-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.note-stand { font-size: 0.85rem; font-weight: 600; color: var(--accent); }
.note-text { font-size: 0.9rem; color: var(--text-primary); margin-bottom: 4px; line-height: 1.4; }
.note-meta { font-size: 0.78rem; color: var(--text-muted); }

.note-tag {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.tag-sighting { background: var(--success-bg); color: var(--success-text); }
.tag-maintenance { background: var(--warning-bg); color: var(--warning-text); }
.tag-other { background: var(--info-bg); color: var(--info-text); }

/* Notes Feed (notes page) */
.filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.filter-label { font-size: 0.85rem; color: var(--text-muted); }
.filter-chip {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: all 0.15s;
}
.filter-chip:hover, .filter-chip.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.notes-feed { display: flex; flex-direction: column; gap: 12px; }

.note-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: var(--radius);
  padding: 14px;
}
.tag-border-sighting { border-left-color: var(--success-text); }
.tag-border-maintenance { border-left-color: var(--warning-text); }
.tag-border-other { border-left-color: var(--info-text); }

.note-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.note-stand-link { font-weight: 600; color: var(--accent); font-size: 0.9rem; }
.note-card-text { font-size: 0.95rem; color: var(--text-primary); margin-bottom: 8px; line-height: 1.5; }
.note-card-meta { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--text-muted); }

/* Notes Timeline (stand detail) */
.notes-timeline { display: flex; flex-direction: column; gap: 4px; }
.timeline-item { display: flex; gap: 12px; padding: 8px 0; }
.timeline-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}
.tag-dot-sighting { background: var(--success-text); }
.tag-dot-maintenance { background: var(--warning-text); }
.tag-dot-other { background: var(--info-text); }

.timeline-content { flex: 1; }
.note-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; gap: 8px; }
.note-date { font-size: 0.78rem; color: var(--text-muted); flex-shrink: 0; }
.note-author { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }

/* ===== Stand Board ===== */
.stand-legend {
  display: flex;
  gap: 16px;
  margin-top: 8px;
}
.legend-item { display: flex; align-items: center; gap: 5px; font-size: 0.8rem; color: var(--text-secondary); }
.dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot.open { background: var(--success-text); }
.dot.occupied { background: var(--danger-text); }
.dot.reserved { background: var(--warning-text); }

.board-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.board-live { color: var(--success-text); font-weight: 600; }

.stands-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (min-width: 600px) {
  .stands-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
  .stands-grid { grid-template-columns: repeat(4, 1fr); }
}

.stand-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  flex-direction: column;
}

.stand-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stand-card:active { transform: scale(0.98); }

.stand-status-bar { height: 4px; }
.status-open .stand-status-bar { background: var(--success-text); }
.status-occupied .stand-status-bar { background: var(--danger-text); }
.status-reserved .stand-status-bar { background: var(--warning-text); }

.stand-card-body {
  padding: 12px;
  flex: 1;
}

.stand-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.2;
}

.status-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  margin-bottom: 4px;
}
.status-badge.open { background: var(--success-bg); color: var(--success-text); }
.status-badge.occupied { background: var(--danger-bg); color: var(--danger-text); }
.status-badge.reserved { background: var(--warning-bg); color: var(--warning-text); }

.stand-who { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); margin-top: 4px; }
.stand-since { font-size: 0.75rem; color: var(--text-secondary); }

.stand-card-footer {
  padding: 8px 12px;
  border-top: 1px solid var(--border-subtle);
}
.stand-action-hint { font-size: 0.72rem; color: var(--text-muted); }

/* ===== Stand Detail ===== */
.stand-detail-header {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}
.stand-detail-status-bar { height: 6px; }
.status-open .stand-detail-status-bar { background: var(--success-text); }
.status-occupied .stand-detail-status-bar { background: var(--danger-text); }
.status-reserved .stand-detail-status-bar { background: var(--warning-text); }

.stand-detail-info { padding: 16px; }
.stand-detail-name { font-size: 1.5rem; font-weight: 700; margin-bottom: 8px; }
.stand-detail-status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.status-detail { color: var(--text-secondary); font-size: 0.9rem; }

.action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.stand-description { color: var(--text-secondary); font-size: 0.95rem; line-height: 1.6; }

.note-form {}

.reservations-list { display: flex; flex-direction: column; gap: 8px; }
.reservation-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border-subtle); }
.reservation-item:last-child { border-bottom: none; }
.res-info { font-size: 0.9rem; }
.res-time { color: var(--text-secondary); }

.history-list { display: flex; flex-direction: column; gap: 4px; }
.history-item { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; font-size: 0.85rem; border-bottom: 1px solid var(--border-subtle); }
.history-item:last-child { border-bottom: none; }
.history-time { color: var(--text-muted); font-size: 0.78rem; }

/* ===== Gallery ===== */
.upload-form {}

.file-input {
  padding: 8px;
  font-size: 0.85rem;
}

.photo-preview-container { margin-top: 10px; }
.preview-img { max-height: 200px; border-radius: var(--radius-sm); }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
@media (min-width: 500px) { .gallery-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 768px) { .gallery-grid { grid-template-columns: repeat(4, 1fr); } }

.gallery-item {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 1;
  background: var(--bg-tertiary);
}

.gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s;
}
.gallery-item:hover .gallery-img { transform: scale(1.04); }

.gallery-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  padding: 20px 8px 8px;
  opacity: 0;
  transition: opacity 0.2s;
}
.gallery-item:hover .gallery-overlay { opacity: 1; }

.gallery-caption { font-size: 0.78rem; color: #fff; margin-bottom: 2px; }
.gallery-meta { font-size: 0.7rem; color: rgba(255,255,255,0.7); }

.gallery-delete {
  position: absolute;
  top: 6px; right: 6px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 24px; height: 24px;
  font-size: 0.75rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
}
.gallery-item:hover .gallery-delete { opacity: 1; }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}
.lightbox.hidden { display: none; }

.lightbox-content {
  max-width: 90vw;
  max-height: 90vh;
  position: relative;
}

.lightbox-close {
  position: absolute;
  top: -36px; right: 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 80vh;
  border-radius: var(--radius);
  object-fit: contain;
}

.lightbox-caption {
  color: #fff;
  font-size: 0.9rem;
  margin-top: 10px;
  text-align: center;
}
.lightbox-meta {
  color: rgba(255,255,255,0.6);
  font-size: 0.8rem;
  text-align: center;
  margin-top: 4px;
}

/* ===== Messages ===== */
.message-post-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.message-post-form .btn { align-self: flex-start; }

.messages-list { display: flex; flex-direction: column; gap: 12px; }
.messages-preview {}

.message-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}
.message-card.pinned { border-color: var(--accent); background: var(--accent-dim); }
.pin-flag { font-size: 0.75rem; color: var(--accent); font-weight: 600; margin-bottom: 8px; }
.pin-badge { font-size: 0.75rem; color: var(--accent); font-weight: 600; }

.message-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.message-item.pinned { padding: 10px; background: var(--accent-dim); border-radius: var(--radius-sm); border: 1px solid var(--accent); margin-bottom: 8px; }
.message-item:last-child { border-bottom: none; }

.message-body { font-size: 0.95rem; color: var(--text-primary); margin-bottom: 8px; line-height: 1.5; }
.message-text { font-size: 0.9rem; color: var(--text-primary); margin: 4px 0; }
.message-footer { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.message-meta { display: flex; gap: 8px; color: var(--text-muted); font-size: 0.78rem; }
.message-author { font-weight: 600; color: var(--text-secondary); font-size: 0.8rem; }
.message-time { color: var(--text-muted); font-size: 0.78rem; }
.message-actions { margin-left: auto; display: flex; gap: 4px; }

/* ===== Admin Panel ===== */
.admin-badge {
  font-size: 0.75rem;
  background: var(--warning-bg);
  color: var(--warning-text);
  padding: 3px 10px;
  border-radius: 20px;
  margin-left: 8px;
}

.tab-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
}

.tab-btn {
  padding: 8px 14px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.tab-btn:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.tab-btn.active { background: var(--accent-dim); color: var(--accent); }

.tab-content { display: block; }
.tab-content.hidden { display: none; }

.admin-list { display: flex; flex-direction: column; gap: 4px; }

.admin-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.admin-item:last-child { border-bottom: none; }

.admin-item-body { flex: 1; min-width: 0; }
.admin-item-title { font-weight: 600; font-size: 0.95rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.admin-item-text { font-size: 0.9rem; color: var(--text-primary); line-height: 1.4; }
.admin-item-meta { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.admin-item-actions { display: flex; gap: 8px; flex-shrink: 0; align-items: center; }

.username-chip {
  font-size: 0.78rem;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  padding: 1px 7px;
  border-radius: 20px;
  font-weight: 400;
}
.admin-chip {
  font-size: 0.72rem;
  background: var(--warning-bg);
  color: var(--warning-text);
  padding: 1px 7px;
  border-radius: 20px;
}
.stand-desc-preview { color: var(--text-muted); }

.activity-list { display: flex; flex-direction: column; gap: 4px; }
.activity-item { padding: 8px 0; border-bottom: 1px solid var(--border-subtle); }
.activity-item:last-child { border-bottom: none; }
.activity-info { display: flex; gap: 8px; align-items: center; font-size: 0.9rem; margin-bottom: 2px; }
.activity-stand { color: var(--accent); }
.activity-time { font-size: 0.78rem; color: var(--text-muted); }

/* ===== Text utilities ===== */
.text-success { color: var(--success-text); }
.text-danger { color: var(--danger-text); }
.text-muted { color: var(--text-muted); }
.text-warning { color: var(--warning-text); }

.empty-state {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
  padding: 20px 0;
}

/* ===== Error Page ===== */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
  padding: 24px;
  gap: 12px;
}
.error-icon { font-size: 4rem; }
.error-page h1 { font-size: 1.5rem; }
.error-page p { color: var(--text-secondary); max-width: 300px; }

/* Active Checkins Card */
.checkins-card .active-checkins {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.checkin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  gap: 1rem;
}

.checkin-hunter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.hunter-avatar {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #10b981, #059669);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
}

.hunter-name {
  font-weight: 500;
}

.checkin-stand {
  flex: 1;
}

.checkin-stand a {
  color: #10b981;
  text-decoration: none;
  font-weight: 500;
}

.checkin-stand a:hover {
  text-decoration: underline;
}

.checkin-time {
  color: #9ca3af;
  font-size: 0.875rem;
}

/* Messages Card */
.messages-card .card-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.btn-full {
  width: 100%;
}

.weather-location {
  color: #9ca3af;
  font-size: 0.875rem;
}

/* Guests */
.guest-row {
  background: rgba(147, 51, 234, 0.1);
}

.guest-avatar {
  background: linear-gradient(135deg, #9333ea, #7c3aed) !important;
}

.guest-tag {
  font-size: 0.75rem;
  color: #9ca3af;
  font-weight: normal;
}

.guests-card .my-guests-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.guest-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  background: rgba(147, 51, 234, 0.1);
  border-radius: 8px;
}

.guest-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.guest-name {
  font-weight: 500;
}

.guest-stand {
  font-size: 0.875rem;
  color: #9ca3af;
}

.add-guest-form {
  display: flex;
  gap: 0.5rem;
  padding: 1rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.add-guest-form .form-input {
  flex: 1;
}

/* Profile Page */
.profile-page {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.profile-photo-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem;
}

.profile-photo-wrapper {
  margin-bottom: 1rem;
}

.profile-photo-large {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
}

.profile-photo-placeholder {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #059669);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  font-weight: 600;
}

.photo-upload-form {
  margin-top: 0.5rem;
}

/* Avatar in checkins */
.hunter-photo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}
