:root {
  --primary: #059669;
  --primary-dark: #047857;
  --primary-light: #d1fae5;
  --accent-blue: #0284c7;
  --accent-amber: #d97706;
  --accent-red: #dc2626;
  --accent-purple: #7c3aed;
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-header: rgba(255, 255, 255, 0.98);
  --text-main: #0f172a;
  --text-muted: #475569;
  --border-color: #cbd5e1;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 10px 20px -3px rgba(0, 0, 0, 0.15);
  
  /* Font size scale */
  --font-base: 14px;
  --font-sm: 12px;
  --font-title: 17px;
  --btn-pad: 10px 14px;
}

/* Chế Độ Lão Niên Chữ To (Senior / Lite Mode) */
body.senior-mode {
  --font-base: 18px;
  --font-sm: 15px;
  --font-title: 22px;
  --btn-pad: 14px 18px;
}

body.senior-mode .search-box input {
  font-size: 16px;
}
body.senior-mode .filter-chip {
  font-size: 14px;
  padding: 8px 16px;
}
body.senior-mode .sheet-title {
  font-size: 22px;
}
body.senior-mode .sheet-subtitle, body.senior-mode .station-addr-text {
  font-size: 15px;
}
body.senior-mode .status-badge {
  font-size: 14px;
  padding: 8px 14px;
}
body.senior-mode .amenity-info h4 {
  font-size: 14px;
}
body.senior-mode .amenity-info p {
  font-size: 13px;
}
body.senior-mode .btn-primary, body.senior-mode .btn-secondary {
  font-size: 16px;
  padding: 14px;
}
body.senior-mode .sos-emergency-btn {
  font-size: 15px;
  padding: 12px 20px;
}
body.senior-mode .nav-item span {
  font-size: 12px;
  font-weight: 700;
}
body.senior-mode .nav-item i {
  font-size: 20px;
}

/* Dark Mode */
body.dark-mode {
  --bg-main: #0b1120;
  --bg-card: #1e293b;
  --bg-header: rgba(15, 23, 42, 0.96);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: #334155;
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.6);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  max-width: 100vw;
  height: 100vh;
  overflow: hidden;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: var(--font-base);
  display: flex;
  flex-direction: column;
}

/* Header & Search Bar */
.top-header {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 125px;
  max-width: calc(100vw - 145px);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
@media (min-width: 768px) {
  .top-header {
    max-width: 480px;
    left: 20px;
    right: auto;
  }
}

.search-box {
  pointer-events: auto;
  background: var(--bg-header);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 32px;
  padding: 6px 8px 6px 14px;
  display: flex;
  align-items: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  border: 1px solid var(--border-color);
  width: 100%;
  gap: 8px;
}

.search-icon {
  color: var(--primary);
  font-size: 16px;
  margin-left: 2px;
}

.search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  flex: 1;
  min-width: 60px;
  padding: 6px 2px;
  color: var(--text-main);
  font-weight: 500;
}

.search-box input::placeholder {
  color: #94a3b8;
  font-size: 13.5px;
}

.header-action-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.header-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
}

.icon-only-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 15px;
  background: rgba(0, 0, 0, 0.04);
}
.icon-only-btn:hover {
  background: rgba(0, 0, 0, 0.08);
}
body.dark-mode .icon-only-btn {
  background: rgba(255, 255, 255, 0.08);
}
body.dark-mode .icon-only-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.senior-btn {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  padding: 6px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  gap: 5px;
}
.senior-btn:hover {
  background: #d1fae5;
}
.senior-btn i {
  font-size: 13px;
}
body.senior-mode .senior-btn {
  background: #059669;
  color: white;
  border-color: #047857;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
}

.lang-badge-btn {
  background: #f5f3ff;
  border: 1px solid #ddd6fe;
  padding: 5px 9px;
  border-radius: 18px;
  font-size: 11.5px;
  font-weight: 800;
  color: #7c3aed;
  display: flex;
  align-items: center;
  gap: 4px;
}
.lang-badge-btn:hover {
  background: #ede9fe;
}
body.dark-mode .lang-badge-btn {
  background: rgba(124, 58, 237, 0.2);
  border-color: #7c3aed;
  color: #c4b5fd;
}

.header-btn.speaking {
  color: #ffffff !important;
  background: #dc2626 !important;
  animation: pulseMic 1.2s infinite;
}
@keyframes pulseMic {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.5); }
  50% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

