@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
  --font-primary: 'Plus Jakarta Sans', sans-serif;
  --font-display: 'Outfit', sans-serif;

  /* Theme Color Palette - Sleek Dark/Glassmorphism */
  --bg-main: #0b0f19;
  --bg-card: rgba(22, 28, 45, 0.7);
  --bg-sidebar: #0f172a;
  --bg-input: #1e293b;
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);

  --text-primary: #f8fafc;
  --text-muted: #94a3b8;
  
  --accent-primary: #6366f1; /* Indigo */
  --accent-secondary: #06b6d4; /* Cyan */
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
  
  --status-completed-bg: rgba(16, 185, 129, 0.15);
  --status-completed-text: #34d399;
  --status-processing-bg: rgba(59, 130, 246, 0.15);
  --status-processing-text: #60a5fa;
  --status-pending-bg: rgba(245, 158, 11, 0.15);
  --status-pending-text: #fbbf24;
  --status-failed-bg: rgba(239, 68, 68, 0.15);
  --status-failed-text: #f87171;
  
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-primary);
  background-color: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

/* App Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 280px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 2rem 1.5rem;
  flex-shrink: 0;
  transition: var(--transition-smooth);
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.logo-icon {
  background: var(--accent-gradient);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-family: var(--font-display);
  font-size: 1.25rem;
}

.logo-text {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.menu-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.menu-item:hover {
  background-color: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
}

.menu-item.active {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.25);
}

.menu-item svg {
  width: 20px;
  height: 20px;
}

/* Main Content Area */
.main-content {
  flex-grow: 1;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 1600px;
  margin: 0 auto;
  width: calc(100% - 280px);
}

/* Top bar / Header */
.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.page-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
}

.store-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--bg-card);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  font-size: 0.875rem;
  color: var(--text-muted);
}

.store-badge-dot {
  width: 8px;
  height: 8px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
}

/* Grid layout for Dashboard statistics */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.stat-card {
  background-color: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-lg);
  transition: var(--transition-smooth);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.3);
}

.stat-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
}

.stat-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.04);
  color: var(--accent-primary);
}

.stat-card:nth-child(even) .stat-icon-wrapper {
  color: var(--accent-secondary);
}

/* Common container elements */
.content-card {
  background-color: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.75rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.search-box {
  position: relative;
  width: 300px;
  max-width: 100%;
}

.search-input {
  width: 100%;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.65rem 1rem 0.65rem 2.5rem;
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: 0.9rem;
  transition: var(--transition-smooth);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px var(--border-focus);
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 16px;
  height: 16px;
}

/* Custom Table Styling */
.table-wrapper {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.925rem;
}

.custom-table th {
  background-color: rgba(15, 23, 42, 0.6);
  padding: 1rem;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  font-family: var(--font-display);
}

.custom-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  vertical-align: middle;
}

.custom-table tbody tr {
  transition: var(--transition-smooth);
}

.custom-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

.product-cell {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.product-img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  background-color: #1e293b;
  border: 1px solid var(--border-color);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}

.badge-completed {
  background-color: var(--status-completed-bg);
  color: var(--status-completed-text);
}

.badge-processing {
  background-color: var(--status-processing-bg);
  color: var(--status-processing-text);
}

.badge-pending, .badge-on-hold {
  background-color: var(--status-pending-bg);
  color: var(--status-pending-text);
}

.badge-cancelled, .badge-failed {
  background-color: var(--status-failed-bg);
  color: var(--status-failed-text);
}

/* Loading & Empty State */
.loading-container, .empty-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
  gap: 1rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(99, 102, 241, 0.1);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 1s infinite linear;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
}

.pagination-info {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.pagination-buttons {
  display: flex;
  gap: 0.5rem;
}

.btn-nav {
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: var(--transition-smooth);
}

.btn-nav:hover:not(:disabled) {
  background-color: var(--accent-primary);
  border-color: var(--accent-primary);
}

.btn-nav:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Grid Layouts */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.category-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: var(--transition-smooth);
}

.category-card:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.3);
}

.category-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.category-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
}

