/* GrowSmart POS - Styles v5 */
/* 4D Climate Solutions */

:root {
  --primary: #006838;
  --primary-dark: #004d29;
  --primary-light: #8DC63F;
  --secondary: #00B0E6;
  --brown: #8B7665;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --white: #ffffff;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --header-height: 64px;
  --nav-height: 48px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; }
body { 
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; 
  background: var(--gray-100); 
  color: var(--gray-800);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Offline Indicator */
.offline-indicator {
  position: fixed; top: 0; left: 0; right: 0;
  background: var(--warning); color: var(--gray-900);
  padding: 0.5rem; text-align: center; font-size: 0.85rem; font-weight: 500;
  z-index: 9999; transform: translateY(-100%); transition: transform 0.3s;
}
.offline-indicator.show { transform: translateY(0); }
body.offline { padding-top: 36px; }

/* Auth Screen */
.auth-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  padding: 1rem;
}
.auth-card {
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); width: 100%; max-width: 400px; overflow: hidden;
}
.auth-header { text-align: center; padding: 2rem 2rem 1.5rem; }
.auth-logo { width: 80px; height: 80px; border-radius: 16px; margin-bottom: 1rem; }
.auth-header h1 { font-size: 1.5rem; font-weight: 700; color: var(--primary); margin-bottom: 0.25rem; }
.auth-header p { color: var(--gray-500); font-size: 0.9rem; }
.auth-tabs { display: flex; border-bottom: 1px solid var(--gray-200); }
.auth-tab {
  flex: 1; padding: 0.875rem; border: none; background: none;
  font-size: 0.95rem; font-weight: 600; color: var(--gray-500);
  cursor: pointer; border-bottom: 2px solid transparent; transition: all 0.2s;
}
.auth-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.auth-form { padding: 1.5rem 2rem 2rem; }
.auth-footer {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 1rem; background: var(--gray-50); border-top: 1px solid var(--gray-200);
  font-size: 0.8rem; color: var(--gray-500);
}
.footer-logo { height: 24px; border-radius: 4px; }
.alert {
  padding: 0.75rem 1rem; border-radius: var(--radius-sm); margin: 0 2rem 1rem;
  font-size: 0.875rem; display: none;
}
.alert.show { display: block; }
.alert-error { background: #fef2f2; color: var(--error); border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: var(--success); border: 1px solid #bbf7d0; }

/* Header */
.header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--white);
  height: var(--header-height);
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-md);
}
.header-content {
  max-width: 1400px; margin: 0 auto; height: 100%;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1rem;
}
.header-left { display: flex; align-items: center; gap: 0.75rem; }
.header-logo { height: 40px; border-radius: 8px; background: var(--white); padding: 4px; }
.header-title { font-size: 1.25rem; font-weight: 700; }
.header-right { display: flex; align-items: center; gap: 0.5rem; }

/* Hamburger Button */
.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  gap: 5px;
  padding: 10px;
}
.hamburger-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: all 0.3s;
}
.hamburger-btn.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger-btn.active span:nth-child(2) { opacity: 0; }
.hamburger-btn.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Header Cart Button */
.header-cart-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.15);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
}
.header-cart-btn:hover { background: rgba(255,255,255,0.25); }
.cart-icon { font-size: 1.4rem; }
.header-cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--error);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}
.header-cart-badge:empty,
.header-cart-badge[data-count="0"] { display: none; }

