/* ===============================
   RESET
================================ */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
  }
  
  /* ===============================
     GLOBAL BODY (NORMAL PAGES)
  ================================ */
  body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
                 Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(180deg, #eef2ff, #f8fafc);
    min-height: 100vh;
  }
  
  /* ===============================
     CENTER ONLY FOR FORM PAGES
  ================================ */
  .center-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
  }
  
  /* ===============================
     FORM / CARD CONTAINER
  ================================ */
  .form-container {
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    width: 100%;
    max-width: 420px;
    padding: 30px 26px;
    border-radius: 22px;
    border: 2px solid #e0e7ff;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.12);
    animation: slideUp 0.4s ease;
  }
  
  /* Animation */
  @keyframes slideUp {
    from {
      opacity: 0;
      transform: translateY(18px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  /* ===============================
     HEADINGS
  ================================ */
  .form-container h2 {
    text-align: center;
    margin-bottom: 6px;
    font-size: 22px;
    font-weight: 700;
    color: #111827;
  }
  
  .subtitle {
    text-align: center;
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 18px;
  }
  
  /* ===============================
     INPUTS
  ================================ */
  .form-container input {
    width: 100%;
    padding: 14px;
    margin-bottom: 14px;
    border-radius: 12px;
    border: 1.5px solid #e5e7eb;
    font-size: 15px;
  }
  
  .form-container input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.18);
  }
  
  /* ===============================
     BUTTONS
  ================================ */
  .form-container button {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
  }
  
  .form-container button:active {
    transform: scale(0.98);
  }
  
  /* ===============================
     SUCCESS PAGE
  ================================ */
  .success-container {
    background: #ffffff;
    max-width: 420px;
    padding: 34px 26px;
    border-radius: 22px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.12);
    text-align: center;
  }
  
  /* ===============================
     QR BOX
  ================================ */
  .qr-box {
    text-align: center;
  }
  
  .qr-box h2 {
    font-size: 24px;
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 14px;
  }
  
  .qr-box img {
    display: block;
    margin: 0 auto 14px;
    padding: 14px;
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    border-radius: 18px;
    max-width: 220px;
    box-shadow: inset 0 0 0 2px #c7d2fe;
  }
  
  .qr-box p {
    font-size: 14px;
    font-weight: 600;
    color: #2563eb;
  }
  
  /* ===============================
     ACTION BUTTONS
  ================================ */
  .actions {
    margin-top: 18px;
    display: flex;
    gap: 12px;
    justify-content: center;
  }
  
  .actions button {
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    background: linear-gradient(135deg, #2563eb, #1e40af);
    color: white;
    border: none;
    cursor: pointer;
  }

  /* ---------- MODAL ---------- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .modal-content {
    background: white;
    width: 100%;
    max-width: 420px;
    padding: 24px;
    border-radius: 18px;
    text-align: center;
    position: relative;
    box-shadow: 0 25px 50px rgba(0,0,0,0.25);
  }
  
  .modal-content h2 {
    color: #1e3a8a;
    margin-bottom: 12px;
  }
  
  .modal-content img {
    width: 220px;
    height: 220px;
    padding: 14px;
    background: #eef2ff;
    border-radius: 16px;
    margin-bottom: 12px;
  }
  
  .modal-content p {
    font-size: 14px;
    color: #475569;
  }
  
  /* Close button */
  .close {
    position: absolute;
    top: 14px;
    right: 18px;
    font-size: 24px;
    cursor: pointer;
    color: #64748b;
  }

/* ===== SIDEBAR ===== */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #0f172a 0%, #020617 100%);
    color: white;
    padding: 26px 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 6px 0 24px rgba(0, 0, 0, 0.25);
  }
  
  /* Sidebar title */
  .sidebar h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 34px;
    padding-left: 6px;
    letter-spacing: 0.4px;
  }
  
  /* ===== MENU ===== */
  .menu {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  
  /* Menu item */
  .menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: #e5e7eb;
    background: rgba(255, 255, 255, 0.06);
    transition: all 0.25s ease;
    position: relative;
  }
  
  /* Hover */
  .menu-item:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: translateX(4px);
  }
  
  /* Active menu */
  .menu-item.active {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    box-shadow: 0 10px 26px rgba(37, 99, 235, 0.55);
    color: white;
  }
  
  /* Active indicator bar */
  .menu-item.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 4px;
    border-radius: 4px;
    background: #93c5fd;
  }
  
  /* Logout */
  .menu-item.logout {
    margin-top: auto;
    background: linear-gradient(135deg, #7f1d1d, #991b1b);
    color: #fee2e2;
  }
  
  .menu-item.logout:hover {
    background: linear-gradient(135deg, #991b1b, #b91c1c);
  }

  /* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .modal-content {
    background: white;
    width: 92%;
    max-width: 420px;
    padding: 28px 24px 24px;
    border-radius: 22px;
    text-align: left;
    box-shadow: 0 30px 70px rgba(0,0,0,0.35);
    position: relative; /* ✅ REQUIRED */
    animation: modalPop 0.25s ease;
  }
  
  @keyframes modalPop {
    from {
      opacity: 0;
      transform: scale(0.95) translateY(12px);
    }
    to {
      opacity: 1;
      transform: scale(1) translateY(0);
    }
  }
  
  .close {
    position: absolute;
    top: 14px;
    right: 16px;
    font-size: 26px;
    font-weight: 700;
    cursor: pointer;
    color: #64748b;
    background: #f1f5f9;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .close:hover {
    background: #e5e7eb;
  }
  
  tbody td {
    padding: 14px 12px;
    border-bottom: 1px solid #e5e7eb;
    color: #334155;
  }
  
  tbody tr:hover td {
    background: #f8fafc;
  }
  
  #customersTable,
  #offersTable {
    border-radius: 14px;
    overflow: hidden;
  }

  .empty {
    text-align: center;
    color: #64748b;
    padding: 32px 16px;
    font-weight: 600;
    font-size: 14px;
  } 

  .modal-content input,
