/* ============================================
   PISSEN.JETZT – Premium Mobile-First Design
   ============================================ */

:root {
  --red-50: #fef2f2;
  --red-100: #fee2e2;
  --red-500: #ef4444;
  --red-600: #dc2626;
  --red-700: #b91c1c;
  --red-800: #991b1b;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --green-100: #dcfce7;
  --amber-500: #f59e0b;
  --amber-100: #fef3c7;
  --blue-500: #3b82f6;
  --blue-100: #dbeafe;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 9999px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--gray-50);
  color: var(--gray-900);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============ APP SCREENS ============ */

.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s;
  will-change: transform, opacity;
}

.screen.hidden {
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
}

.screen.slide-left {
  transform: translateX(-30%);
  opacity: 0;
  pointer-events: none;
}

/* ============ HOME SCREEN ============ */

#home-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #ffffff 0%, var(--gray-50) 100%);
  padding: 24px;
  z-index: 10;
}

.home-logo {
  font-size: 64px;
  margin-bottom: 8px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

.home-title {
  font-size: 36px;
  font-weight: 900;
  color: var(--gray-900);
  letter-spacing: -1px;
  margin-bottom: 4px;
}

.home-subtitle {
  font-size: 16px;
  color: var(--gray-400);
  font-weight: 500;
  margin-bottom: 40px;
}

.find-button {
  position: relative;
  width: 260px;
  height: 160px;
  background: linear-gradient(135deg, var(--red-600) 0%, var(--red-700) 100%);
  border: none;
  border-radius: var(--radius-2xl);
  color: white;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow: 0 8px 32px rgba(220, 38, 38, 0.35), 0 2px 8px rgba(220, 38, 38, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-bottom: 40px;
  overflow: hidden;
}

.find-button::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
  animation: shimmer 4s linear infinite;
}

@keyframes shimmer {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.find-button:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 40px rgba(220, 38, 38, 0.45), 0 4px 12px rgba(220, 38, 38, 0.3);
}

.find-button:active {
  transform: scale(0.97);
}

.find-button .icon-circle {
  width: 56px;
  height: 56px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  backdrop-filter: blur(8px);
}

.find-button .btn-text {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
  z-index: 1;
}

.filters-label {
  font-size: 13px;
  color: var(--gray-400);
  font-weight: 500;
  margin-bottom: 12px;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  max-width: 320px;
}

.filter-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--gray-200);
  background: white;
  color: var(--gray-600);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.filter-pill:hover {
  border-color: var(--red-500);
  color: var(--red-600);
  background: var(--red-50);
}

.filter-pill.active {
  border-color: var(--red-600);
  background: var(--red-600);
  color: white;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.25);
}

.filter-pill .pill-icon {
  font-size: 15px;
}

/* ============ LOADING OVERLAY ============ */

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.loading-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--red-600);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-text {
  font-size: 15px;
  color: var(--gray-500);
  font-weight: 600;
}

/* ============ LOCATION ERROR OVERLAY ============ */

.location-error-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 24px;
}

.location-error-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.location-error-card {
  background: white;
  border-radius: var(--radius-2xl);
  padding: 32px 24px;
  max-width: 340px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-2xl);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.location-error-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.location-error-card h3 {
  font-size: 18px;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 8px;
}

.location-error-card p {
  font-size: 14px;
  color: var(--gray-500);
  line-height: 1.6;
  margin-bottom: 4px;
}

.location-error-card .find-button {
  width: 100%;
  height: auto;
  padding: 14px 24px;
  margin-bottom: 8px;
}

.dismiss-btn {
  background: none;
  border: none;
  color: var(--gray-400);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 16px;
  margin-top: 4px;
}

.dismiss-btn:hover {
  color: var(--gray-600);
}

/* ============ TOAST NOTIFICATION ============ */

.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--gray-800);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-xl);
  z-index: 3000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  white-space: nowrap;
  max-width: 90vw;
  text-align: center;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* ============ MAP SCREEN ============ */