/* Sync Button */
.sync-btn {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--primary-light); color: var(--primary-dark);
  border: none; border-radius: var(--radius-md);
  padding: 0.5rem 1rem; font-size: 0.875rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
}
.sync-btn:hover { background: #9ed54a; transform: scale(1.02); }
.sync-btn.syncing .sync-icon { animation: spin 1s linear infinite; }
.sync-badge { display: none; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* User Menu */
.user-menu { position: relative; }
.user-btn {
  display: flex; align-items: center; gap: 0.5rem;
  background: rgba(255,255,255,0.1); border: none;
  border-radius: var(--radius-md); padding: 0.375rem 0.75rem;
  cursor: pointer; transition: all 0.2s;
}
.user-btn:hover { background: rgba(255,255,255,0.2); }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary-light); color: var(--primary-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700;
}
.user-name { color: var(--white); font-weight: 500; font-size: 0.9rem; }
.user-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--white); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); min-width: 220px;
  opacity: 0; visibility: hidden; transform: translateY(-10px);
  transition: all 0.2s; z-index: 200;
}
.user-dropdown.show { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-header { padding: 1rem; border-bottom: 1px solid var(--gray-200); }
.dropdown-name { display: block; font-weight: 600; color: var(--gray-800); }
.dropdown-email { display: block; font-size: 0.8rem; color: var(--gray-500); margin-top: 0.125rem; }
.role-badge {
  display: inline-block; margin-top: 0.5rem; padding: 0.25rem 0.5rem;
  border-radius: 20px; font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
}
.role-badge.admin { background: #fef3c7; color: #92400e; }
.role-badge.staff { background: #dbeafe; color: #1e40af; }
.role-badge.viewer { background: var(--gray-100); color: var(--gray-600); }
.dropdown-item {
  display: block; width: 100%; padding: 0.75rem 1rem;
  border: none; background: none; text-align: left;
  font-size: 0.9rem; color: var(--gray-700); cursor: pointer;
}
.dropdown-item:hover { background: var(--gray-50); }

/* Navigation Tabs (Desktop) */
.nav-tabs {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: var(--header-height);
  z-index: 90;
}
.nav-tabs-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.nav-tabs-inner::-webkit-scrollbar { display: none; }
.nav-tab {
  padding: 0.875rem 1.25rem;
  border: none;
  background: none;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: all 0.2s;
}
.nav-tab:hover { color: var(--primary); }
.nav-tab.active { color: var(--primary); border-bottom-color: var(--primary-light); }

/* Navigation Drawer (Mobile) */
.nav-drawer-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}
.nav-drawer-overlay.active { opacity: 1; visibility: visible; }

.nav-drawer {
  position: fixed;
  top: 0;
  left: -280px;
  width: 280px;
  height: 100vh;
  background: var(--white);
  z-index: 999;
  display: flex;
  flex-direction: column;
  transition: left 0.3s ease;
  box-shadow: var(--shadow-lg);
}
.nav-drawer.active { left: 0; }

.nav-drawer-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--white);
}
.nav-drawer-logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--white);
  padding: 4px;
}
.nav-drawer-header span { font-weight: 700; flex: 1; }
.nav-drawer-close {
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.2);
  border: none;
  border-radius: 50%;
  color: var(--white);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-drawer-items {
  flex: 1;
  padding: 0.5rem 0;
  overflow-y: auto;
}
.nav-drawer-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 1rem 1.25rem;
  border: none;
  background: none;
  font-size: 1rem;
  font-weight: 500;
  color: var(--gray-700);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
}
.nav-drawer-item:hover { background: var(--gray-50); }
.nav-drawer-item.active {
  background: rgba(0,104,56,0.1);
  color: var(--primary);
  border-left: 4px solid var(--primary);
}

.nav-drawer-footer {
  padding: 1rem;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-50);
}
.nav-drawer-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.nav-drawer-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.nav-drawer-user-info { flex: 1; }
.nav-drawer-user-name { display: block; font-weight: 600; color: var(--gray-800); }
.nav-drawer-user-role { display: block; font-size: 0.8rem; color: var(--gray-500); text-transform: capitalize; }
.nav-drawer-logout {
  width: 100%;
  padding: 0.75rem;
  background: var(--gray-200);
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray-700);
  cursor: pointer;
  transition: all 0.2s;
}
.nav-drawer-logout:hover { background: var(--gray-300); }

