:root {
  /* Colors */
  --primary: #0ea5e9;
  /* Sky blue */
  --primary-dark: #0284c7;
  --primary-light: #e0f2fe;

  --secondary: #10b981;
  /* Emerald green */
  --secondary-dark: #059669;
  --secondary-light: #d1fae5;

  --accent: #f59e0b;
  /* Amber for warnings/expirations */
  --accent-light: #fef3c7;

  --danger: #ef4444;
  /* Red for rejections/errors */
  --danger-light: #fee2e2;

  --bg-color: #f8fafc;
  /* Very light slate */
  --surface: #ffffff;

  --text-main: #0f172a;
  --text-muted: #64748b;

  --border-color: #e2e8f0;

  /* Shadows for glass/cards */
  --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-soft: 0 20px 40px -15px rgba(16, 185, 129, 0.15);

  /* Radii */
  --radius-sm: 0.375rem;
  --radius-md: 0.75rem;
  --radius-lg: 1.5rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  color: var(--text-main);
  background-color: var(--bg-color);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

/* Utilities */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.text-center {
  text-align: center;
}

.text-success {
  color: var(--secondary);
}

.text-danger {
  color: var(--danger);
}

.text-warning {
  color: var(--accent);
}

.bg-gray {
  background-color: var(--bg-color);
}

.mt-4 {
  margin-top: 1.5rem;
}

.mb-2 {
  margin-bottom: 0.75rem;
}

.glass-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.glass-card:hover {
  box-shadow: var(--shadow-lg);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
  font-family: inherit;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background-color: var(--primary);
  color: white;
  box-shadow: 0 4px 14px 0 rgba(14, 165, 233, 0.3);
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.4);
}

.btn-secondary {
  background-color: var(--secondary);
  color: white;
  box-shadow: 0 4px 14px 0 rgba(16, 185, 129, 0.3);
}

.btn-secondary:hover {
  background-color: var(--secondary-dark);
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  background-color: var(--bg-color);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-lg {
  padding: 0.875rem 1.75rem;
  font-size: 1.05rem;
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}

.btn-icon {
  padding: 0.6rem;
  border-radius: var(--radius-md);
}

.btn-block {
  width: 100%;
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo i {
  color: var(--secondary);
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-link {
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition-fast);
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--primary);
  border-radius: 2px;
}

.nav-link.highlighted {
  background-color: var(--primary-light);
  color: var(--primary-dark);
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-main);
  cursor: pointer;
}

/* Page sections */
.page-section {
  display: none;
  min-height: calc(100vh - 140px);
  padding: 3rem 0;
  animation: fadeIn 0.4s ease-out forwards;
}

.page-section.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Page Header Shared */
.page-header {
  margin-bottom: 2rem;
  text-align: center;
}

.page-header h2 {
  font-size: 2rem;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.page-header p {
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* Hero Section */
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3rem;
  padding: 2rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.hero-content {
  flex: 1;
}

.hero-content h1 {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-main);
  margin-bottom: 1.5rem;
  /* Premium modern gradient text */
  background: linear-gradient(to right, var(--primary-dark), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-content .subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 500px;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-image {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.hero-illustration {
  width: 100%;
  height: 400px;
  position: relative;
  background: radial-gradient(circle at center, var(--primary-light) 0%, transparent 70%);
}

.floating-card {
  position: absolute;
  padding: 1rem 1.5rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: float 6s ease-in-out infinite;
}

.card-1 {
  top: 10%;
  left: 0;
  animation-delay: 0s;
  color: var(--primary-dark);
}

.card-2 {
  top: 40%;
  right: 0;
  animation-delay: 2s;
  color: var(--secondary-dark);
}

.card-3 {
  bottom: 15%;
  left: 10%;
  animation-delay: 4s;
  color: var(--text-main);
}

@keyframes float {
  0% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-15px);
  }

  100% {
    transform: translateY(0px);
  }
}

/* How it works */
.padding-y {
  padding: 5rem 0;
}

.section-title {
  font-size: 2.25rem;
  margin-bottom: 3rem;
  color: var(--text-main);
}

.steps-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.step-card {
  flex: 1;
  padding: 2rem 1.5rem;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.step-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-soft);
}

.step-icon {
  width: 60px;
  height: 60px;
  background-color: var(--secondary-light);
  color: var(--secondary-dark);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto 1.5rem;
}

.step-card h3 {
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
}

.step-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.step-connector {
  font-size: 1.5rem;
  color: var(--border-color);
}

/* Forms */
.form-container {
  max-width: 600px;
  margin: 0 auto;
}

.form-card {
  background: white;
  padding: 2.5rem;
  border-radius: var(--radius-lg);
}

.form-group {
  margin-bottom: 1.5rem;
  text-align: left;
}

.form-row {
  display: flex;
  gap: 1.25rem;
}

.form-row .half {
  flex: 1;
}

label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-main);
  font-size: 0.95rem;
}