#map-screen {
  display: flex;
  flex-direction: column;
  z-index: 5;
}

.map-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 600;
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top));
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.map-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.back-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: none;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  transition: all 0.2s;
}

.back-btn:hover {
  background: var(--gray-200);
}

.map-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--gray-900);
}

.view-toggle {
  display: flex;
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
}

.toggle-btn {
  width: 36px;
  height: 32px;
  border-radius: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.toggle-btn.active {
  background: white;
  box-shadow: var(--shadow-sm);
}

.map-filters {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.map-filters::-webkit-scrollbar {
  display: none;
}

.map-filter-chip {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--gray-200);
  background: white;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
  white-space: nowrap;
}

.map-filter-chip:hover {
  border-color: var(--red-500);
  color: var(--red-600);
}

.map-filter-chip.active {
  background: var(--red-600);
  border-color: var(--red-600);
  color: white;
}

/* Map Container */
#map {
  flex: 1;
  width: 100%;
  height: 100%;
}

.leaflet-control-zoom {
  border: none !important;
  box-shadow: var(--shadow-lg) !important;
  border-radius: var(--radius-md) !important;
  overflow: hidden;
}

.leaflet-control-zoom a {
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(8px) !important;
  border: none !important;
  width: 36px !important;
  height: 36px !important;
  line-height: 36px !important;
  font-size: 18px !important;
  color: var(--gray-700) !important;
}

.leaflet-control-zoom a:hover {
  background: rgba(255, 255, 255, 1) !important;
}

/* Custom Map Markers */
.toilet-marker {
  background: none;
  border: none;
}

.marker-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  border: 2.5px solid white;
  transition: transform 0.2s;
  cursor: pointer;
}

.marker-icon:hover {
  transform: scale(1.2);
}

.marker-icon.green {
  background: var(--green-500);
}

.marker-icon.orange {
  background: var(--amber-500);
}

.marker-icon.blue {
  background: var(--blue-500);
}

.marker-icon.red {
  background: var(--red-600);
}

.user-marker {
  width: 16px;
  height: 16px;
  background: var(--blue-500);
  border-radius: 50%;
  border: 3px solid white;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3), 0 2px 8px rgba(0, 0, 0, 0.2);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3), 0 2px 8px rgba(0, 0, 0, 0.2);
  }

  50% {
    box-shadow: 0 0 0 8px rgba(59, 130, 246, 0.1), 0 2px 8px rgba(0, 0, 0, 0.2);
  }
}

/* ============ TOILET LIST (Bottom Sheet) ============ */

.bottom-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 700;
  background: white;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
  max-height: 55vh;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), max-height 0.35s;
  display: flex;
  flex-direction: column;
  touch-action: pan-y;
}

.bottom-sheet.collapsed {
  max-height: 72px;
}

.bottom-sheet.expanded {
  max-height: 80vh;
}

.sheet-handle-area {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px 6px;
  cursor: grab;
}

.sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--gray-300);
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px 12px;
}

.sheet-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-900);
}

.sheet-action {
  font-size: 13px;
  font-weight: 600;
  color: var(--red-600);
  background: none;
  border: none;
  cursor: pointer;
}

.toilet-list {
  overflow-y: auto;
  padding: 0 16px 24px;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  flex: 1;
}

.toilet-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.toilet-card:hover {
  background: var(--gray-50);
  border-color: var(--gray-100);
}

.toilet-card:active {
  background: var(--gray-100);
  transform: scale(0.99);
}

.card-emoji {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.card-emoji.green {
  background: var(--green-100);
}

.card-emoji.orange {
  background: var(--amber-100);
}

.card-emoji.blue {
  background: var(--blue-100);
}

.card-emoji.red {
  background: var(--red-100);
}

.card-info {
  flex: 1;
  min-width: 0;
}

.card-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta {
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 2px;
}

.card-features {
  display: flex;
  gap: 4px;
  margin-top: 5px;
}

.feature-badge {
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--gray-100);
}