/* Cart Sidebar */
.cart-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}
.cart-overlay.active { opacity: 1; visibility: visible; }

.cart-sidebar {
  position: fixed;
  top: 0;
  right: -400px;
  width: 380px;
  max-width: 100%;
  height: 100vh;
  background: var(--white);
  box-shadow: -4px 0 20px rgba(0,0,0,0.15);
  z-index: 999;
  display: flex;
  flex-direction: column;
  transition: right 0.3s ease;
}
.cart-sidebar.active { right: 0; }

.cart-sidebar-header {
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--white);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cart-sidebar-header h3 { margin: 0; font-size: 1.25rem; }
.cart-sidebar-close {
  background: rgba(255,255,255,0.2);
  border: none;
  color: var(--white);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.cart-sidebar-close:hover { background: rgba(255,255,255,0.3); }

.cart-sidebar-items {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}
.cart-sidebar-item {
  display: flex;
  align-items: flex-start;
  padding: 0.75rem;
  background: var(--gray-50);
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  gap: 0.75rem;
}
.cart-sidebar-item-emoji { font-size: 2rem; line-height: 1; }
.cart-sidebar-item-details { flex: 1; min-width: 0; }
.cart-sidebar-item-name { font-weight: 600; color: var(--gray-800); margin-bottom: 0.25rem; }
.cart-sidebar-item-meta { font-size: 0.8rem; color: var(--gray-500); }
.cart-sidebar-item-price { font-weight: 700; color: var(--primary); white-space: nowrap; }
.cart-sidebar-item-remove {
  background: none;
  border: none;
  color: var(--error);
  cursor: pointer;
  padding: 4px;
  font-size: 1.2rem;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.cart-sidebar-item-remove:hover { opacity: 1; }

.cart-sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-50);
}
.cart-sidebar-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--gray-800);
}
.cart-sidebar-total span:last-child { color: var(--primary); }
.cart-empty {
  text-align: center;
  padding: 2rem;
  color: var(--gray-400);
}

/* Main Content */
.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem;
  padding-bottom: calc(env(safe-area-inset-bottom, 0) + 1.5rem);
}
.app-container { display: none; }
.app-container.active { display: block; }

/* Pages */
.page { display: none; }
.page.active { display: block; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Cards */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
  overflow: hidden;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gray-100);
  flex-wrap: wrap;
  gap: 0.75rem;
}
.card-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.card-body { padding: 1.25rem; }
.card-footer {
  padding: 1rem 1.25rem;
  background: var(--gray-50);
  border-top: 1px solid var(--gray-100);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--primary-light);
}
.stat-card.blue { border-left-color: var(--secondary); }
.stat-card.brown { border-left-color: var(--brown); }
.stat-card.dark { border-left-color: var(--primary-dark); }
.stat-icon { font-size: 1.5rem; margin-bottom: 0.5rem; }
.stat-label { font-size: 0.75rem; color: var(--gray-500); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-size: 1.5rem; font-weight: 700; color: var(--gray-800); margin: 0.25rem 0; }
.stat-change { font-size: 0.8rem; color: var(--success); }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-weight: 600; color: var(--gray-700); margin-bottom: 0.375rem; font-size: 0.875rem; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.2s;
  background: var(--white);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(141,198,63,0.15);
}
.form-textarea { min-height: 100px; resize: vertical; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
  color: var(--white);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-secondary { background: var(--secondary); color: var(--white); }
.btn-secondary:hover { background: #0095c4; }
.btn-outline { background: transparent; border: 2px solid var(--gray-300); color: var(--gray-700); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.85rem; }

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.75rem;
}
.product-btn {
  padding: 1rem 0.5rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  background: var(--white);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}
.product-btn:hover { border-color: var(--primary-light); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.product-btn:active { transform: translateY(0); }
.product-emoji { font-size: 2rem; margin-bottom: 0.375rem; }
.product-name { font-weight: 600; font-size: 0.8rem; color: var(--gray-800); margin-bottom: 0.125rem; }
.product-price { font-size: 0.7rem; color: var(--gray-500); }

/* Tables */
.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
th, td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--gray-200); }
th { background: var(--gray-50); font-weight: 600; color: var(--gray-700); white-space: nowrap; }
tr:hover { background: var(--gray-50); }