input[type="text"],
input[type="number"],
input[type="month"],
select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  background-color: #fafafa;
}

input:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
  background-color: white;
}

.file-upload {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  background-color: #fafafa;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.file-upload:hover {
  border-color: var(--primary);
  background-color: var(--primary-light);
}

.file-upload i {
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.file-upload p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.location-input {
  display: flex;
  gap: 0.5rem;
}

.warning-text {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
}

/* Layout With Sidebar (Find Page) */
.layout-with-sidebar {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.sidebar {
  width: 280px;
  flex-shrink: 0;
  padding: 1.5rem;
  position: sticky;
  top: 90px;
}

.main-content-area {
  flex: 1;
}

.sidebar h3 {
  margin-bottom: 1.25rem;
  font-size: 1.1rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.filter-group {
  margin-bottom: 1.25rem;
}

.filter-group label {
  font-size: 0.9rem;
}

.search-box {
  position: relative;
}

.search-box i {
  position: absolute;
  top: 50%;
  left: 1rem;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-box input {
  padding-left: 2.5rem;
}

/* Custom Checkbox */
.checkbox-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
  font-weight: 400;
}

.mock-map {
  width: 100%;
  height: 200px;
  background-color: #e2e8f0;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  margin-top: 1.5rem;
}

.map-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: var(--text-muted);
  background: repeating-linear-gradient(45deg,
      #f8fafc,
      #f8fafc 10px,
      #f1f5f9 10px,
      #f1f5f9 20px);
  font-size: 0.85rem;
}

.map-placeholder i {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

/* Medicine Grid */
.medicine-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

/* Medicine Card */
.med-card {
  background: white;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  display: flex;
  flex-direction: column;
  position: relative;
}

.med-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.med-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  z-index: 10;
}

.badge-warning {
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid var(--accent);
}

.badge-success {
  background: var(--secondary-light);
  color: var(--secondary-dark);
  border: 1px solid var(--secondary);
}

.badge-danger {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid var(--danger);
}

.badge-pending {
  background: #e0e7ff;
  color: #4338ca;
  border: 1px solid #6366f1;
}

.med-img-wrapper {
  height: 160px;
  background-color: #f1f5f9;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--text-muted);
  font-size: 2rem;
  overflow: hidden;
}

.med-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.med-details {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.med-name {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text-main);
}

.med-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.med-meta span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.med-card-actions {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

/* Dashboard Tabs */
.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: -1px;
  position: relative;
  z-index: 10;
}

.tab-btn {
  padding: 0.75rem 1.5rem;
  background: white;
  border: 1px solid var(--border-color);
  border-bottom: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-muted);
}

.tab-btn.active {
  color: var(--primary);
  background: white;
  border-color: var(--border-color);
  font-weight: 600;
  position: relative;
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: white;
  z-index: 2;
}

.tab-content {
  padding: 2rem;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 0 var(--radius-md) var(--radius-md) var(--radius-md);
  min-height: 300px;
}

/* NGO Panel */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  padding: 1.5rem;
  text-align: center;
  background: white;
}

.stat-card h3 {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
}

.table-container {
  overflow-x: auto;
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 1rem 1.5rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.data-table th {
  background-color: var(--bg-color);
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.data-table tbody tr {
  transition: background-color var(--transition-fast);
}

.data-table tbody tr:hover {
  background-color: #f8fafc;
}

.action-buttons {
  display: flex;
  gap: 0.5rem;
}

.empty-state {
  padding: 4rem 2rem;
  text-align: center;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

/* Notifications */
.notification-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  pointer-events: none;
}

.toast {
  background: white;
  border-left: 4px solid var(--primary);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 300px;
  pointer-events: auto;
  animation: slideInRight 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.toast.success {
  border-color: var(--secondary);
}

.toast.error {
  border-color: var(--danger);
}

.toast.warning {
  border-color: var(--accent);
}

.toast-icon {
  font-size: 1.25rem;
}

.toast.success .toast-icon {
  color: var(--secondary);
}

.toast.error .toast-icon {
  color: var(--danger);
}

.toast-message {
  font-size: 0.95rem;
  font-weight: 500;
}

.toast-close {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
}

@keyframes slideInRight {
  from {
    transform: translateX(110%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }

  to {
    transform: translateX(110%);
    opacity: 0;
  }
}

/* Footer */
.footer {
  background-color: white;
  border-top: 1px solid var(--border-color);
  padding-top: 4rem;
  margin-top: auto;
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  gap: 3rem;
  justify-content: space-between;
  margin-bottom: 3rem;
}

.footer-brand {
  max-width: 300px;
}

.footer-brand h3 {
  color: var(--primary-dark);
  font-size: 1.25rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.footer-links {
  display: flex;
  gap: 4rem;
}

.footer-links h4 {
  font-size: 1rem;
  margin-bottom: 1.25rem;
  color: var(--text-main);
}

.footer-links ul li {
  margin-bottom: 0.75rem;
}

.footer-links a {
  color: var(--text-muted);
  transition: color var(--transition-fast);
  font-size: 0.95rem;
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-bottom {
  text-align: center;
  padding: 1.5rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 900px) {
  .hero {
    flex-direction: column;
    text-align: center;
  }

  .hero-content h1 {
    font-size: 2.5rem;
  }

  .hero-content .subtitle {
    margin: 0 auto 2rem;
  }

  .hero-actions {
    justify-content: center;
  }

  .steps-grid {
    flex-direction: column;
    gap: 2rem;
  }

  .step-connector {
    transform: rotate(90deg);
  }

  .layout-with-sidebar {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    position: static;
  }

  .hide-on-mobile {
    display: none;
  }
}

@media (max-width: 768px) {
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    flex-direction: column;
    gap: 0;
    padding: 1rem 0;
    box-shadow: var(--shadow-md);
    display: none;
    border-top: 1px solid var(--border-color);
  }

  .nav-links.show {
    display: flex;
  }

  .nav-link {
    padding: 1rem 1.5rem;
    width: 100%;
    text-align: left;
  }

  .nav-link.active::after {
    display: none;
  }

  .nav-link.active {
    background: var(--bg-color);
    color: var(--primary);
  }

  .nav-link.highlighted {
    border-radius: 0;
    background: none;
    color: var(--text-muted);
  }

  .mobile-toggle {
    display: block;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .stats-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* AI Assistant Prototype */
.ai-assistant-wrapper {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1rem;
}

.ai-toggle-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(14, 165, 233, 0.4);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-toggle-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.6);
}

.ai-chat-window {
  width: 360px;
  height: 480px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform-origin: bottom right;
  transform: scale(0);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
  pointer-events: none;
  border: 1px solid var(--border-color);
  background-color: var(--bg-color);
}

@media (max-width: 450px) {
  .ai-chat-window {
    width: calc(100vw - 3rem);
    height: 60vh;
  }
}

.ai-chat-window.active {
  transform: scale(1);
  opacity: 1;
  pointer-events: auto;
}

.ai-chat-header {
  background: linear-gradient(to right, var(--primary-dark), var(--primary));
  color: white;
  padding: 1.2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ai-branding {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  font-size: 1.15rem;
}

#ai-close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

#ai-close-btn:hover {
  opacity: 1;
  transform: scale(1.1);
}

.ai-chat-body {
  flex: 1;
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background-color: rgba(255, 255, 255, 0.95);
}

.ai-msg {
  display: flex;
  gap: 0.75rem;
  max-width: 90%;
}

.ai-msg.bot {
  align-self: flex-start;
}

.ai-msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--primary-light);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.ai-msg.user .msg-avatar {
  background-color: var(--secondary-light);
  color: var(--secondary-dark);
}

.msg-bubble {
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  line-height: 1.45;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.ai-msg.bot .msg-bubble {
  background-color: #f1f5f9;
  border-top-left-radius: 0;
  color: var(--text-main);
}

.ai-msg.user .msg-bubble {
  background-color: var(--primary);
  color: white;
  border-top-right-radius: 0;
}

.ai-chat-footer {
  padding: 1rem;
  background: white;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 0.75rem;
}

.ai-chat-footer input {
  flex: 1;
  padding: 0.75rem 1.25rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  outline: none;
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.ai-chat-footer input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.ai-chat-footer button {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.ai-chat-footer button:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 10px rgba(10, 165, 233, 0.4);
}

/* Needs Map Dashboard */
#map-container {
  width: 100%;
  height: 60vh;
  min-height: 500px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  z-index: 10;
  border: 1px solid var(--border-color);
}