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

    :root {
      --bg: #f8f6f3;
      --surface: #ffffff;
      --surface-2: #f3f0ed;
      --border: #e8ddd3;
      --navy: #0d1b2a;
      --primary-green: #1a7a50;
      --green: #1a7a50;
      --green-lt: #e8f3f0;
      --accent: #1a7a50;
      --red: #c0392b;
      --text-primary: #0d1b2a;
      --text-secondary: #4a5568;
      --text-muted: #8896a4;
      --shadow-sm: 0 1px 3px rgba(13, 27, 42, 0.07);
      --shadow-md: 0 4px 16px rgba(13, 27, 42, 0.09);
      --shadow-lg: 0 8px 32px rgba(13, 27, 42, 0.13);
      --radius: 16px;
      --radius-sm: 10px;
      --sidebar-w: 250px;
      --cart-w: 340px;
    }

    body {
      font-family: "DM Sans", sans-serif;
      background: var(--bg);
      color: var(--text-primary);
      overflow: hidden;
      height: 100vh;
    }

    /* LOGIN PAGE */
    .login-overlay {
      position: fixed;
      inset: 0;
      background: linear-gradient(135deg, #0d1b2a 0%, #1a3047 100%);
      z-index: 10000;
      display: flex;
      align-items: center;
      justify-content: center;
      backdrop-filter: blur(2px);
    }

    .login-card {
      background: var(--surface);
      border-radius: 40px;
      width: 460px;
      max-width: 90vw;
      padding: 40px 32px;
      box-shadow: var(--shadow-lg);
      text-align: center;
      animation: slideUp 0.4s ease;
    }

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

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

    .login-card h2 {
      font-family: "Fraunces";
      font-size: 32px;
      margin-bottom: 8px;
    }

    .login-card h2 span {
      color: var(--primary-green);
    }

    .login-card p {
      color: var(--text-muted);
      margin-bottom: 28px;
    }

    .input-group {
      margin-bottom: 20px;
      text-align: left;
    }

    .input-group label {
      font-size: 12px;
      font-weight: 700;
      color: var(--text-secondary);
      display: block;
      margin-bottom: 6px;
    }

    .input-group input {
      width: 100%;
      padding: 14px 16px;
      border: 2px solid var(--border);
      border-radius: 20px;
      font-size: 14px;
      outline: none;
      transition: 0.2s;
      font-family: inherit;
    }

    .input-group input:focus {
      border-color: var(--primary-green);
    }

    .login-btn {
      width: 100%;
      background: var(--navy);
      color: white;
      border: none;
      padding: 14px;
      border-radius: 40px;
      font-weight: 800;
      font-size: 16px;
      cursor: pointer;
      transition: 0.2s;
      margin-top: 8px;
    }

    .login-btn:hover {
      background: var(--primary-green);
      transform: translateY(-2px);
    }

    /* MAIN APP */
    .main-app {
      display: none;
      height: 100vh;
      width: 100vw;
      overflow: hidden;
    }

    .dashboard {
      display: flex;
      height: 100%;
      width: 100%;
    }

    /* SIDEBAR */
    #sidebar {
      width: var(--sidebar-w);
      background: var(--navy);
      display: flex;
      flex-direction: column;
      flex-shrink: 0;
      overflow-y: auto;
    }

    .sidebar-logo {
      padding: 28px 24px 20px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .sidebar-logo h1 {
      color: #fff;
      font-size: 24px;
      font-weight: 800;
    }

    .sidebar-logo span {
      color: var(--primary-green);
    }

    .nav-item {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 12px 20px;
      margin: 4px 12px;
      border-radius: 14px;
      cursor: pointer;
      color: rgba(255, 255, 255, 0.7);
      font-weight: 600;
      transition: all 0.2s;
    }

    .nav-item:hover {
      background: rgba(255, 255, 255, 0.1);
      color: #fff;
    }

    .nav-item.active {
      background: var(--primary-green);
      color: #fff;
    }

    .nav-badge {
      background: var(--primary-green);
      border-radius: 20px;
      padding: 2px 8px;
      font-size: 11px;
      margin-left: auto;
    }

    .sidebar-footer {
      margin-top: auto;
      padding: 20px 16px;
      border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .profile-pill {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 8px;
      border-radius: 16px;
      cursor: pointer;
    }

    .avatar {
      width: 44px;
      height: 44px;
      border-radius: 50%;
      background: var(--primary-green);
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 800;
      font-size: 18px;
      color: #fff;
    }

    .profile-pill .name {
      color: #fff;
      font-weight: 700;
    }

    .profile-pill .subtitle {
      color: rgba(255, 255, 255, 0.5);
      font-size: 11px;
    }

    /* MAIN CONTENT */
    #mainContent {
      flex: 1;
      overflow-y: auto;
      padding: 0 28px 28px;
    }

    .topbar {
      position: sticky;
      top: 0;
      background: var(--bg);
      padding: 20px 0 16px;
      display: flex;
      gap: 16px;
      align-items: center;
      z-index: 10;
    }

    .location-pill {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 40px;
      padding: 10px 18px;
      font-size: 13px;
      font-weight: 600;
      display: flex;
      align-items: center;
      gap: 8px;
      cursor: pointer;
      white-space: nowrap;
    }

    .search-wrap {
      flex: 1;
      position: relative;
    }

    .search-wrap input {
      width: 100%;
      padding: 12px 16px 12px 44px;
      background: var(--surface);
      border: 1.5px solid var(--border);
      border-radius: 40px;
      font-size: 14px;
      outline: none;
    }

    .search-icon {
      position: absolute;
      left: 16px;
      top: 50%;
      transform: translateY(-50%);
      font-size: 18px;
    }

    .page-view {
      display: none;
    }

    .page-view.active {
      display: block;
    }

    /* STORE GRID */
    .stores-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
      gap: 20px;
      margin-top: 16px;
      margin-bottom: 24px;
    }

    .store-card {
      background: var(--surface);
      border-radius: var(--radius);
      border: 1px solid var(--border);
      overflow: hidden;
      cursor: pointer;
      transition: all 0.25s;
      box-shadow: var(--shadow-sm);
    }

    .store-card:hover {
      transform: translateY(-4px);
      box-shadow: var(--shadow-md);
    }

    .store-header {
      padding: 18px;
      background: var(--surface-2);
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .store-icon {
      font-size: 40px;
    }

    .store-badge {
      padding: 4px 12px;
      border-radius: 30px;
      font-size: 11px;
      font-weight: 700;
      background: var(--green-lt);
      color: var(--green);
    }

    .store-info {
      padding: 14px 18px;
    }

    .product-tags {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
      padding: 12px 18px 18px;
      border-top: 1px solid var(--border);
    }

    .product-tag {
      background: var(--surface-2);
      padding: 4px 10px;
      border-radius: 20px;
      font-size: 11px;
    }

    /* CART PANEL */
    #cartPanel {
      width: var(--cart-w);
      background: var(--surface);
      border-left: 1px solid var(--border);
      display: flex;
      flex-direction: column;
      overflow-y: auto;
    }

    .cart-header {
      padding: 20px;
      border-bottom: 1px solid var(--border);
    }

    .cart-items {
      flex: 1;
      padding: 16px;
      overflow-y: auto;
    }

    .cart-item {
      display: flex;
      gap: 12px;
      padding: 12px 0;
      border-bottom: 1px solid var(--border);
      align-items: center;
    }

    .cart-footer {
      padding: 20px;
      border-top: 1px solid var(--border);
    }

    .checkout-btn {
      width: 100%;
      background: var(--navy);
      color: white;
      border: none;
      padding: 14px;
      border-radius: 30px;
      font-weight: 800;
      cursor: pointer;
      margin-top: 12px;
      transition: 0.2s;
    }

    .checkout-btn:hover {
      background: var(--primary-green);
    }

    .checkout-btn:disabled {
      background: #ccc;
      cursor: not-allowed;
    }

    /* DELIVERY PARTNERS SECTION - ENHANCED - NOW BELOW GROCERY */
    .delivery-partners {
      background: linear-gradient(135deg, var(--green-lt) 0%, #e8f3f0 100%);
      border-radius: var(--radius);
      padding: 20px;
      margin: 20px 0 0 0;
    }

    .partner-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 16px;
      flex-wrap: wrap;
      gap: 10px;
    }

    .partner-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
      gap: 12px;
    }

    .partner-card {
      background: var(--surface);
      border-radius: 12px;
      padding: 12px;
      display: flex;
      align-items: center;
      gap: 12px;
      box-shadow: var(--shadow-sm);
      transition: all 0.2s;
    }

    .partner-card:hover {
      transform: translateY(-2px);
      box-shadow: var(--shadow-md);
    }

    .partner-avatar-lg {
      width: 48px;
      height: 48px;
      border-radius: 50%;
      background: var(--green-lt);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 24px;
    }

    .partner-info {
      flex: 1;
    }

    .partner-name {
      font-weight: 800;
      font-size: 14px;
    }

    .partner-details {
      font-size: 11px;
      color: var(--text-muted);
      display: flex;
      gap: 8px;
      margin-top: 4px;
      flex-wrap: wrap;
    }

    .partner-rating {
      color: #f5b041;
      font-size: 11px;
    }

    .partner-bike {
      background: var(--surface-2);
      padding: 2px 6px;
      border-radius: 12px;
      font-size: 10px;
    }

    /* AI SUMMARY */
    .ai-card {
      background: linear-gradient(135deg, var(--navy) 0%, #1e3a50 100%);
      border-radius: var(--radius);
      padding: 24px;
      color: white;
      margin: 20px 0;
    }

    .ai-card button {
      background: var(--primary-green);
      border: none;
      padding: 10px 20px;
      border-radius: 30px;
      font-weight: 700;
      margin-top: 12px;
      cursor: pointer;
    }

    .toast {
      position: fixed;
      bottom: 30px;
      left: 50%;
      transform: translateX(-50%);
      background: var(--navy);
      color: white;
      padding: 12px 24px;
      border-radius: 40px;
      z-index: 2000;
      opacity: 0;
      transition: 0.2s;
      pointer-events: none;
      font-weight: 600;
    }

    .toast.show {
      opacity: 1;
    }

    #mapContainer {
      height: 220px;
      border-radius: var(--radius);
      margin: 16px 0;
      border: 1px solid var(--border);
    }

    .chips-row {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      margin: 16px 0;
    }

    .chip {
      padding: 8px 18px;
      border-radius: 40px;
      background: var(--surface);
      border: 1px solid var(--border);
      cursor: pointer;
      font-size: 13px;
      font-weight: 600;
      transition: all 0.2s;
    }

    .chip.active {
      background: var(--navy);
      color: white;
      border-color: var(--navy);
    }

    .product-card {
      background: var(--surface);
      border-radius: 14px;
      padding: 14px;
      margin-bottom: 12px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      border: 1px solid var(--border);
    }

    .cart-control-btn {
      background: var(--surface-2);
      border: none;
      width: 32px;
      height: 32px;
      border-radius: 12px;
      font-size: 18px;
      cursor: pointer;
      transition: 0.2s;
    }

    .back-btn {
      cursor: pointer;
      margin: 16px 0;
      color: var(--primary-green);
      font-weight: 700;
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }

    .profile-section-card {
      background: var(--surface);
      border-radius: var(--radius);
      padding: 24px;
      margin-bottom: 16px;
    }

    .order-card {
      background: var(--surface);
      border-radius: 20px;
      padding: 20px;
      margin-bottom: 12px;
      border: 1px solid var(--border);
    }

    .live-badge {
      background: var(--green);
      color: white;
      padding: 2px 8px;
      border-radius: 20px;
      font-size: 10px;
      margin-left: 6px;
    }

    .section-title {
      font-size: 18px;
      font-weight: 800;
      margin: 20px 0 12px 0;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .grocery-icon {
      font-size: 24px;
    }

    /* CHATBOT WIDGET */
    .chat-bubble {
      position: fixed;
      bottom: 30px;
      right: 30px;
      width: 60px;
      height: 60px;
      background: linear-gradient(135deg, #0d1b2a 0%, #1a7a50 100%);
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      box-shadow: 0 4px 16px rgba(13, 27, 42, 0.3);
      z-index: 999;
      font-size: 28px;
      transition: all 0.3s ease;
      border: 3px solid white;
    }

    .chat-bubble:hover {
      transform: scale(1.1);
      box-shadow: 0 8px 24px rgba(13, 27, 42, 0.4);
    }

    .chat-bubble.active {
      opacity: 0;
      pointer-events: none;
    }

    /* CHAT MODAL */
    .chat-modal {
      position: fixed;
      bottom: 100px;
      right: 30px;
      width: 380px;
      height: 500px;
      background: var(--surface);
      border-radius: 20px;
      box-shadow: 0 8px 32px rgba(13, 27, 42, 0.2);
      display: flex;
      flex-direction: column;
      z-index: 1000;
      opacity: 0;
      transform: translateY(20px);
      transition: all 0.3s ease;
      pointer-events: none;
    }

    .chat-modal.active {
      opacity: 1;
      transform: translateY(0);
      pointer-events: all;
    }

    .chat-header {
      background: linear-gradient(135deg, #0d1b2a 0%, #1a7a50 100%);
      color: white;
      padding: 16px;
      border-radius: 20px 20px 0 0;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .chat-header h3 {
      margin: 0;
      font-size: 16px;
    }

    .chat-close-btn {
      background: none;
      border: none;
      color: white;
      font-size: 20px;
      cursor: pointer;
      padding: 0;
    }

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

    .message {
      padding: 10px 14px;
      border-radius: 12px;
      max-width: 85%;
      word-wrap: break-word;
      animation: slideIn 0.3s ease;
    }

    @keyframes slideIn {
      from {
        opacity: 0;
        transform: translateY(10px);
      }

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

    .message.user {
      background: var(--navy);
      color: white;
      align-self: flex-end;
    }

    .message.bot {
      background: var(--surface-2);
      color: var(--text-primary);
      align-self: flex-start;
    }

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

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

    .chat-input-area input:focus {
      border-color: var(--primary-green);
    }

    .chat-send-btn {
      background: var(--navy);
      border: none;
      color: white;
      width: 40px;
      height: 40px;
      border-radius: 50%;
      cursor: pointer;
      font-size: 18px;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: 0.2s;
    }

    .chat-send-btn:hover {
      background: var(--primary-green);
      transform: scale(1.05);
    }

    .chat-loader {
      display: inline-block;
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: var(--navy);
      animation: chatPulse 1.4s infinite;
      margin: 0 2px;
    }

    .chat-loader:nth-child(2) {
      animation-delay: 0.2s;
    }

    .chat-loader:nth-child(3) {
      animation-delay: 0.4s;
    }

    @keyframes chatPulse {

      0%,
      60%,
      100% {
        opacity: 0.3;
      }

      30% {
        opacity: 1;
      }
    }