/* Badges */
.badge {
  display: inline-block;
  padding: 0.25rem 0.625rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-farm { background: rgba(141,198,63,0.15); color: var(--primary); }
.badge-delivery { background: rgba(0,176,230,0.15); color: var(--secondary); }
.badge-paid { background: rgba(16,185,129,0.15); color: var(--success); }
.badge-pending { background: rgba(245,158,11,0.15); color: var(--warning); }

/* Modals */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem;
  border-bottom: 1px solid var(--gray-200);
}
.modal-title { font-size: 1.125rem; font-weight: 700; color: var(--primary); }
.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--gray-400);
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
}
.modal-close:hover { color: var(--gray-600); }
.modal-body { padding: 1.25rem; }
.modal-footer {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-50);
}

/* Checkout Modal */
.checkout-modal .modal { max-width: 500px; }
.checkout-summary {
  background: var(--gray-50);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1rem;
}
.checkout-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--gray-200);
}
.checkout-summary-row:last-child {
  border-bottom: none;
  font-weight: 700;
  font-size: 1.1rem;
  padding-top: 0.75rem;
}
.checkout-summary-row span:last-child { color: var(--primary); }

/* Item List */
.item-list { display: grid; gap: 0.75rem; }
.item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: var(--gray-50);
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
}
.item-info { display: flex; align-items: center; gap: 1rem; }
.item-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  background: var(--white);
}
.item-details h4 { font-weight: 600; margin-bottom: 0.25rem; }
.item-details span { font-size: 0.85rem; color: var(--gray-500); }
.item-actions { display: flex; gap: 0.5rem; }
.action-btn {
  padding: 0.5rem;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
}
.action-btn.edit { background: rgba(0,176,230,0.15); color: var(--secondary); }
.action-btn.delete { background: rgba(239,68,68,0.15); color: var(--error); }
.action-btn.view { background: rgba(0,104,56,0.15); color: var(--primary); }
.action-btn:hover { transform: scale(1.1); }

/* Filters */
.filters { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }
.filter-group { display: flex; align-items: center; gap: 0.375rem; }
.filter-group label { font-size: 0.8rem; color: var(--gray-600); font-weight: 500; }
.filter-group input { padding: 0.5rem; font-size: 0.85rem; }

/* Reconcile */
.reconcile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 0.75rem; margin-bottom: 1.5rem; }
.reconcile-item { text-align: center; }
.reconcile-item label { display: block; font-size: 0.8rem; color: var(--gray-600); margin-bottom: 0.25rem; font-weight: 600; }
.reconcile-item input { width: 100%; text-align: center; padding: 0.5rem; }
.reconcile-summary { background: var(--gray-50); border-radius: var(--radius-md); padding: 1rem; }
.reconcile-row { display: flex; justify-content: space-between; padding: 0.5rem 0; border-bottom: 1px solid var(--gray-200); }
.reconcile-row:last-child { border: none; }
.reconcile-row.total { font-weight: 700; font-size: 1.1rem; }

/* Photo Capture */
.photo-capture { margin: 1rem 0; }
.photo-capture input { display: none; }
.photo-capture-btn {
  width: 100%; padding: 1rem; border: 2px dashed var(--gray-300);
  border-radius: var(--radius-md); background: var(--gray-50);
  cursor: pointer; font-size: 0.9rem; color: var(--gray-600);
  transition: all 0.2s;
}
.photo-capture-btn:hover { border-color: var(--primary); color: var(--primary); }
.photo-preview { display: none; position: relative; margin-top: 0.75rem; }
.photo-preview.show { display: block; }
.photo-preview img { width: 100%; border-radius: var(--radius-md); }
.photo-preview-remove {
  position: absolute; top: 0.5rem; right: 0.5rem;
  background: var(--error); color: white;
  border: none; width: 28px; height: 28px;
  border-radius: 50%; cursor: pointer; font-size: 1rem;
}

