:root {
  --bg-dark: #f8fafc; /* Changed to Light */
  --bg-card: rgba(255, 255, 255, 0.7); /* Light Glass */
  --text-main: #1e293b; /* Dark Text */
  --text-muted: #64748b;
  --accent-gold: #eab308; /* Slightly darker gold for light mode */
  --accent-gold-hover: #ca8a04;
  --accent-primary: #3b82f6; /* Added a blue primary for admin elements if needed */
  --danger: #ef4444;
  --glass-border: rgba(0, 0, 0, 0.05); /* Subtle dark border */
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.05); /* Light shadow */
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: radial-gradient(circle at top right, rgba(234, 179, 8, 0.05), transparent 40%),
                    radial-gradient(circle at bottom left, rgba(59, 130, 246, 0.05), transparent 40%);
  background-attachment: fixed;
}

/* Glassmorphism utility */
.glass {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: var(--glass-shadow);
}

header {
  padding: 1.5rem 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  border-radius: 0 0 16px 16px;
  border-top: none;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-img {
  height: 50px;
  border-radius: 8px;
}

.logo-fallback {
  display: none;
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--accent-primary);
}

.cart-btn {
  background: transparent;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  position: relative;
  font-size: 1.5rem;
  transition: transform 0.2s ease;
}

.cart-btn:hover {
  transform: scale(1.1);
  color: var(--accent-gold);
}

.whatsapp-float {
  position: fixed;
  right: 1.25rem;
  bottom: calc(1.25rem + env(safe-area-inset-bottom));
  z-index: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 54px;
  padding: 0.8rem 1.15rem;
  color: #fff;
  background: #25d366;
  border: 0;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.22);
  font-weight: 700;
  text-decoration: none;
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.whatsapp-float ion-icon {
  font-size: 1.55rem;
}

.whatsapp-float:hover {
  color: #fff;
  background: #1fba59;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.28);
  transform: translateY(-2px);
}

.whatsapp-float:focus-visible,
.cart-whatsapp-link:focus-visible {
  outline: 3px solid #0f172a;
  outline-offset: 3px;
}

.cart-badge {
  position: absolute;
  top: -8px;
  right: -10px;
  background: var(--accent-gold);
  color: #fff;
  font-size: 0.75rem;
  font-weight: bold;
  height: 20px;
  min-width: 20px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}

main {
  flex: 1;
  padding: 3rem 5%;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.page-title {
  font-size: 2.5rem;
  margin-bottom: 2rem;
  text-align: center;
  background: linear-gradient(to right, var(--text-main), var(--accent-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Products Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
}

.product-card {
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
  padding: 1.5rem;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
}

.product-image {
  width: 100%;
  height: 200px;
  object-fit: contain;
  margin-bottom: 1rem;
  border-radius: 8px;
  background: rgba(0,0,0,0.02);
  padding: 1rem;
}

.product-category {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
  font-weight: bold;
}

.product-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.product-description {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.product-footer {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  margin-top: auto;
}

.product-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-primary);
}

.product-price small {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.sell-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
  gap: 0.5rem;
}

.sell-options-label {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.btn-sell {
  display: flex;
  min-width: 0;
  min-height: 82px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.18rem;
  background: #f1f5f9;
  color: var(--text-main);
  border: 1px solid rgba(100, 116, 139, 0.22);
  padding: 0.65rem;
  border-radius: 8px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.sell-option-name {
  font-size: 0.86rem;
  font-weight: 700;
}

.sell-option-quantity {
  color: var(--text-muted);
  font-size: 0.73rem;
}

.sell-option-price {
  margin-top: 0.12rem;
  color: var(--accent-primary);
  font-size: 0.9rem;
}

.btn-sell-caixa {
  border-color: rgba(29, 78, 216, 0.35);
  background: #eff6ff;
}

.btn-sell:hover {
  transform: translateY(-1px);
  border-color: var(--accent-primary);
  background: #eaf2ff;
}

.btn-sell:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.35);
  outline-offset: 2px;
}

.volume-hint {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: #16a34a;
}

.embalagem-help {
  margin: 0 0 1.5rem;
  padding: 1rem 1.25rem;
  font-size: 0.9rem;
  color: var(--text-main);
}

.embalagem-help p {
  margin: 0.4rem 0 0.6rem;
  color: var(--text-muted);
}

.embalagem-help ul {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--text-muted);
}

.embalagem-help li {
  margin-bottom: 0.25rem;
}

.field-hint {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.atacado-preview {
  margin: 0 0 1.25rem;
  padding: 0.75rem 1rem;
  background: rgba(59, 130, 246, 0.08);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

input:read-only {
  background: rgba(0, 0, 0, 0.04);
}

.cart-item-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}

.btn-add {
  background: var(--accent-primary);
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}

.btn-add:hover {
  background: #2563eb;
}

.btn-add:active {
  transform: scale(0.95);
}

/* Forms (Admin) */
.admin-form-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 2rem;
  margin-bottom: 2rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-main);
}