.card-status {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.status-badge.open {
  background: var(--green-100);
  color: var(--green-600);
}

.status-badge.closed {
  background: var(--red-100);
  color: var(--red-700);
}

.card-chevron {
  color: var(--gray-300);
  font-size: 18px;
}

/* ============ DETAIL PANEL ============ */

#detail-screen {
  z-index: 20;
  background: white;
  overflow-y: auto;
}

.detail-map-preview {
  width: 100%;
  height: 200px;
  background: var(--gray-100);
  position: relative;
}

#detail-map {
  width: 100%;
  height: 100%;
}

.detail-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border: none;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 700;
  box-shadow: var(--shadow-md);
  transition: all 0.2s;
}

.detail-close:hover {
  background: white;
  transform: scale(1.1);
}

.detail-content {
  padding: 24px 20px;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}

.detail-emoji-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 4px;
}

.detail-emoji {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.detail-name {
  font-size: 22px;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -0.5px;
}

.detail-type {
  font-size: 13px;
  color: var(--gray-400);
  font-weight: 500;
  margin-top: 2px;
}

.detail-status-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}

.detail-status {
  font-size: 13px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--radius-full);
}

.detail-distance {
  font-size: 13px;
  color: var(--gray-500);
}

.detail-distance strong {
  color: var(--gray-700);
}

.detail-section {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--gray-100);
}

.detail-section-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
  padding-top: 1px;
  flex-shrink: 0;
}

.detail-section-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-700);
  line-height: 1.5;
}

.detail-section-text small {
  display: block;
  font-size: 12px;
  color: var(--gray-400);
  font-weight: 400;
  margin-top: 2px;
}

.detail-section-text .seasonal-note {
  color: var(--amber-500);
  font-size: 12px;
  font-weight: 600;
  margin-top: 3px;
}

.detail-features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
  padding: 16px 0;
  border-top: 1px solid var(--gray-100);
}

.detail-features-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  width: 100%;
  margin-bottom: 4px;
}

.detail-feature {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
}

.route-button {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--red-600) 0%, var(--red-700) 100%);
  color: white;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  box-shadow: 0 4px 16px rgba(220, 38, 38, 0.3);
  transition: all 0.2s;
}

.route-button:hover {
  box-shadow: 0 6px 24px rgba(220, 38, 38, 0.4);
  transform: translateY(-1px);
}

.route-button:active {
  transform: scale(0.98);
}

.report-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--gray-100);
}

.report-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-700);
  margin-bottom: 12px;
}

.report-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.report-option {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--gray-200);
  background: white;
  color: var(--gray-600);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
}

.report-option:hover {
  border-color: var(--red-500);
  color: var(--red-600);
  background: var(--red-50);
}

.report-option:active {
  transform: scale(0.97);
}

.report-alt {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.report-alt-link {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--gray-500);
  text-decoration: none;
  font-weight: 500;
  padding: 6px 0;
  transition: color 0.2s;
}

.report-alt-link:hover {
  color: var(--red-600);
}

/* ============ DONATE SECTION ============ */

.donate-section {
  margin-top: 24px;
  padding: 24px 20px;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, #fef9c3 0%, #fef3c7 50%, #fed7aa 100%);
  text-align: center;
  border: 1px solid #fde68a;
}

.donate-icon {
  font-size: 36px;
  margin-bottom: 8px;
}

.donate-text {
  font-size: 14px;
  color: var(--gray-700);
  line-height: 1.6;
  margin-bottom: 16px;
}

.donate-text strong {
  color: var(--gray-900);
  font-weight: 800;
}

.donate-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35);
  transition: all 0.2s;
}

.donate-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(245, 158, 11, 0.45);
}

.donate-button:active {
  transform: scale(0.97);
}

/* ============ LIST VIEW ============ */

.list-view-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: white;
  z-index: 500;
  display: none;
  flex-direction: column;
}

.list-view-container.active {
  display: flex;
}

.list-view-header {
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top));
  border-bottom: 1px solid var(--gray-100);
  background: white;
}

.list-view-content {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

/* ============ ERROR STATE ============ */

.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}