/* Cart Total */
.cart-total {
  display: flex;
  justify-content: space-between;
  padding: 1rem;
  background: var(--gray-800);
  border-radius: var(--radius-md);
  color: var(--white);
  font-weight: 700;
  font-size: 1.1rem;
}

/* Receipt */
.receipt-preview {
  background: var(--white); border: 1px solid var(--gray-200);
  border-radius: var(--radius-md); padding: 1.5rem;
  font-family: 'Courier New', monospace; font-size: 0.85rem;
}
.receipt-header { text-align: center; margin-bottom: 1rem; border-bottom: 1px dashed var(--gray-300); padding-bottom: 1rem; }
.receipt-logo { width: 60px; margin-bottom: 0.5rem; }
.receipt-header h3 { margin: 0.5rem 0; }
.receipt-items { margin: 1rem 0; }
.receipt-item { display: flex; justify-content: space-between; padding: 0.25rem 0; }
.receipt-total { display: flex; justify-content: space-between; border-top: 1px dashed var(--gray-300); padding-top: 0.75rem; font-weight: 700; }
.receipt-footer { text-align: center; margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed var(--gray-300); font-size: 0.8rem; color: var(--gray-500); }

/* Empty State */
.empty-state { text-align: center; padding: 2rem; color: var(--gray-500); }
.empty-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.empty-state h3 { color: var(--gray-600); margin-bottom: 0.5rem; }

/* Toast */
.toast {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0) + 1.5rem);
  right: 1.5rem;
  background: var(--gray-800);
  color: var(--white);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transform: translateX(calc(100% + 2rem));
  transition: transform 0.3s ease;
  z-index: 2000;
  max-width: 320px;
}
.toast.show { transform: translateX(0); }
.toast.success { background: var(--success); }
.toast.error { background: var(--error); }
.toast.warning { background: var(--warning); color: var(--gray-900); }
.toast-icon { font-size: 1.25rem; }
.toast-content { flex: 1; }
.toast-title { display: block; font-weight: 600; font-size: 0.9rem; }
.toast-message { display: block; font-size: 0.8rem; opacity: 0.9; }

/* Loading */
.loading-spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Utility */
.mt-2 { margin-top: 1rem; }
.hidden { display: none !important; }