input, textarea, select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 8px;
  color: var(--text-main);
  font-size: 1rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.btn-submit {
  width: 100%;
  background: var(--accent-primary);
  color: #fff;
  border: none;
  padding: 1rem;
  border-radius: 8px;
  font-weight: bold;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.3s ease;
  margin-top: 1rem;
}

.btn-submit:hover {
  background: #2563eb;
}

/* List Items (Admin) */
.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.list-item:last-child {
  border-bottom: none;
}
.btn-delete {
  background: transparent;
  color: var(--danger);
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
}

/* Modal / Cart Drawer */
.cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cart-overlay.active {
  display: block;
  opacity: 1;
}

.cart-drawer {
  position: fixed;
  top: 1rem;
  right: -430px;
  width: 100%;
  max-width: 410px;
  height: calc(100vh - 2rem);
  background: #ffffff;
  border-left: 1px solid var(--glass-border);
  border-radius: 22px 0 0 22px;
  box-shadow: -18px 22px 40px rgba(0, 0, 0, 0.12);
  z-index: 1001;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cart-drawer.active {
  right: 0;
}

.cart-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.close-cart {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.close-cart:hover {
  color: var(--danger);
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cart-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.cart-item-image {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  object-fit: contain;
  border-radius: 6px;
  background: #f1f5f9;
}

.cart-item-info {
  flex: 1;
  min-width: 0;
}

.cart-item-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.cart-item-price {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.cart-item-summary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.cart-item-line-total {
  color: var(--text-main);
  font-size: 0.88rem;
}

.cart-item-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.qty-btn {
  background: rgba(0,0,0,0.05);
  border: none;
  color: var(--text-main);
  width: 28px;
  height: 28px;
  border-radius: 4px;
  cursor: pointer;
}

.qty-btn:hover {
  background: rgba(0,0,0,0.1);
}

.cart-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--glass-border);
  background: #fafafa;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: bold;
  margin-bottom: 1.5rem;
}

.cart-whatsapp-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin: 0 0 0.75rem;
  padding: 0.7rem 0.8rem;
  color: #168443;
  background: #eaf9ef;
  border: 1px solid rgba(37, 211, 102, 0.35);
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  transition: background 0.2s ease;
}

.cart-whatsapp-link ion-icon {
  font-size: 1.25rem;
}

.cart-whatsapp-link:hover {
  color: #116b36;
  background: #dcf5e5;
}

.btn-checkout {
  width: 100%;
  background: var(--accent-primary);
  color: white;
  border: none;
  padding: 1rem;
  border-radius: 8px;
  font-weight: bold;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.3s ease;
}

.cart-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1200;
  padding: 1rem;
}

.cart-confirm-overlay.active {
  display: flex;
}

.cart-confirm-modal {
  width: min(420px, 100%);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  padding: 1.5rem;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.2);
}

.cart-confirm-modal h3 {
  margin: 0 0 0.75rem;
  font-size: 1.2rem;
  color: var(--text-main);
}

.cart-confirm-modal p {
  margin: 0 0 1.25rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.cart-confirm-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.btn-secondary,
.btn-primary {
  border: none;
  border-radius: 10px;
  padding: 0.8rem 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.btn-secondary {
  background: rgba(15, 23, 42, 0.08);
  color: var(--text-main);
}

.btn-primary {
  background: var(--accent-primary);
  color: #fff;
}

.btn-secondary:hover,
.btn-primary:hover {
  transform: translateY(-1px);
}

.btn-checkout:hover {
  filter: brightness(0.94);
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 3rem 0;
}

.loading {
  text-align: center;
  padding: 3rem;
  color: var(--accent-primary);
  font-size: 1.2rem;
}

.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text-main);
  color: #fff;
  padding: 1rem 2rem;
  border-radius: 8px;
  font-weight: bold;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 9999;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast.toast-error {
  background: var(--danger);
}

/* Filters & Search */
.filters-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem;
  margin-bottom: 2rem;
  background: var(--bg-card);
}