/* Filter Chips Bar (Bố trí đa dòng tự động xuống hàng flex-wrap để không bị che khuất chữ) */
.filter-container {
  pointer-events: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 2px 0;
  width: 100%;
}

.filter-chip {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  white-space: nowrap;
}
.filter-chip i {
  font-size: 13px;
  color: var(--text-muted);
}

.filter-chip.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 3px 12px rgba(5, 150, 105, 0.38);
}
.filter-chip.active i {
  color: white;
}

/* Quick Tools Panel Bên Phía Trên Phải */
.top-right-panel {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1010;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  pointer-events: auto;
}

.top-right-toggle-btn {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-main);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.top-right-toggle-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
}
.top-right-toggle-btn i {
  color: #059669;
}

.top-right-tools {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 135px;
  animation: slideDown 0.2s ease;
  transition: all 0.25s ease;
}
.top-right-tools.collapsed {
  display: none !important;
}

.tool-chip-btn {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  padding: 7px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  transition: all 0.15s ease;
}
.tool-chip-btn:hover {
  background: rgba(5, 150, 105, 0.08);
  border-color: #059669;
}
.tool-chip-btn i {
  font-size: 14px;
  width: 18px;
  text-align: center;
}
.collapsible-header-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.collapsible-header-body.collapsed {
  display: none !important;
}

/* Thanh tiêu đề mục thu gọn / mở rộng từng bộ chức năng */
.section-toggle-bar {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
  margin-top: 2px;
}
.section-toggle-label {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}
.btn-toggle-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}
.btn-toggle-section:hover {
  background: var(--bg-main);
  color: var(--text-main);
}
.filter-container.collapsed,
.feature-pills-row.collapsed {
  display: none !important;
}

.feature-pill-btn {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-main);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}
.feature-pill-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}
.feature-pill-btn.active {
  background: #0f172a;
  color: white;
  border-color: #334155;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.3);
}
body.dark-mode .feature-pill-btn.active {
  background: #3b82f6;
  border-color: #60a5fa;
}

/* More Menu Modal (Dropdown gọn) */
.more-menu-modal {
  position: absolute;
  top: 64px;
  right: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.22);
  z-index: 1100;
  display: none;
  min-width: 270px;
  animation: slideDown 0.2s ease;
  overflow: hidden;
}
.more-menu-modal.open {
  display: block;
}
.more-menu-content {
  padding: 8px 0;
  display: flex;
  flex-direction: column;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: background 0.15s;
}
.menu-item:hover {
  background: rgba(0, 0, 0, 0.05);
}
body.dark-mode .menu-item:hover {
  background: rgba(255, 255, 255, 0.08);
}
.menu-item i {
  font-size: 16px;
  width: 22px;
  text-align: center;
}

/* Operator Dashboard Bar */
.operator-bar {
  pointer-events: auto;
  background: #0f172a;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: white;
  border-radius: 18px;
  padding: 12px 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(139, 92, 246, 0.4);
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
  animation: slideDown 0.25s ease;
}
.operator-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #c4b5fd;
}
.close-btn-mini {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #cbd5e1;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.close-btn-mini:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}
.operator-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  padding: 8px 10px;
  border-radius: 12px;
}
.op-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.op-val { font-size: 16px; font-weight: 800; line-height: 1.2; }
.op-lbl { font-size: 9.5px; color: #94a3b8; font-weight: 500; margin-top: 2px; }
.op-toggles { display: flex; gap: 8px; }
.op-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: white;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.op-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}
.op-btn.active {
  background: var(--accent-purple);
  border-color: #a78bfa;
  box-shadow: 0 2px 10px rgba(124, 58, 237, 0.4);
}

/* Map Container */
#map {
  flex: 1;
  width: 100vw;
  height: 100vh;
  z-index: 1;
}

/* SOS Floating Button */
.sos-emergency-btn {
  position: absolute;
  left: 14px;
  bottom: 72px;
  z-index: 900;
  background: #dc2626;
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 28px;
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 7px;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.45);
  cursor: pointer;
  transition: transform 0.15s ease;
}
.sos-emergency-btn:active {
  transform: scale(0.94);
}
.sos-pulse {
  width: 8px;
  height: 8px;
  background: #fee2e2;
  border-radius: 50%;
  animation: blink 1s infinite;
}

/* Floating Actions */
.floating-actions {
  position: absolute;
  right: 14px;
  bottom: 72px;
  z-index: 900;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 10px;
}

.fab-toggle-btn {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  color: #059669;
  font-size: 15px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}
