/* Sips & Bites Café & Restaurant POS - Premium Forest & Cream Palette */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary-forest: #1F4D3A;
  --secondary-sage: #DCE5DC;
  --accent-caramel: #B77A45;
  --bg-cream: #F7F3EA;
  --card-bg: #FFFFFF;
  --text-charcoal: #2C2C2C;
  --text-muted: #7A7772;
  --border-beige: #E6DED1;

  --status-success: #1F4D3A;
  --status-warning: #B77A45;
  --status-error: #B94A48;

  --shadow-sm: 0 2px 8px rgba(31, 77, 58, 0.04);
  --shadow-md: 0 6px 18px rgba(31, 77, 58, 0.07);
  --shadow-lg: 0 12px 28px rgba(31, 77, 58, 0.10);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-cream);
  color: var(--text-charcoal);
  min-height: 100vh;
  font-size: 14.5px;
  line-height: 1.5;
}

.app-layout {
  display: flex;
  min-height: 100vh;
  background-color: var(--bg-cream);
}

h1, h2, h3, h4 {
  color: var(--primary-forest);
  font-weight: 700;
}

/* Left Vertical Sidebar Navigation */
.app-layout {
  display: flex;
  min-height: 100vh;
  background-color: var(--bg-cream);
}

.sidebar {
  width: 250px;
  background: var(--primary-forest);
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1000;
  padding: 16px 14px;
  box-shadow: var(--shadow-md);
  overflow-y: auto;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-logo-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: #FFFFFF;
  padding: 2px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #FFFFFF;
  line-height: 1.1;
}

.brand-subtitle {
  font-size: 9.5px;
  color: #DCE5DC;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.sidebar-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 14px;
}

.nav-btn {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s ease;
  text-align: left;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
}

.nav-btn.active {
  background: rgba(255, 255, 255, 0.16);
  color: #FFFFFF;
  font-weight: 700;
  border-left: 4px solid var(--accent-caramel);
}

.sidebar-sub-nav {
  list-style: none;
  padding: 4px 0 4px 18px;
  margin: 4px 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sub-nav-btn {
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.82);
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  text-align: left;
}

.sub-nav-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #FFFFFF;
}

.sub-nav-btn.active {
  background: var(--accent-caramel);
  color: #FFFFFF;
  font-weight: 700;
  border-radius: 6px;
}

.dropdown-arrow {
  margin-left: auto;
  font-size: 10px;
  transition: transform 0.2s ease;
}

.sidebar-footer {
  padding-top: 12px;
  margin-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-badge {
  background: rgba(255, 255, 255, 0.1);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-logout {
  width: 100%;
  background: var(--status-error);
  color: #FFFFFF;
  border: none;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition: background 0.2s ease;
}

.btn-logout:hover {
  background: #9d3e3c;
}

/* App Main Content Layout */
.app-content-wrapper {
  margin-left: 250px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: calc(100% - 250px);
}

.main-workspace {
  padding: 24px;
  flex: 1;
}

/* Touchscreen Friendly POS Layout */
.pos-layout {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 20px;
  height: calc(100vh - 48px);
}

@media (max-width: 1024px) {
  .sidebar {
    width: 220px;
  }
  .app-content-wrapper {
    margin-left: 220px;
    width: calc(100% - 220px);
  }
  .pos-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
}

.pos-catalog-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
  padding: 4px 18px;
}

/* Category Tabs */
.category-bar {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  scroll-behavior: smooth;
}

.category-tab {
  background: #FFFFFF;
  border: 1px solid var(--border-beige);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  color: var(--text-charcoal);
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.category-tab:hover {
  background: var(--secondary-sage);
  color: var(--primary-forest);
  border-color: var(--secondary-sage);
}

.category-tab.active {
  background: var(--primary-forest);
  color: #FFFFFF;
  border-color: var(--primary-forest);
  box-shadow: var(--shadow-md);
}

.search-bar-container {
  display: flex;
  gap: 12px;
}

.input-field {
  width: 100%;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-beige);
  background: #FFFFFF;
  color: var(--text-charcoal);
  font-size: 14.5px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-field::placeholder {
  color: var(--text-muted);
}

.input-password-secure {
  -webkit-text-security: disc;
  text-security: disc;
}

input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
  -webkit-appearance: none;
}

.input-field:focus {
  border-color: var(--primary-forest);
  box-shadow: 0 0 0 3px rgba(31, 77, 58, 0.12);
}

/* Product Grid & Uniform Square Cards */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
  overflow-y: auto;
  padding-right: 4px;
  align-items: start;
  align-content: start;
  flex: 1;
}

.product-card {
  background: #FFFFFF;
  border-radius: 14px;
  border: 1px solid var(--border-beige);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  user-select: none;
  height: 220px; /* Fixed height for uniform square cards across tablet and desktop */
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-forest);
}

.product-card:active {
  transform: scale(0.98);
}

.product-img-wrapper {
  height: 125px;
  flex-shrink: 0;
  background: var(--bg-cream);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border-beige);
}

.product-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-initials-circle {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--border-beige);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: sans-serif;
  letter-spacing: 0.5px;
}

.product-card-body {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
  background: #FFFFFF;
}

.product-card-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--text-charcoal);
  line-height: 1.25;
  text-transform: uppercase;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 0;
  max-height: 32px;
}