.search-box {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.8);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 8px;
  padding: 0 1rem;
  transition: all 0.3s ease;
}

.search-box:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.search-box ion-icon {
  font-size: 1.2rem;
  color: var(--text-muted);
}

.search-box input {
  border: none;
  background: transparent;
  box-shadow: none;
  flex: 1;
  padding: 1rem;
}

.search-box input:focus {
  outline: none;
  box-shadow: none;
  border-color: transparent;
}

.category-menu {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding-bottom: 0.5rem;
}

.category-btn {
  background: rgba(0,0,0,0.05);
  border: 1px solid transparent;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  color: var(--text-main);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.category-btn:hover {
  background: rgba(0,0,0,0.1);
}

.category-btn.active {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
}

.filters-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.filters-row .search-box {
  flex: 1;
  min-width: 200px;
}

.sort-select {
  min-width: 180px;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  color: var(--text-main);
  font-size: 0.95rem;
  cursor: pointer;
}

.btn-load-more {
  display: block;
  margin: 2rem auto 0;
  padding: 0.875rem 2rem;
  background: transparent;
  border: 2px solid var(--accent-primary);
  color: var(--accent-primary);
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-load-more:hover {
  background: var(--accent-primary);
  color: #fff;
}

.cart-customer-fields {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.product-card.is-sold-out {
  opacity: 0.8;
}

/* ==========================================
   Dashboard Layout (Admin)
   ========================================== */
.admin-layout {
  display: flex;
  flex-direction: row;
  min-height: 100vh;
  background-color: var(--bg-dark);
}

.cart-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 8px;
  background: var(--bg-dark);
  color: var(--text-main);
  font-size: 0.9rem;
}

.cart-input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.esgotado-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,0.7);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.esgotado-badge {
  background: var(--danger);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-weight: bold;
  font-size: 1.2rem;
  transform: rotate(-15deg);
}

.product-card {
  position: relative;
}

.sidebar {
  width: 260px;
  height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border-right: 1px solid var(--glass-border);
  border-radius: 0;
}

.sidebar-header {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.sidebar-logo-icon {
  font-size: 2rem;
  color: var(--accent-primary);
}

.sidebar-header h2 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-main);
}

.sidebar-user {
  padding: 1rem 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
  display: flex;
  flex-direction: column;
}

.nav-item {
  background: transparent;
  border: none;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background: rgba(0,0,0,0.02);
  color: var(--text-main);
}

.nav-item.active {
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent-primary);
  border-right: 3px solid var(--accent-primary);
}

.nav-item ion-icon {
  font-size: 1.25rem;
}