/* Mobile Responsive */
@media (max-width: 768px) {
  :root {
    --header-height: 56px;
  }
  
  .hamburger-btn { display: flex; }
  .nav-tabs { display: none; }
  .header-title { display: none; }
  .sync-text { display: none; }
  .sync-btn { padding: 0.5rem 0.75rem; }
  .user-name { display: none; }
  
  .main-content { padding: 1rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-card { padding: 1rem; }
  .stat-value { font-size: 1.25rem; }
  
  .product-grid { grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
  .product-btn { padding: 0.75rem 0.25rem; }
  .product-emoji { font-size: 1.75rem; }
  .product-name { font-size: 0.75rem; }
  
  .card-header { padding: 1rem; }
  .card-body { padding: 1rem; }
  
  .filters { flex-direction: column; align-items: stretch; }
  .filter-group { justify-content: space-between; }
  
  .modal { margin: 0.5rem; max-height: calc(100vh - 1rem); }
  
  .toast { left: 1rem; right: 1rem; max-width: none; }
  
  .cart-sidebar { width: 100%; max-width: 100%; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 0.75rem; }
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .form-row { grid-template-columns: 1fr; }
}

/* Print Styles */
@media print {
  body * { visibility: hidden; }
  .receipt-print, .receipt-print * { visibility: visible; }
  .receipt-print { position: absolute; left: 0; top: 0; width: 80mm; }
}

/* Quick Filters */
.quick-filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.quick-filter-btn {
  padding: 0.5rem 1rem;
  border: 2px solid var(--gray-200);
  border-radius: 20px;
  background: var(--white);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
  transition: all 0.2s;
}
.quick-filter-btn:hover {
  border-color: var(--primary-light);
  color: var(--primary);
}
.quick-filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

/* Interactive Stat Cards */
.stat-card.interactive {
  cursor: pointer;
  transition: all 0.2s ease;
}
.stat-card.interactive:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}
.stat-card.interactive:active {
  transform: translateY(-2px);
}

/* Sales Total Row */
.sales-total-row {
  background: var(--gray-50);
}
.sales-total-row td {
  padding: 1rem;
  border-top: 2px solid var(--gray-200);
}

/* Report Period Label */
.report-period-label {
  font-size: 0.85rem;
  color: var(--gray-500);
  background: var(--gray-100);
  padding: 0.375rem 0.75rem;
  border-radius: 20px;
}

/* Filters responsive */
@media (max-width: 768px) {
  .quick-filters {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
  }
  .quick-filter-btn {
    flex-shrink: 0;
  }
  .filters {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-group {
    justify-content: space-between;
  }
}

/* Sync Animation */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.sync-btn.syncing {
  pointer-events: none;
  opacity: 0.7;
}
.sync-btn.syncing .sync-icon {
  animation: spin 1s linear infinite;
}

/* Product Pricing Section */
.pricing-section {
  background: var(--gray-50);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin: 1rem 0;
}
.pricing-section h4 {
  margin: 0 0 0.75rem 0;
  font-size: 0.9rem;
  color: var(--gray-700);
}
.calculated-field {
  background: var(--gray-100);
}
.form-hint {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-top: 0.25rem;
  display: block;
}
.profit-preview {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
  margin-top: 0.75rem;
}
.profit-label {
  font-weight: 500;
  color: var(--gray-600);
}
.profit-value {
  font-weight: 700;
  font-size: 1.1rem;
}
.profit-value.positive { color: var(--success); }
.profit-value.negative { color: var(--danger); }

/* Extended Product Card */
.product-card-extended .item-details {
  flex: 1;
}
.product-pricing-info {
  display: flex;
  gap: 1rem;
  margin-top: 0.25rem;
}
.price-retail {
  font-weight: 600;
  color: var(--gray-700);
}
.price-wholesale {
  color: var(--primary);
  font-size: 0.85rem;
}
.product-cost-info {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}
.cost-badge, .margin-badge, .profit-badge {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  font-weight: 500;
}
.cost-badge {
  background: var(--gray-100);
  color: var(--gray-600);
}
.margin-badge {
  background: #e3f2fd;
  color: #1976d2;
}
.profit-badge {
  background: #e8f5e9;
  color: var(--success);
}
.profit-badge.negative {
  background: #ffebee;
  color: var(--danger);
}

/* Receipt Share Buttons */
.receipt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.btn-whatsapp {
  background: #25D366;
  color: white;
  border: none;
}
.btn-whatsapp:hover {
  background: #128C7E;
}
.btn-email {
  background: #EA4335;
  color: white;
  border: none;
}
.btn-email:hover {
  background: #C5221F;
}

/* Wholesale Notice */
.wholesale-notice {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  font-weight: 500;
  text-align: center;
}

/* Profit columns in reports */
.profit-positive {
  color: var(--success);
  font-weight: 600;
}
.profit-negative {
  color: var(--danger);
  font-weight: 600;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .receipt-actions {
    flex-direction: column;
  }
  .receipt-actions .btn {
    width: 100%;
  }
  .product-pricing-info {
    flex-direction: column;
    gap: 0.25rem;
  }
  .product-cost-info {
    gap: 0.25rem;
  }
}