.category-count {
  background-color: var(--bg-input);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.category-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Responsive Rules */
@media (max-width: 992px) {
  .app-container {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
  }
  .logo-container {
    margin-bottom: 1rem;
  }
  .menu-list {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 0.5rem;
  }
  .menu-item {
    padding: 0.5rem 1rem;
    white-space: nowrap;
  }
  .main-content {
    width: 100%;
    padding: 1.5rem;
  }
}

/* Slide Over Drawer Styles */
.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.checkout-drawer {
  position: fixed;
  top: 0;
  right: -420px;
  width: 420px;
  max-width: 100%;
  height: 100%;
  background-color: #0f172a;
  border-left: 1px solid var(--border-color);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.checkout-drawer.open {
  right: 0;
}

.drawer-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-header h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.btn-close-drawer {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.btn-close-drawer:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.drawer-body {
  flex-grow: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.selected-product-summary {
  display: flex;
  gap: 1rem;
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  padding: 1rem;
  border-radius: 12px;
}

.summary-img {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: 8px;
  background-color: #1e293b;
  border: 1px solid var(--border-color);
}

.summary-details {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.summary-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.summary-sku {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.summary-price {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--accent-secondary);
  margin-top: 0.25rem;
}

.drawer-divider {
  border: 0;
  border-top: 1px solid var(--border-color);
}

/* Forms */
.checkout-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-section-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-row {
  display: flex;
  gap: 1rem;
}

.form-row .form-group {
  flex: 1;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}

.form-input, .form-textarea {
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: 0.9rem;
  transition: var(--transition-smooth);
}

.form-input:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.checkout-error {
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--status-failed-text);
  padding: 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-submit-checkout {
  background: linear-gradient(135deg, #ee4d2d 0%, #ff7337 100%); /* Shopee Orange Gradient */
  color: white;
  border: none;
  padding: 0.85rem;
  border-radius: 10px;
  font-weight: 700;
  font-family: var(--font-display);
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
  width: 100%;
  margin-top: 0.5rem;
  box-shadow: 0 4px 15px rgba(238, 77, 45, 0.2);
}

.btn-submit-checkout:hover:not(:disabled) {
  opacity: 0.95;
  box-shadow: 0 4px 20px rgba(238, 77, 45, 0.35);
}

.btn-submit-checkout:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Modal success */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.success-modal {
  background-color: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  max-width: 480px;
  width: 100%;
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  animation: modalScale 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalScale {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.success-icon-wrapper {
  color: #10b981;
  background-color: rgba(16, 185, 129, 0.1);
  padding: 1rem;
  border-radius: 50%;
  display: inline-flex;
}

.success-modal h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.success-modal p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.order-amount-box {
  background-color: rgba(99, 102, 241, 0.05);
  border: 1px solid rgba(99, 102, 241, 0.1);
  padding: 1rem;
  border-radius: 12px;
  width: 100%;
  margin: 0.5rem 0;
}

.amount-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.amount-value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent-secondary);
  margin-top: 0.25rem;
}

.payment-instructions {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  padding: 1rem;
  border-radius: 10px;
  font-size: 0.85rem;
  text-align: left;
}

.small-info {
  margin-top: 0.5rem;
  font-size: 0.75rem !important;
  color: var(--text-muted) !important;
}

.modal-buttons {
  display: flex;
  gap: 1rem;
  width: 100%;
  margin-top: 0.5rem;
}

.payment-link-box {
  width: 100%;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.link-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  font-family: var(--font-display);
}

.link-input-group {
  display: flex;
  gap: 0.5rem;
}

.link-input {
  flex-grow: 1;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: 0.85rem;
  outline: none;
}

.btn-copy-link {
  background-color: var(--accent-primary);
  color: white;
  border: none;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.85rem;
  font-family: var(--font-display);
  transition: var(--transition-smooth);
  white-space: nowrap;
}

.btn-copy-link:hover {
  opacity: 0.9;
}

.btn-whatsapp-share {
  flex: 1.3;
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%); /* WhatsApp Green */
  color: white;
  border: none;
  padding: 0.8rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-family: var(--font-display);
  transition: var(--transition-smooth);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.2);
}

.btn-whatsapp-share:hover {
  opacity: 0.95;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.35);
}

.btn-close-modal {
  flex: 1;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.8rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
  font-family: var(--font-display);
  transition: var(--transition-smooth);
}

.btn-close-modal:hover {
  background-color: var(--border-color);
}

/* Countdown Styles */
.payment-countdown-box {
  background-color: rgba(239, 68, 68, 0.05);
  border: 1px dashed rgba(239, 68, 68, 0.2);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-top: 0.5rem;
}

.countdown-label {
  font-size: 0.85rem;
  color: #ef4444;
  font-weight: 600;
  font-family: var(--font-display);
}

.countdown-value {
  font-size: 1.1rem;
  color: #ef4444;
  font-weight: 700;
  font-family: monospace;
}