.product-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.product-card-price {
  font-weight: 700;
  font-size: 15px;
  color: var(--primary-forest);
}

.btn-add-cart {
  background: var(--primary-forest);
  color: #FFFFFF;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-weight: 700;
  font-size: 11.5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background 0.2s ease;
}

.btn-add-cart:hover {
  background: #16382a;
}

/* POS Cart Panel */
.pos-cart-panel {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-beige);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.cart-header {
  padding: 16px 20px;
  background: var(--primary-forest);
  color: #FFFFFF;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.order-type-selector {
  display: flex;
  gap: 6px;
  background: rgba(0, 0, 0, 0.15);
  padding: 4px;
  border-radius: var(--radius-sm);
}

.order-type-btn {
  background: var(--secondary-sage);
  border: none;
  color: var(--primary-forest);
  padding: 6px 14px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.order-type-btn.active {
  background: var(--primary-forest);
  color: #FFFFFF;
}

.cart-items-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: var(--bg-cream);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-beige);
}

.cart-item-info {
  flex: 1;
}

.cart-item-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-charcoal);
}

.cart-item-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.qty-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-qty {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--border-beige);
  background: #FFFFFF;
  color: var(--primary-forest);
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-qty:hover {
  background: var(--secondary-sage);
  color: var(--primary-forest);
}

.cart-summary-footer {
  padding: 20px;
  background: #FFFFFF;
  border-top: 1px solid var(--border-beige);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 15px;
  color: var(--text-charcoal);
}

.summary-row.total {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary-forest);
  border-top: 1px dashed var(--border-beige);
  padding-top: 10px;
}

/* View Headers & Header Action Buttons */
.view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  margin-bottom: 14px;
  padding: 6px 18px;
  min-height: 44px;
  gap: 16px;
  flex-wrap: wrap;
}

.view-header h2 {
  margin: 0;
  padding: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-forest);
  line-height: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.view-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  align-self: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0;
}

/* Action Buttons */
.btn {
  height: 36px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: none;
  font-weight: 600;
  font-size: 13.5px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  vertical-align: middle;
}

.btn-primary, .btn-accent {
  background: var(--primary-forest);
  color: #FFFFFF;
}

.btn-primary:hover, .btn-accent:hover {
  background: #16382a;
  box-shadow: var(--shadow-md);
}

.btn-sage {
  background: var(--secondary-sage);
  color: var(--primary-forest);
}

.btn-sage:hover {
  background: #c8d6c8;
}

.btn-danger, .btn-destructive {
  background: var(--status-error);
  color: #FFFFFF;
}

.btn-danger:hover, .btn-destructive:hover {
  background: #9d3e3c;
}

/* Tables & Cards */
.custom-table-container {
  background: #FFFFFF;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-beige);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.custom-table th {
  background: var(--primary-forest);
  color: #FFFFFF;
  padding: 14px 18px;
  font-weight: 600;
  font-size: 14px;
}

.custom-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-beige);
  font-size: 14px;
  color: var(--text-charcoal);
}

.custom-table tr:hover {
  background: var(--bg-cream);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.dash-card {
  background: #FFFFFF;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-beige);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dash-card-title {
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
}

.dash-card-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--primary-forest);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(44, 44, 44, 0.5);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: #FFFFFF;
  width: 90%;
  max-width: 550px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-beige);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.modal-header {
  padding: 18px 24px;
  background: var(--primary-forest);
  color: #FFFFFF;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #FFFFFF;
}

/* Consistent Badges */
.badge-stock {
  font-size: 11.5px;
  padding: 5px 12px;
  border-radius: 6px;
  font-weight: 700;
  display: inline-block;
}

.badge-available { background: var(--secondary-sage); color: var(--primary-forest); }
.badge-soldout { background: #F8EBEB; color: var(--status-error); }
.badge-warning { background: #F5EBE1; color: var(--accent-caramel); }

/* Thermal Receipt Printing (58mm - Officom OC-58IIH / POS standard) */
@media print {
  @page {
    size: 58mm auto;
    margin: 0;
  }
  html, body {
    margin: 0 !important;
    padding: 0 !important;
    background: #FFFFFF !important;
    color: #000000 !important;
  }
  /* Hide UI elements */
  aside, .sidebar, .topbar, .view-panel, .modal-header, .btn, .search-bar-container, 
  .category-bar, .products-grid, .pos-cart-panel, .modal-overlay:not(#receipt-modal) {
    display: none !important;
  }
  #receipt-modal {
    position: static !important;
    display: block !important;
    opacity: 1 !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    backdrop-filter: none !important;
  }
  #receipt-modal .modal-card {
    border: none !important;
    box-shadow: none !important;
    width: 58mm !important;
    max-width: 58mm !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #FFFFFF !important;
  }
  #receipt-modal .modal-header,
  #receipt-modal div[style*="display: flex; gap: 8px;"] {
    display: none !important;
  }
  #thermal-receipt-container {
    display: block !important;
    visibility: visible !important;
    width: 58mm !important;
    max-width: 58mm !important;
    padding: 2mm 3mm !important;
    margin: 0 !important;
    font-family: 'Courier New', Courier, monospace !important;
    font-size: 11.5px !important;
    line-height: 1.3 !important;
    color: #000000 !important;
    background: #FFFFFF !important;
  }
  #thermal-receipt-container * {
    visibility: visible !important;
    color: #000000 !important;
  }
}

