/* Utility classes */
body, html { margin: 0; padding: 0; font-family: 'Segoe UI', Arial, sans-serif; background: #f7f7f7; }
.container { max-width: 400px; margin: 0 auto; padding: 2rem; }
.center { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; }
.card { background: #fff; border-radius: 12px; box-shadow: 0 2px 16px rgba(0,0,0,0.08); padding: 2rem; width: 100%; margin-bottom: 1rem; transition: box-shadow 0.2s; }
.card:hover { box-shadow: 0 4px 24px rgba(0,0,0,0.12); }
input, button { width: 100%; padding: 0.75rem; margin: 0.5rem 0; border-radius: 6px; border: 1px solid #ddd; font-size: 1rem; }
button { background: #2d2dff; color: #fff; border: none; font-weight: bold; cursor: pointer; transition: background 0.2s; }
button:hover { background: #1a1a99; }
.error { color: #d32f2f; font-size: 0.95rem; margin-top: 0.5rem; }
.hidden {
  visibility: hidden !important;
  position: absolute !important;
  left: -9999px !important;
  top: 0 !important;
  width: 1px !important;
  height: 1px !important;
  pointer-events: none !important;
  z-index: -1 !important;
}
.no-print {
  display: none !important;
}
.login-bg {
  min-height: 100vh;
  background: linear-gradient(120deg, #fffbe6 0%, #ffe5ec 50%, #e0f7fa 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.login-bg::before {
  content: '';
  position: absolute;
  top: -10%; left: -10%;
  width: 120%; height: 120%;
  background: url('https://www.transparenttextures.com/patterns/cubes.png');
  opacity: 0.08;
  z-index: 0;
}
.container.center {
  z-index: 1;
}
.card {
  background: rgba(255,255,255,0.85);
  box-shadow: 0 8px 32px rgba(44,62,80,0.12);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.18);
}
.logo-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1.5rem;
}
.logo-area img {
  width: 64px;
  height: 64px;
  margin-bottom: 0.5rem;
}
.logo-area h1 {
  font-size: 2rem;
  color: #fc575e;
  margin: 0;
  letter-spacing: 2px;
  font-weight: 800;
  text-shadow: 0 2px 8px rgba(252,87,94,0.08);
}
.switch-form { text-align: center; font-size: 0.95rem; }
.switch-form a { color: #2d2dff; text-decoration: underline; cursor: pointer; }

/* POS Terminal Styles */
.pos-bg, .admin-bg {
  min-height: 100vh;
  background: linear-gradient(120deg, #fffbe6 0%, #ffe5ec 50%, #e0f7fa 100%);
  display: flex;
  flex-direction: column;
}
.pos-header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 2rem; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.pos-header h1 { font-size: 1.5rem; margin: 0; }
.role-badge {
  background: #6e8efb;
  color: #fff;
  border-radius: 6px;
  padding: 0.2em 0.7em;
  font-size: 0.9em;
  margin-left: 0.5em;
}
.pos-main { display: flex; flex-direction: row; gap: 2rem; padding: 2rem; }
.products-section, .cart-section { background: #fff; border-radius: 12px; box-shadow: 0 2px 12px rgba(0,0,0,0.06); padding: 1.5rem; flex: 1; }
.products-section {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  padding: 1.5rem;
}
#product-search {
  margin-top: 0;
  margin-bottom: 1rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  border-radius: 6px;
  border: 1px solid #ddd;
  font-size: 1rem;
  box-sizing: border-box;
}
.products-grid {
  margin-top: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  padding-bottom: 20px;
}
.cart-section {
  max-width: 350px;
  position: sticky;
  top: 2rem;
  align-self: flex-start;
  z-index: 10;
}
.tip-area { display: flex; gap: 0.5rem; align-items: center; margin: 1rem 0; }
.cart-summary {
  display: flex;
  justify-content: space-between;
  font-weight: bold;
  margin: 1rem 0;
  color: #2d2dff;
}

/* Admin Panel Styles */
.admin-header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 2rem; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.admin-header h1 { font-size: 1.5rem; margin: 0; }
.role-badge.admin {
  background: #2d2dff;
}
.admin-nav { display: flex; gap: 1rem; background: #fff; padding: 0.5rem 2rem; box-shadow: 0 2px 8px rgba(0,0,0,0.03); }
.nav-btn {
  background: #eaf0ff;
  color: #2d2dff;
  border: none;
  border-radius: 6px;
  padding: 0.5em 1.2em;
  font-size: 1em;
  cursor: pointer;
  transition: background 0.2s;
}
.nav-btn:hover, .nav-btn.active {
  background: #2d2dff;
  color: #fff;
}
.admin-main { padding: 2rem; }
.admin-section { background: #fff; border-radius: 12px; box-shadow: 0 2px 12px rgba(0,0,0,0.06); padding: 1.5rem; margin-bottom: 2rem; }

/* Banners & Modals */
.offline-banner { position: fixed; bottom: 0; left: 0; right: 0; background: #d32f2f; color: #fff; text-align: center; padding: 0.75rem; font-weight: bold; z-index: 1000; }
.modal { 
  display: flex; 
  align-items: center;
  justify-content: center; 
  padding: 0 !important;
  overflow-y: auto;
}
.modal > * { 
  background: #fff; 
  border-radius: 12px;
  padding: 2rem 1.5rem 1.5rem 1.5rem;
  min-width: 320px;
  max-width: 98vw;
  margin: auto;
  box-sizing: border-box;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 4px 32px rgba(44,62,80,0.10);
}
.sales-history-header, .sales-report-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-right: 0.5em;
  padding-left: 0.5em;
  margin-bottom: 1em;
}
.sales-history-header h2, .sales-report-header h2 {
  margin: 0;
  font-size: 1.3em;
  font-weight: 700;
}
.close-btn {
  background: none;
  color: #d32f2f;
  border: none;
  font-size: 1.7em;
  font-weight: bold;
  cursor: pointer;
  padding: 0 0.3em;
  margin-left: 1em;
  margin-right: 0;
  line-height: 1;
  transition: color 0.2s;
}
.close-btn:hover {
  color: #fc575e;
}
.header-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  padding-right: 0.5em;
}

/* Utility & Responsive Tweaks */
@media (max-width: 900px) {
  .pos-main {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }
  .cart-section {
    position: static;
    max-width: 100%;
    width: 100%;
    top: unset;
    z-index: auto;
  }
  .admin-main { padding: 1rem; }
}
@media (max-width: 600px) {
  .pos-header, .admin-header, .admin-nav { padding: 1rem; }
  .products-section, .cart-section, .admin-section { padding: 1rem; }
}

.product-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 200px;
  max-height: 250px;
  height: 100%;
  transition: box-shadow 0.2s;
  overflow: hidden;
}
.product-card:hover {
  box-shadow: 0 4px 16px rgba(252,87,94,0.10);
}
.product-name {
  font-weight: bold;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  word-wrap: break-word;
  line-height: 1.3;
  min-height: 2.6em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-desc {
  font-size: 0.95rem;
  color: #888;
  margin-bottom: 0.5rem;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.product-price {
  font-size: 1.1rem;
  color: #fc575e;
  margin-bottom: 0.5rem;
}
.add-to-cart-btn {
  background: #6e8efb;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.5em 1em;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 0.5rem;
}
.add-to-cart-btn:disabled {
  background: #b3c6fc;
  color: #fff;
  cursor: not-allowed;
}
.add-to-cart-btn:hover:not(:disabled) {
  background: #2d2dff;
}

.cart-table {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.cart-header, .cart-row {
  display: grid;
  grid-template-columns: 2fr 2fr 2fr 1fr;
  align-items: center;
  gap: 0.5rem;
  background: #f7f7f7;
  border-radius: 6px;
  padding: 0.5rem 0.5rem;
}
.cart-header {
  font-weight: bold;
  background: #eaf0ff;
  color: #2d2dff;
}
.cart-row {
  background: #fff;
  color: #222;
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}
.qty-btn {
  background: #6e8efb;
  color: #fff;
  border: none;
  border-radius: 4px;
  width: 24px;
  height: 24px;
  font-size: 1rem;
  font-weight: bold;
  margin: 0 1px;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.qty-btn:hover {
  background: #2d2dff;
}
input.cart-qty {
  width: 40px;
  text-align: center;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin: 0 2px;
  padding: 0.2em 0.4em;
}
.remove-cart-btn {
  background: #eaf0ff;
  color: #fc575e;
  border: none;
  border-radius: 4px;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.2em 0.6em;
  transition: background 0.2s;
}
.remove-cart-btn:hover {
  background: #b3c6fc;
}

.cart-qty-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.cart-qty-val {
  min-width: 24px;
  text-align: center;
  font-weight: bold;
  font-size: 0.9rem;
  color: #222;
  background: #f7f7f7;
  border-radius: 4px;
  padding: 0.1em 0.3em;
  border: 1px solid #eee;
  margin: 0 1px;
}

.cart-items-scroll {
  max-height: 320px;
  overflow-y: auto;
  margin-bottom: 1rem;
}
.cart-section {
  display: flex;
  flex-direction: column;
}
.cart-summary, #checkout-btn {
  flex-shrink: 0;
}
@media (max-width: 900px) {
  .cart-items-scroll {
    max-height: 200px;
  }
}

.cart-product-name {
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  vertical-align: middle;
}
.cart-row > span {
  display: flex;
  align-items: center;
  min-height: 36px;
}

.cart-buttons {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
#clear-cart-btn {
  background: #6c757d;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.75rem;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
  flex: 1;
}
#clear-cart-btn:hover {
  background: #5a6268;
}
#checkout-btn {
  flex: 2;
}

/* Receipt class for thermal printing */
.receipt {
  width: 80mm;
  font-family: 'Courier New', monospace;
  font-size: 10px;
  line-height: 1.2;
  color: black;
  background: white;
  margin: 0;
  padding: 0;
}

/* Receipt Styles */
.receipt-container {
  background: #fff;
  width: 80mm; /* Standard thermal paper width */
  height: auto; /* Let height adjust to content */
  margin: 0 auto;
  padding: 8px;
  font-family: 'Courier New', monospace; /* Better for thermal printers */
  font-size: 9px;
  line-height: 1.1;
  box-shadow: 0 0 20px rgba(0,0,0,0.1);
  border-radius: 8px;
  overflow: visible;
  display: flex;
  flex-direction: column;
  /* Scale up for better screen viewing */
  transform: scale(1.8);
  transform-origin: top center;
  max-width: 90vw;
  max-height: 45vh;
  overflow-y: auto;
}

/* Responsive receipt sizing */
@media (max-width: 1200px) {
  .receipt-container {
    transform: scale(1.5);
    max-height: 50vh;
  }
}

@media (max-width: 900px) {
  .receipt-container {
    transform: scale(1.2);
    max-width: 95vw;
    max-height: 55vh;
  }
  
  .modal {
    padding: 1rem;
  }
  
  .modal > * {
    padding: 1rem;
    max-height: 95vh;
  }
}

@media (max-width: 600px) {
  .receipt-container {
    transform: scale(1.0);
    max-width: 98vw;
    max-height: 60vh;
  }
  
  .modal {
    padding: 0.5rem;
  }
  
  .modal > * {
    padding: 0.5rem;
    max-height: 98vh;
  }
}

.receipt-header {
  text-align: center;
  margin-bottom: 12px;
  border-bottom: 1px solid #000;
  padding-bottom: 8px;
  flex-shrink: 0;
}
.receipt-header h1 {
  font-size: 12px;
  font-weight: bold;
  margin: 0 0 6px 0;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #2d2dff;
}
.receipt-header p {
  margin: 1px 0;
  font-size: 7px;
  color: #666;
}
.receipt-details {
  margin-bottom: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  flex-shrink: 0;
}
.receipt-row {
  display: flex;
  justify-content: space-between;
  margin: 2px 0;
  font-size: 8px;
}
.receipt-divider {
  border: none;
  border-top: 1px dashed #000;
  margin: 8px 0;
}
.receipt-items {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 8px;
  max-height: 120mm; /* Reduced height to prevent overflow */
}
.receipt-item-header {
  display: grid;
  grid-template-columns: 2.5fr 0.8fr 1.2fr 1.2fr;
  gap: 4px;
  font-weight: bold;
  font-size: 8px;
  margin-bottom: 6px;
  border-bottom: 1px solid #000;
  padding-bottom: 4px;
  text-transform: uppercase;
  flex-shrink: 0;
}
.receipt-item {
  display: grid;
  grid-template-columns: 2.5fr 0.8fr 1.2fr 1.2fr;
  gap: 4px;
  margin: 3px 0;
  font-size: 7px;
  padding: 1px 0;
  border-bottom: 1px solid #eee;
}
.item-name {
  word-wrap: break-word;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.item-qty, .item-price, .item-total {
  text-align: right;
  font-weight: 500;
}
.receipt-summary {
  margin-bottom: 8px;
  border-top: 1px solid #000;
  padding-top: 6px;
  flex-shrink: 0;
}
.total-row {
  font-weight: bold;
  font-size: 8px;
  margin: 2px 0;
}
.final-total {
  font-size: 10px;
  border-top: 1px solid #000;
  padding-top: 4px;
  margin-top: 4px;
  color: #2d2dff;
}
.receipt-footer {
  text-align: center;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed #000;
  flex-shrink: 0;
}
.receipt-footer p {
  margin: 1px 0;
  font-size: 6px;
  color: #666;
}
.receipt-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 10px;
  justify-content: center;
  flex-shrink: 0;
}
.print-btn, .close-btn {
  padding: 0.2em 0.7em;
  border: none;
  border-radius: 4px;
  font-weight: bold;
  font-size: 0.72rem;
  min-width: 0;
  height: 28px;
  cursor: pointer;
  transition: background 0.2s;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.print-btn {
  background: #6e8efb;
  color: #fff;
}
.print-btn:hover {
  background: #2d2dff;
}
.close-btn {
  background: #6c757d;
  color: #fff;
}
.close-btn:hover {
  background: #5a6268;
}

/* CSS Custom Properties for thermal paper */
:root {
  --thermal-width: 80mm;
  --thermal-font: 'Courier New', monospace;
  --thermal-font-size: 10px;
}

/* Order History Styles */
.order-filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.order-filters input {
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.9rem;
}

.order-filters button {
  padding: 0.5rem 1rem;
  background: #6e8efb;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
}

.order-filters button:hover {
  background: #2d2dff;
}

.orders-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.order-card {
  background: #fff;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border-left: 4px solid #6e8efb;
}

.order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.order-number {
  font-weight: bold;
  color: #2d2dff;
  font-size: 1.1rem;
}

.order-date {
  color: #666;
  font-size: 0.9rem;
}

.order-details {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 1rem;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.order-items {
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  color: #555;
}

.order-total {
  font-weight: bold;
  color: #2d2dff;
  font-size: 1rem;
}

.order-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.order-actions button {
  padding: 0.4rem 0.8rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: bold;
}

.view-receipt-btn {
  background: #6e8efb;
  color: #fff;
}

.view-receipt-btn:hover {
  background: #2d2dff;
}

.reprint-btn {
  background: #28a745;
  color: #fff;
}

.reprint-btn:hover {
  background: #218838;
}

@media (max-width: 768px) {
  .order-filters {
    flex-direction: column;
    align-items: stretch;
  }
  
  .order-details {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  
  .order-actions {
    flex-direction: column;
  }
}

/* POS Header Actions */
.header-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.header-actions button {
  padding: 0.5rem 1rem;
  background: #6e8efb;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.2s;
}

.header-actions button:hover {
  background: #2d2dff;
}

/* Sales History Styles */
.sales-history-container {
  background: #fff;
  border-radius: 12px;
  padding: 2rem;
  max-width: 800px;
  width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
}

.sales-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #eee;
}

.sales-history-header h2 {
  margin: 0;
  color: #2d2dff;
  font-size: 1.5rem;
}

.sales-filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.sales-filters input {
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.9rem;
}

.sales-filters button {
  padding: 0.5rem 1rem;
  background: #6e8efb;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
}

.sales-filters button:hover {
  background: #2d2dff;
}

.sales-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sale-card {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 1rem;
  border-left: 4px solid #6e8efb;
  transition: box-shadow 0.2s;
}

.sale-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.sale-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.sale-number {
  font-weight: bold;
  color: #2d2dff;
  font-size: 1.1rem;
}

.sale-date {
  color: #666;
  font-size: 0.9rem;
}

.sale-details {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 1rem;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.sale-items {
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  color: #555;
}

.sale-total {
  font-weight: bold;
  color: #2d2dff;
  font-size: 1rem;
}

.sale-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.sale-actions button {
  padding: 0.4rem 0.8rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: bold;
}

.view-sale-receipt-btn {
  background: #6e8efb;
  color: #fff;
}

.view-sale-receipt-btn:hover {
  background: #2d2dff;
}

.reprint-sale-btn {
  background: #28a745;
  color: #fff;
}

.reprint-sale-btn:hover {
  background: #218838;
}

@media (max-width: 768px) {
  .header-actions {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .sales-filters {
    flex-direction: column;
    align-items: stretch;
  }
  
  .sale-details {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  
  .sale-actions {
    flex-direction: column;
  }
  
  .sales-history-container {
    padding: 1rem;
    width: 95vw;
  }
}

/* Sales Report Styles */
.sales-report-container {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  padding: 1.5rem;
  min-width: 320px;
  max-width: 400px;
  margin: auto;
}
.sales-report-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.sales-report-header h2 {
  font-size: 1.3rem;
  margin: 0;
}
.sales-report-list {
  margin-top: 1rem;
}
.sales-report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}
.sales-report-table th, .sales-report-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #eee;
  text-align: left;
}
.sales-report-table th {
  background: #f0f4ff;
  color: #2d2dff;
  font-weight: bold;
}
.sales-report-table tr:last-child td {
  border-bottom: none;
}

.header-btn {
  min-width: 120px;
  height: 44px;
  padding: 0 1.2em;
  font-size: 1rem;
  font-family: inherit;
  border-radius: 6px;
  border: none;
  background: #2d2dff;
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
  margin-left: 0.5rem;
  margin-right: 0.5rem;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}
.header-btn:hover, .header-btn:focus {
  background: #1a1a99;
  outline: none;
}
.header-actions {
  gap: 0.5rem;
} 

.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: 220px;
  background: #232946;
  color: #fff;
  display: flex;
  flex-direction: column;
  z-index: 100;
}
.logo {
  font-size: 1.5em;
  font-weight: bold;
  padding: 1.2em 1em 0.5em 1em;
  letter-spacing: 2px;
  color: #eebbc3;
}
.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  padding: 1em;
}
.nav-btn, .logout-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 1em;
  padding: 0.7em 1em;
  text-align: left;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}
.nav-btn.active, .nav-btn:hover, .logout-btn:hover {
  background: #eebbc3;
  color: #232946;
}
.logout-btn {
  margin-top: 2em;
  background: #d32f2f;
  color: #fff;
}
.main-content {
  margin-left: 220px;
  padding: 2em 2em 2em 2em;
  min-height: 100vh;
}
.admin-section {
  display: none;
  max-width: 1100px;
  margin: 0 auto;
}
.admin-section:not(.hidden) {
  display: block;
}
h2 {
  margin-top: 0;
  font-size: 2em;
  color: #232946;
}
.order-filters, .report-controls, .stock-controls {
  display: flex;
  gap: 1em;
  margin-bottom: 1.5em;
}
.products-grid, #orders-list, #sales-report-table, #stock-report-table {
  display: grid;
  gap: 1em;
}
.products-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.product-card, .order-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  padding: 1em;
  display: flex;
  flex-direction: column;
  gap: 0.5em;
}
.product-actions, .order-actions {
  display: flex;
  gap: 0.5em;
}
button, input, select {
  font-family: inherit;
  font-size: 1em;
}
button {
  background: #232946;
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 0.5em 1.2em;
  cursor: pointer;
  transition: background 0.2s;
}
button:hover {
  background: #eebbc3;
  color: #232946;
}
input[type="text"], input[type="number"], input[type="email"], input[type="date"] {
  padding: 0.5em;
  border: 1px solid #ccc;
  border-radius: 4px;
  margin-bottom: 0.5em;
  width: 100%;
  box-sizing: border-box;
}
label {
  display: block;
  margin-bottom: 0.7em;
}
form {
  background: #fff;
  padding: 1em;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  margin-bottom: 1.5em;
  max-width: 500px;
}
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.modal.hidden {
  display: none;
}
.modal > * {
  background: #fff;
  padding: 2em;
  border-radius: 10px;
  min-width: 320px;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
}
@media (max-width: 700px) {
  .sidebar {
    position: static;
    width: 100%;
    flex-direction: row;
    height: auto;
    padding: 0;
  }
  .main-content {
    margin-left: 0;
    padding: 1em;
  }
}
/* Print styles for reports */
/* (Removed conflicting @media print block here) */

/* Modern Stock Report Table Styles */
.report-table, .stock-report-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  box-shadow: 0 2px 16px rgba(44,62,80,0.07);
  border-radius: 12px;
  overflow: hidden;
  margin: 0 auto 2rem auto;
  font-size: 1.08em;
}
.report-table th, .stock-report-table th {
  background: #f0f4ff;
  color: #2d2dff;
  font-weight: bold;
  padding: 16px 18px;
  border-bottom: 2px solid #e3e8f0;
  text-align: center;
}
.report-table td, .stock-report-table td {
  padding: 14px 18px;
  border-bottom: 1px solid #f0f0f0;
  text-align: center;
  color: #232946;
  background: #fff;
}
.report-table tbody tr:nth-child(even), .stock-report-table tbody tr:nth-child(even) {
  background: #f8faff;
}
.report-table tbody tr:hover, .stock-report-table tbody tr:hover {
  background: #e6f0ff;
}
.report-table tfoot th, .stock-report-table tfoot th {
  background: #e3e8f0;
  color: #232946;
  font-weight: bold;
  border-top: 2px solid #d0d7e2;
}
.report-table th:first-child, .stock-report-table th:first-child,
.report-table td:first-child, .stock-report-table td:first-child {
  border-left: none;
}
.report-table th:last-child, .stock-report-table th:last-child,
.report-table td:last-child, .stock-report-table td:last-child {
  border-right: none;
}
.report-table tr:last-child td, .stock-report-table tr:last-child td {
  border-bottom: none;
}
.report-table {
  table-layout: fixed;
}
.report-table td:nth-child(5) {
  white-space: normal;
  word-break: break-all;
  overflow-wrap: anywhere;
  max-width: 180px;
  min-width: 120px;
  text-align: left;
  vertical-align: top;
}

/* Modern Admin Dashboard Styles */
#dashboard-section {
  background: linear-gradient(120deg, #f0f4ff 0%, #e0f7fa 100%);
  border-radius: 18px;
  box-shadow: 0 4px 32px rgba(44,62,80,0.10);
  padding: 2.5rem 2rem 2rem 2rem;
  margin-bottom: 2.5rem;
  min-height: 60vh;
}
#dashboard-section h2 {
  font-size: 2.2rem;
  color: #2d2dff;
  font-weight: 800;
  margin-bottom: 2rem;
  letter-spacing: 1px;
}
.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  margin-bottom: 2.5rem;
}
.dashboard-card {
  background: linear-gradient(135deg, #eaf0ff 0%, #f6f8fa 100%);
  border-radius: 14px;
  box-shadow: 0 2px 16px rgba(44,62,80,0.08);
  padding: 2rem 1.5rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  position: relative;
  overflow: hidden;
  min-height: 120px;
  transition: box-shadow 0.2s;
}
.dashboard-card:hover {
  box-shadow: 0 6px 32px rgba(44,62,80,0.13);
}
.dashboard-card .stat-label {
  font-size: 1.1rem;
  color: #6e8efb;
  font-weight: 600;
  margin-bottom: 0.5rem;
  letter-spacing: 0.5px;
}
.dashboard-card .stat-value {
  font-size: 2.1rem;
  color: #232946;
  font-weight: 800;
  letter-spacing: 1px;
}
.dashboard-card::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 70px; height: 70px;
  background: linear-gradient(135deg, #6e8efb 0%, #fc575e 100%);
  opacity: 0.12;
  border-radius: 50%;
  z-index: 0;
}
.dashboard-analytics {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 16px rgba(44,62,80,0.07);
  padding: 2rem 1.5rem;
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.dashboard-analytics h3 {
  font-size: 1.3rem;
  color: #2d2dff;
  font-weight: 700;
  margin-bottom: 1.2rem;
}
#dashboard-piechart {
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.piechart-legend {
  margin-top: 1.2rem;
  font-size: 1rem;
  color: #232946;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  align-items: flex-start;
}
@media (max-width: 700px) {
  #dashboard-section {
    padding: 1.2rem 0.5rem;
  }
  .dashboard-cards {
    gap: 1rem;
  }
  .dashboard-card {
    padding: 1.2rem 1rem;
    min-height: 90px;
  }
  .dashboard-analytics {
    padding: 1.2rem 1rem;
  }
}