:root {
  --primary: #059669;
  --primary-light: #10b981;
  --primary-dark: #047857;
  --primary-container: #d1fae5;
  --on-primary-container: #064e3b;
  --secondary: #0d9488;
  --secondary-container: #ccfbf1;
  --emergency-red: #ef4444;
  --emergency-red-container: #fee2e2;
  --warning-amber: #f59e0b;
  --warning-amber-container: #fef3c7;
  --bg-color: #0f172a;
  --screen-bg: #f8faf9;
  --card-bg: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --radius-md: 16px;
  --radius-lg: 24px;
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: #f8fafc;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
}

h1, h2, h3, h4, .brand-header, .app-title-group h3 {
  font-family: 'Outfit', sans-serif;
}

.app-layout {
  display: flex;
  flex-direction: row;
  gap: 40px;
  max-width: 1200px;
  width: 100%;
  padding: 24px;
  align-items: flex-start;
  justify-content: center;
}

/* Sidebar Control Panel */
.control-panel {
  flex: 1;
  max-width: 380px;
  background: #1e293b;
  padding: 24px;
  border-radius: 24px;
  border: 1px solid #334155;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #334155;
}

.logo-box {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: white;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.4);
}

.brand-header h2 {
  font-size: 22px;
  font-weight: 800;
  color: #f8fafc;
}

.brand-header .sub {
  font-size: 12px;
  color: var(--primary-light);
  font-weight: 600;
}

.panel-section {
  margin-bottom: 20px;
}

.panel-section label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

select {
  width: 100%;
  padding: 12px 14px;
  background: #0f172a;
  border: 1px solid #475569;
  border-radius: 12px;
  color: white;
  font-size: 14px;
  outline: none;
  cursor: pointer;
}

.role-pills {
  display: flex;
  gap: 8px;
}

.role-pill {
  flex: 1;
  padding: 10px 6px;
  background: #0f172a;
  border: 1px solid #334155;
  color: #94a3b8;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.role-pill.active {
  background: var(--primary);
  border-color: var(--primary-light);
  color: white;
}

.model-badge-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.badge {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
}

.badge.ml {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.badge.cloud {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(96, 165, 250, 0.3);
}

.status-box {
  background: #0f172a;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid #334155;
}

.status-item {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 8px;
}

.status-item:last-child {
  margin-bottom: 0;
}

.status-val.success {
  color: #34d399;
  font-weight: 600;
}

.flutter-run-info {
  margin-top: 20px;
  padding: 14px;
  background: rgba(5, 150, 105, 0.1);
  border: 1px dashed var(--primary-light);
  border-radius: 14px;
}

.flutter-run-info h4 {
  font-size: 13px;
  color: var(--primary-light);
  margin-bottom: 6px;
}

.flutter-run-info code {
  display: block;
  background: #0f172a;
  padding: 6px 10px;
  border-radius: 6px;
  color: #38bdf8;
  font-size: 13px;
  margin: 6px 0;
}

.flutter-run-info p {
  font-size: 11px;
  color: #94a3b8;
}

/* Phone Frame Device */
.device-container {
  display: flex;
  justify-content: center;
}

.phone-frame {
  width: 380px;
  height: 760px;
  background: #020617;
  border-radius: 44px;
  border: 10px solid #1e293b;
  box-shadow: 0 25px 60px rgba(0,0,0,0.6), 0 0 0 2px #334155;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.phone-notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  height: 24px;
  background: #020617;
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 14px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.phone-notch .speaker {
  width: 44px;
  height: 4px;
  background: #334155;
  border-radius: 4px;
}

.phone-notch .camera-lens {
  width: 8px;
  height: 8px;
  background: #1e293b;
  border-radius: 50%;
  border: 1px solid #475569;
}

.phone-screen {
  flex: 1;
  background: var(--screen-bg);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  padding-top: 24px;
}

/* Mobile App Bar */
.mobile-app-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}

.app-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mini-logo {
  background: var(--primary);
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.app-title-group h3 {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-primary);
}

.app-status-tag {
  font-size: 10px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
}

.app-bar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-lang-select {
  background: var(--primary-container);
  color: var(--on-primary-container);
  border: 1px solid var(--primary-light);
  padding: 4px 6px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  outline: none;
}

.sos-mini-btn {
  background: var(--emergency-red-container);
  color: var(--emergency-red);
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.avatar-btn {
  background: var(--primary-container);
  color: var(--on-primary-container);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

/* Screen Viewport */
.screen-viewport {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  padding-bottom: 70px;
}

/* Bottom Navigation Bar */
.mobile-bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 4px;
  z-index: 20;
}

.nav-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px;
  transition: all 0.2s;
}

.nav-btn i {
  font-size: 18px;
}

.nav-btn.active {
  color: var(--primary);
}

.nav-btn.scan-highlight {
  position: relative;
  top: -12px;
}

.scan-icon-circle {
  width: 44px;
  height: 44px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.4);
  border: 3px solid var(--card-bg);
}