.error-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.error-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 8px;
}

.error-text {
  font-size: 14px;
  color: var(--gray-400);
  line-height: 1.6;
  margin-bottom: 24px;
}

.error-retry {
  padding: 12px 24px;
  border-radius: var(--radius-full);
  background: var(--red-600);
  color: white;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

/* ============ ADMIN STYLES ============ */

.admin-container {
  max-width: 640px;
  margin: 0 auto;
  padding: 40px 24px;
  height: 100vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-header {
  margin-bottom: 32px;
}

.admin-header h1 {
  font-size: 28px;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -0.5px;
}

.admin-header p {
  font-size: 14px;
  color: var(--gray-400);
  margin-top: 4px;
}

.admin-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--gray-100);
  margin-bottom: 16px;
}

.admin-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-50);
}

.admin-stat:last-child {
  border-bottom: none;
}

.admin-stat-label {
  font-size: 13px;
  color: var(--gray-500);
}

.admin-stat-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-900);
}

.admin-btn {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-md);
  border: none;
  background: linear-gradient(135deg, var(--red-600), var(--red-700));
  color: white;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}

.admin-btn:hover {
  box-shadow: 0 4px 16px rgba(220, 38, 38, 0.3);
  transform: translateY(-1px);
}

.admin-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.admin-log {
  margin-top: 16px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--gray-50);
  font-family: 'SF Mono', monospace;
  font-size: 12px;
  color: var(--gray-600);
  line-height: 1.8;
  max-height: 200px;
  overflow-y: auto;
  display: none;
}

.admin-log.visible {
  display: block;
}

.admin-nav {
  margin-top: 24px;
  text-align: center;
}

.admin-nav a {
  font-size: 14px;
  color: var(--red-600);
  text-decoration: none;
  font-weight: 600;
}

/* ============ RESPONSIVE ============ */

@media (min-width: 768px) {
  .bottom-sheet {
    width: 380px;
    left: 16px;
    right: auto;
    bottom: 16px;
    border-radius: var(--radius-xl);
    max-height: calc(100vh - 120px);
  }

  .bottom-sheet.collapsed {
    max-height: 72px;
  }

  .bottom-sheet.expanded {
    max-height: calc(100vh - 120px);
  }

  #detail-screen {
    width: 100%;
    left: 0;
    border-radius: 0;
  }
}

/* No data empty state */
.empty-state {
  padding: 32px 20px;
  text-align: center;
}

.empty-state p {
  color: var(--gray-400);
  font-size: 14px;
}

/* ============ ANALYTICS DASHBOARD ============ */

.analytics-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.kpi-card {
  background: linear-gradient(135deg, var(--red-600) 0%, var(--red-700) 100%);
  border-radius: var(--radius-xl);
  padding: 20px 16px;
  text-align: center;
  color: white;
  box-shadow: 0 4px 16px rgba(220, 38, 38, 0.25);
}

.kpi-value {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -1px;
  margin-bottom: 4px;
}

.kpi-label {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Bar Chart */
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 160px;
  padding-top: 20px;
}

.chart-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.chart-bar {
  width: 100%;
  max-width: 32px;
  background: linear-gradient(180deg, var(--red-500) 0%, var(--red-600) 100%);
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  transition: height 0.3s ease;
}

.chart-bar-value {
  font-size: 10px;
  font-weight: 700;
  color: var(--gray-600);
}

.chart-bar-label {
  font-size: 9px;
  color: var(--gray-400);
  font-weight: 500;
  white-space: nowrap;
}

/* Rank Badge */
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gray-100);
  color: var(--gray-600);
  font-size: 11px;
  font-weight: 800;
  margin-right: 6px;
  flex-shrink: 0;
}

.admin-stat:nth-child(1) .rank-badge {
  background: #fef3c7;
  color: #d97706;
}

.admin-stat:nth-child(2) .rank-badge {
  background: var(--gray-100);
  color: var(--gray-500);
}

.admin-stat:nth-child(3) .rank-badge {
  background: #fed7aa;
  color: #c2410c;
}