.fab-toggle-btn:hover {
  background: var(--bg-main);
}

.fab-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  animation: slideUpFade 0.2s ease;
}
.fab-stack.collapsed {
  display: none !important;
}
@keyframes slideUpFade {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

.fab-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  font-size: 17px;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.fab-btn:active {
  transform: scale(0.92);
}
.fab-btn.active {
  background: var(--primary);
  color: white;
}

/* Custom Marker */
.custom-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.marker-pin {
  width: 38px;
  height: 38px;
  border-radius: 50% 50% 50% 0;
  position: absolute;
  transform: rotate(-45deg);
  left: 50%;
  top: 50%;
  margin: -24px 0 0 -19px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

.marker-pin.available { background: #10b981; }
.marker-pin.occupied { background: #f59e0b; }
.marker-pin.charging { background: #0284c7; }

.marker-icon {
  transform: rotate(45deg);
  font-size: 16px;
}

.marker-pulse {
  background: rgba(16, 185, 129, 0.4);
  border-radius: 50%;
  height: 20px;
  width: 20px;
  position: absolute;
  left: 50%;
  top: 50%;
  margin: -10px 0 0 -10px;
  animation: pulsate 1.8s ease-out infinite;
  opacity: 0;
}
@keyframes pulsate {
  0% { transform: scale(0.1); opacity: 0; }
  50% { opacity: 0.8; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* User Location Marker */
.user-marker {
  width: 18px;
  height: 18px;
  background: #2563eb;
  border: 3px solid white;
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.6);
}

/* Bottom Sheet Modal */
.bottom-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -4px 25px rgba(0, 0, 0, 0.2);
  z-index: 1050;
  transform: translateY(105%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

@media (min-width: 768px) {
  .bottom-sheet {
    max-width: 440px;
    left: 20px;
    right: auto;
    bottom: 24px;
    border-radius: 20px;
    transform: translateX(-120%);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
  }
  .bottom-sheet.open {
    transform: translateX(0);
  }
}

.bottom-sheet.open {
  transform: translateY(0);
}

.sheet-drag-handle {
  width: 44px;
  height: 5px;
  background: #cbd5e1;
  border-radius: 3px;
  margin: 10px auto 4px;
  flex-shrink: 0;
}
body.dark-mode .sheet-drag-handle {
  background: #475569;
}

.sheet-content {
  padding: 12px 18px 24px;
  overflow-y: auto;
  flex: 1;
}

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

.sheet-title {
  font-size: var(--font-title);
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.3;
}

.sheet-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.station-addr-text {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}

.close-btn {
  background: var(--bg-main);
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  flex-shrink: 0;
}

/* Status Badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 14px;
}

.status-badge.available {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}
.status-badge.occupied {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}
.status-badge.charging {
  background: #f0f9ff;
  color: #0369a1;
  border: 1px solid #bae6fd;
}
body.dark-mode .status-badge.available { background: rgba(16, 185, 129, 0.2); color: #34d399; }
body.dark-mode .status-badge.occupied { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
body.dark-mode .status-badge.charging { background: rgba(2, 132, 199, 0.2); color: #38bdf8; }

/* Amenities Grid */
.amenities-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.amenity-card {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  padding: 10px 12px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.amenity-icon {
  font-size: 18px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  flex-shrink: 0;
}

.amenity-info h4 {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
}
.amenity-info p {
  font-size: 11px;
  color: var(--text-muted);
}

/* Powerbank & EV Box */
.powerbank-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 14px;
}
body.dark-mode .powerbank-box {
  background: rgba(217, 119, 6, 0.15);
  border-color: #d97706;
}
.btn-rent-powerbank {
  background: #d97706;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.ev-reserve-box {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 14px;
}
body.dark-mode .ev-reserve-box {
  background: rgba(2, 132, 199, 0.15);
  border-color: #0284c7;
}
.badge-mini {
  font-size: 10px;
  background: #e0f2fe;
  color: #0284c7;
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 700;
}
.btn-ev-reserve {
  width: 100%;
  background: var(--accent-blue);
  color: white;
  border: none;
  padding: 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* IoT Telemetry Box */
.iot-telemetry-box {
  background: var(--bg-main);
  border-radius: 14px;
  padding: 10px 14px;
  margin-bottom: 14px;
  border: 1px solid var(--border-color);
}
.iot-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.live-pulse-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #dc2626;
  font-weight: 800;
  font-size: 10px;
}
.pulse-dot {
  width: 6px;
  height: 6px;
  background: #dc2626;
  border-radius: 50%;
  animation: blink 1.2s infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.2; } }

.iot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.iot-metric {
  background: var(--bg-card);
  padding: 6px 10px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
}
.iot-lbl { font-size: 10px; color: var(--text-muted); }
.iot-val { font-size: 12px; font-weight: 700; margin-top: 2px; }

/* OCOP & Products Grid */
.info-section {
  background: #f0fdf4;
  border: 1px dashed #86efac;
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 14px;
}
body.dark-mode .info-section {
  background: rgba(5, 150, 105, 0.15);
  border-color: #059669;
}
.info-section h3 {
  font-size: 13px;
  font-weight: 700;
  color: #166534;
}
body.dark-mode .info-section h3 { color: #34d399; }

.ocop-products-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.ocop-item-card {
  background: var(--bg-card);
  border: 1px solid rgba(134, 239, 172, 0.6);
  padding: 8px 10px;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ocop-item-title { font-size: 12px; font-weight: 600; color: var(--text-main); }
.ocop-item-price { font-size: 11px; color: #059669; font-weight: 700; }
.btn-buy-ocop {
  background: #059669;
  color: white;
  border: none;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.btn-primary {
  flex: 2;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 14px;
  padding: 12px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.btn-secondary {
  flex: 1;
  background: var(--bg-main);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 12px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn-icon-only {
  flex: 0 0 44px;
  padding: 12px 0;
}

/* 3D Canvas Box */
.interactive-3d-box {
  background: #0f172a;
  border-radius: 14px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
#canvas3d {
  width: 100%;
  height: 220px;
  border-radius: 8px;
  cursor: grab;
}
.canvas-3d-hint {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 6px;
}

/* User Guide Step List */
.user-guide-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 10px 0;
}
.guide-step-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--bg-main);
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}
.guide-step-num {
  width: 28px;
  height: 28px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.guide-step-body h4 {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2px;
}
.guide-step-body p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Eco Wallet Card */
.eco-wallet-balance-card {
  background: linear-gradient(135deg, #059669, #047857);
  color: white;
  padding: 16px;
  border-radius: 14px;
  box-shadow: 0 4px 15px rgba(5, 150, 105, 0.3);
}
.eco-rewards-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.eco-reward-item {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.btn-redeem {
  background: #059669;
  color: white;
  border: none;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

/* QR Access Box */
.qr-code-wrapper {
  margin: 16px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.qr-box {
  padding: 10px;
  background: white;
  border-radius: 16px;
  box-shadow: var(--shadow-md);
}

/* Bottom Navigation Bar */
.bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 58px;
  background: var(--bg-header);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 1000;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: transparent;
}
.nav-item.active {
  color: var(--primary);
}
.nav-item i {
  font-size: 18px;
}

/* List Drawer Modal */
.list-modal {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 58px;
  background: var(--bg-main);
  z-index: 1060;
  display: none;
  flex-direction: column;
}
@media (min-width: 768px) {
  .list-modal {
    max-width: 440px;
    right: auto;
    border-right: 1px solid var(--border-color);
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
  }
}
.list-modal.open {
  display: flex;
}
.list-header {
  padding: 16px 18px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.list-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}
.station-list-container {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px 60px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.station-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.station-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.station-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}
.station-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin: 4px 0 8px;
}
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.card-tag {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  color: var(--text-muted);
}

/* Modal Overlay */
.feedback-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(5px);
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.feedback-modal-overlay.open {
  display: flex;
}
.feedback-card {
  background: var(--bg-card);
  width: 100%;
  max-width: 440px;
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
  animation: scaleUp 0.25s ease;
  border: 1px solid var(--border-color);
  max-height: 88vh;
  overflow-y: auto;
}
@keyframes scaleUp {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.rating-stars {
  display: flex;
  justify-content: center;
  gap: 10px;
  font-size: 32px;
  color: #cbd5e1;
  margin: 10px 0 16px;
  cursor: pointer;
}
.rating-stars span.active {
  color: #f59e0b;
}

/* Toast */
.toast {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: #0f172a;
  color: white;
  padding: 10px 20px;
  border-radius: 26px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
  z-index: 2000;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  white-space: nowrap;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* Helpers */
.text-green { color: #059669 !important; }
.text-blue { color: #0284c7 !important; }
.text-amber { color: #d97706 !important; }
.text-purple { color: #7c3aed !important; }