.modal-content textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  font-size: 14px;
  margin-bottom: 12px;
}

.modal-content textarea {
  resize: none;
  min-height: 80px;
}

.modal-content button {
  width: 100%;
  padding: 12px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #2563eb, #1e40af);
  color: white;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
}

table thead th {
    text-align: left !important;
  }
  
  table tbody td {
    text-align: left;
  }

/* ===== IMAGE UPLOAD ===== */
.image-upload {
    margin-bottom: 18px;
  }
  
  .image-upload label {
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    display: block;
    margin-bottom: 8px;
  }
  
  .image-preview {
    width: 100%;
    height: 180px;
    border-radius: 16px;
    border: 2px dashed #c7d2fe;
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    transition: 0.2s ease;
  }
  
  .image-preview:hover {
    background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
  }
  
  .image-preview span {
    font-size: 14px;
    font-weight: 600;
    color: #2563eb;
  }
  
  .image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }  

/* ===== IMAGE UPLOAD ===== */
.image-upload {
    margin: 14px 0 18px;
  }
  
  .image-preview {
    height: 160px;
    border: 2px dashed #c7d2fe;
    border-radius: 16px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    font-weight: 600;
    cursor: pointer;
    overflow: hidden;
  }
  
  .image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  } 
  
  .topbar h1 {
    font-size: 10px;
    font-weight: 600;
  }

  .edit-btn {
    background: #facc15;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
  }
  
  .edit-btn:hover {
    background: #eab308;
  }

  /* ===== BEAUTIFIED DROPDOWN ===== */