/* Dashboard UI Components */
.welcome-hero {
  margin-bottom: 12px;
}

.welcome-hero h4 {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
}

.welcome-hero p {
  font-size: 12px;
  color: var(--text-secondary);
}

.sos-banner {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  color: white;
  padding: 14px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 6px 16px rgba(220, 38, 38, 0.3);
  margin-bottom: 14px;
  cursor: pointer;
}

.sos-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sos-icon {
  font-size: 24px;
  background: rgba(255,255,255,0.2);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sos-text h5 {
  font-size: 14px;
  font-weight: 800;
}

.sos-text p {
  font-size: 11px;
  opacity: 0.9;
}

.sos-action-btn {
  background: white;
  color: var(--emergency-red);
  border: none;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 12px;
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.section-title-row h5 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.section-title-row span {
  font-size: 11px;
  color: var(--primary);
  font-weight: 600;
}

/* Alert Horizontal Slider */
.alert-slider {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 14px;
}

.alert-slider::-webkit-scrollbar {
  display: none;
}

.alert-card {
  min-width: 240px;
  background: white;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-icon-box {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.alert-icon-box.vaccine {
  background: var(--warning-amber-container);
  color: var(--warning-amber);
}

.alert-icon-box.medicine {
  background: #dbeafe;
  color: #2563eb;
}

.alert-details h6 {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}

.alert-details p {
  font-size: 10px;
  color: var(--text-secondary);
}

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

.grid-card {
  background: white;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 94px;
}

.grid-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.grid-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.grid-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.grid-card h6 {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.grid-card p {
  font-size: 10px;
  color: var(--text-secondary);
}

/* Scanner View */
.scanner-viewport {
  background: #020617;
  height: 100%;
  border-radius: 18px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  color: white;
}

.scanner-reticle {
  width: 200px;
  height: 200px;
  border: 2px dashed rgba(16, 185, 129, 0.8);
  border-radius: 24px;
  margin: auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 20px rgba(16, 185, 129, 0.2);
}

.laser-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #34d399, transparent);
  box-shadow: 0 0 10px #34d399;
  animation: scanLaser 2s infinite ease-in-out alternate;
}

@keyframes scanLaser {
  0% { top: 10px; }
  100% { top: 180px; }
}

.scanner-controls {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding-bottom: 10px;
}

.shutter-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  border: 4px solid white;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.5);
}

/* Result Card */
.result-card {
  background: white;
  border-radius: 18px;
  padding: 14px;
  border: 1px solid var(--border);
  margin-bottom: 12px;
}

.pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
}

.pill.safe { background: var(--primary-container); color: var(--on-primary-container); }
.pill.danger { background: var(--emergency-red-container); color: var(--emergency-red); }
.pill.info { background: #dbeafe; color: #1d4ed8; }

/* Pashu Mitra Chat */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 10px;
}

.chat-bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 12px;
  line-height: 1.4;
}

.chat-bubble.ai {
  background: white;
  align-self: flex-start;
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.chat-bubble.user {
  background: var(--primary);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.chat-input-bar {
  display: flex;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.chat-input-bar input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  font-size: 12px;
  outline: none;
}

.chat-send-btn, .chat-mic-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-send-btn { background: var(--primary); color: white; }
.chat-mic-btn { background: var(--primary-container); color: var(--primary); }

/* Modal */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.payment-modal-card {
  background: white;
  color: var(--text-primary);
  width: 90%;
  max-width: 380px;
  border-radius: 20px;
  overflow: hidden;
}

.rzp-header {
  background: #0f172a;
  color: white;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
}

.rzp-header .close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
}

.rzp-body {
  padding: 16px;
}

.plan-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.rzp-price {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
}

.rzp-desc {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.payment-methods {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.pay-method {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.pay-method.active {
  border-color: var(--primary);
  background: var(--primary-container);
  color: var(--on-primary-container);
}

.rzp-pay-btn {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

/* UI Aesthetics: Glassmorphism Elevation System */

/* Theme: Dark Mode Modal Backdrops */

/* Keyframes: SOS Pulse Glow Animation */

/* Typography: Result Card Hierarchy */

/* Navigation: Active Tab Underline Indicator */

/* Layout: Mobile Welcome Hero Gradient */

/* Animation: Payment Modal Slide-up Transition */

/* Badges: Domestic & Wild Species HSL Color Tags */

/* Accessibility: Focus Outline Ring */

/* Styling: VIP Gold Badge Gradient Fill */

/* PWA: Mobile Web App Meta Theme Colors */