.nav-badge {
  margin-left: auto;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.stat-card strong {
  font-size: 1.5rem;
  color: var(--text-main);
}

.stat-sub {
  color: var(--accent-primary);
  font-weight: 700;
}

.orders-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

.order-address {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  max-width: 280px;
}

.order-details {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.5rem 0;
}

.order-items {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
}

.order-items li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.order-status-label {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 180px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.orders-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding-top: 1rem;
}

.badge-status { color: #fff; }
.badge-novo { background: #f59e0b; }
.badge-confirmado { background: #3b82f6; }
.badge-enviado { background: #8b5cf6; }
.badge-concluido { background: #16a34a; }
.badge-cancelado { background: var(--danger); }

.sidebar-footer {
  padding: 1rem 0;
  border-top: 1px solid rgba(0,0,0,0.05);
}

.text-danger { color: var(--danger) !important; }
.text-primary { color: var(--accent-primary) !important; }
.text-muted { color: var(--text-muted) !important; }
.bg-secondary { background: var(--text-muted) !important; }

.dashboard-content {
  flex: 1;
  padding: 2rem 3rem;
  overflow-y: auto;
}

.dashboard-panel {
  display: none;
  animation: fadeIn 0.3s ease;
}

.dashboard-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel-header {
  margin-bottom: 2rem;
}

.panel-header .page-title {
  text-align: left;
  margin-bottom: 0.5rem;
}

.admin-card {
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.flex-row {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th, .data-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.data-table th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
}

.data-table tr:hover {
  background: rgba(0,0,0,0.01);
}

.badge {
  background: rgba(0,0,0,0.05);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.btn-icon {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.25rem;
  transition: transform 0.2s;
}

.btn-icon:hover {
  transform: scale(1.1);
}

.flex-1 { flex: 1; }
.mb-0 { margin-bottom: 0 !important; }
.form-wide { max-width: 920px; }
.form-narrow { max-width: 480px; }
.btn-inline { width: auto; margin-top: 0; }
.form-status { margin-top: 1rem; text-align: center; font-weight: 600; min-height: 1.25rem; }
.form-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.checkbox-row { display: flex; align-items: center; gap: 0.5rem; }
.checkbox-row input { width: auto; }
.label-danger { margin-bottom: 0; color: var(--danger); font-weight: bold; }
.empty-list-msg { padding: 1rem; text-align: center; color: var(--text-muted); }
.badge-danger { background: var(--danger); color: white; font-size: 0.7rem; }
.row-sold-out { opacity: 0.6; }
.table-scroll { overflow-x: auto; }
.image-preview { max-width: 200px; max-height: 120px; margin-top: 0.75rem; border-radius: 8px; object-fit: cover; }
.alert-warning {
  background: #fef3c7;
  border: 1px solid #f59e0b;
  color: #92400e;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  font-weight: 500;
}
.login-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}
.login-card {
  width: 100%;
  max-width: 400px;
  padding: 3rem 2rem;
}
.login-header {
  text-align: center;
  margin-bottom: 2rem;
}
.login-header ion-icon {
  font-size: 3rem;
  color: var(--accent-primary);
}
.login-header h1 {
  color: var(--text-main);
  font-size: 1.5rem;
  margin-top: 0.5rem;
}

/* ==========================================
   Responsive Adjustments (Mobile & Tablet)
   ========================================== */
@media (max-width: 1100px) {
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .admin-layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 1px solid rgba(0,0,0,0.05);
  }

  .sidebar-nav {
    flex-direction: row;
    overflow-x: auto;
    padding: 0;
  }

  .nav-item {
    white-space: nowrap;
    border-right: none;
    border-bottom: 3px solid transparent;
  }

  .nav-item.active {
    border-right: none;
    border-bottom: 3px solid var(--accent-primary);
  }

  .dashboard-content {
    padding: 1.5rem 5%;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  header {
    padding: 0.85rem 1rem;
    flex-direction: row;
    justify-content: space-between;
  }

  .logo { font-size: 1.2rem; }
  .logo-img { height: 38px; }
  main { padding: 1rem; }
  .page-title { font-size: 1.8rem; margin-bottom: 1.5rem; }
  .filters-container {
    padding: 1rem;
    margin-bottom: 1.25rem;
  }
  .filters-row {
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
  }
  .search-box {
    width: 100%;
  }
  .sort-select {
    width: 100%;
  }
  .category-menu {
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    gap: 0.5rem;
    padding-bottom: 0.25rem;
    scrollbar-width: thin;
  }
  .category-btn {
    flex: 0 0 auto;
  }
  .products-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.25rem; }
  .product-card { padding: 1rem; }
  .product-image { height: 180px; }
  .product-title { font-size: 1.3rem; }
  .product-price { font-size: 1.35rem; }
  .sell-options { gap: 0.45rem; }
  .cart-drawer { max-width: 100%; }
  .admin-form-container { padding: 1.25rem; }
}

@media (max-width: 560px) {
  .whatsapp-float {
    right: 0.85rem;
    bottom: calc(0.85rem + env(safe-area-inset-bottom));
    min-height: 50px;
    padding: 0.7rem 0.95rem;
    font-size: 0.92rem;
  }

  .page-title {
    font-size: 1.7rem;
  }

  main {
    padding: 1rem;
  }

  header {
    padding: 0.8rem 1rem;
  }

  .products-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .product-card {
    padding: 1rem;
  }

  .product-image {
    height: 160px;
  }

  .sell-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
  }

  .btn-sell {
    width: 100%;
    min-width: 0;
  }

  .cart-drawer {
    max-width: 100%;
    width: 100%;
  }

  .cart-item {
    gap: 0.6rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-content {
    padding: 1rem;
  }

  .admin-form-container {
    padding: 1rem;
    margin-bottom: 1rem;
  }

  .btn-submit,
  .btn-checkout {
    font-size: 1rem;
    padding: 0.9rem 1rem;
  }

  .cart-confirm-overlay {
    align-items: flex-end;
    padding: 0.75rem 0.75rem calc(env(safe-area-inset-bottom) + 1rem);
  }

  .cart-confirm-modal {
    width: 100%;
    border-radius: 18px 18px 0 0;
    padding: 1.1rem 1rem 1rem;
  }

  .cart-confirm-actions {
    flex-direction: column-reverse;
  }

  .btn-secondary,
  .btn-primary {
    width: 100%;
  }
}