.form-select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1.5px solid #cbd5e1;
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  background-color: white;

  /* Custom arrow */
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #475569 50%),
    linear-gradient(135deg, #475569 50%, transparent 50%),
    linear-gradient(to right, #e2e8f0, #e2e8f0);
  background-position:
    calc(100% - 18px) calc(50% - 4px),
    calc(100% - 12px) calc(50% - 4px),
    calc(100% - 2.5rem) 50%;
  background-size: 6px 6px, 6px 6px, 1px 55%;
  background-repeat: no-repeat;

  cursor: pointer;
  transition: all 0.2s ease;
}

/* Hover */
.form-select:hover {
  border-color: #94a3b8;
}

/* Focus */
.form-select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

/* Disabled */
.form-select:disabled {
  background-color: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
}

/* Option styling */
.form-select option {
  font-weight: 500;
}

.form-group {
  margin-bottom: 18px; /* ✅ space before Create Store button */
}

#categorySelect {
  margin-bottom: 18px;
}

.add-store-btn {
  background: linear-gradient(135deg, #2563eb, #1e40af);
  color: white;

  padding: 10px 16px;
  height: 40px;                /* 🔑 force same height */
  line-height: 20px;           /* 🔑 normalize text */

  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;

  text-decoration: none;
  border: none;
  cursor: pointer;

  display: inline-flex;        /* 🔑 align icon + text */
  align-items: center;
  justify-content: center;
  gap: 6px;

  box-sizing: border-box;
}

#pageTitle {
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.topbar h1 {
  font-size: 22px;       /* ✅ Proper admin heading size */
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  letter-spacing: 0.2px;
}

.login-logo {
  display: block;
  margin: 0 auto 16px;
  width: 100px;
  height: auto;
}

/* Login logo styling */
.login-logo {
  display: block;
  margin: 0 auto 2px auto;
  width: 320px;     /* ⬅️ increase width */
  height: auto;     /* keeps proportions */
}

/* Optional: tighten Login heading spacing */
.form-container h2 {
  margin-top: 0px;        /* ⬅️ reduce space above Login */
}

/* Normalize select appearance */
.form-select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px solid #cbd5e1;
  font-size: 14px;

  font-weight: 400;          /* ✅ remove bold */
  color: #0f172a;
  background-color: #ffffff;

  appearance: none;          /* modern look */
}

/* Placeholder option lighter */
.form-select option[value=""] {
  color: #94a3b8;
  font-weight: 400;
}

/* ===== STORE MENU (TOP RIGHT) ===== */
.topbar-actions {
  display: flex;
  align-items: center;
}

.store-menu {
  position: relative;
}

/* Avatar */
.store-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid #e5e7eb;
  background: #f1f5f9;
}

/* Dropdown */
.store-dropdown {
  position: absolute;
  right: 0;
  top: 52px;
  width: 220px;
  background: white;
  border-radius: 14px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.18);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 2000;
}

.store-dropdown.show {
  display: flex;
}

.store-dropdown-header {
  padding: 14px 16px;
  font-size: 14px;
  color: #1e3a8a;
  background: #eef2ff;
}

.store-dropdown button {
  padding: 12px 16px;
  border: none;
  background: none;
  text-align: left;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.store-dropdown button:hover {
  background: #f1f5f9;
}

.store-dropdown button.danger {
  color: #dc2626;
}

.modal-content input,
.modal-content textarea {
  box-sizing: border-box; /* ✅ prevents overflow */
}

/* ===== ALREADY REGISTERED SWITCH ===== */
.switch-login {
  margin-top: 18px;
  text-align: center;
  font-size: 14px;
  color: #475569;
}

.switch-login span {
  margin-right: 6px;
}

.switch-login button {
  background: none;
  border: none;
  padding: 0;
  font-size: 14px;
  font-weight: 700;
  color: #2563eb;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.15s ease;
}

.switch-login button:hover {
  color: #1e40af;
  text-decoration: underline;
  transform: translateX(2px);
}

/* Mobile touch feedback */
.switch-login button:active {
  transform: scale(0.96);
}

/* ===== COUPON BADGE (TOP LEFT) ===== */
.coupon-badge {
  position: absolute;
  top: 12px;
  left: 12px;

  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: white;

  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
  white-space: nowrap;
  z-index: 2;
}

.coupon-enabled {
  background: linear-gradient(135deg, #22c55e, #16a34a);
}

.coupon-disabled {
  background: linear-gradient(135deg, #94a3b8, #64748b);
}