/* High Contrast Bakery Theme - Red primary theme */
:root {
  --primary: #dc2626;
  --primary-dark: #991b1b;
  --secondary: #64748b;
  --danger: #b91c1c;
  --warning: #f59e0b;
  --bg: #fefefe;
  --card: #ffffff;
  --text: #000000;
  --text-light: #374151;
  --border: #9ca3af;
  --shadow: 0 2px 4px rgba(0,0,0,0.15);

  /* Theme specific */
  --accent: #fbbf24;
  --success: #22c55e;
  --card-hover: #fef2f2;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

/* Navigation */
.nav {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  padding: 0.4rem 1rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 0.5rem;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav a {
  color: white;
  text-decoration: none;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  transition: all 0.2s;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}

.nav a:hover {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.4);
}

.nav a.active {
  background: white;
  color: var(--primary-dark);
  border-color: white;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

/* Primary nav buttons (Produse, Productie) - Red theme */
.nav a.nav-primary {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.nav a.nav-primary:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
}

.nav a.nav-primary.active {
  background: white;
  color: var(--primary-dark);
  border-color: white;
}

/* Secondary nav buttons (Administrare, Setari) - Gray theme */
.nav a.nav-secondary {
  background: rgba(156, 163, 175, 0.2);
  border-color: rgba(156, 163, 175, 0.3);
}

.nav a.nav-secondary:hover {
  background: rgba(156, 163, 175, 0.4);
  border-color: rgba(156, 163, 175, 0.6);
}

.nav a.nav-secondary.active {
  background: #9ca3af;
  color: #000;
  border-color: #9ca3af;
}

/* Dropdown nav (Administrare) */
.nav-dropdown {
  position: relative;
  display: inline-flex;
}
.nav-dropdown-toggle {
  color: white;
  background: rgba(156, 163, 175, 0.2);
  border: 1px solid rgba(156, 163, 175, 0.3);
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
  font-family: inherit;
  transition: all 0.2s;
}
.nav-dropdown-toggle:hover {
  background: rgba(156, 163, 175, 0.4);
  border-color: rgba(156, 163, 175, 0.6);
}
.nav-dropdown-toggle.active {
  background: #9ca3af;
  color: #000;
  border-color: #9ca3af;
}
.nav-dropdown-caret {
  font-size: 0.6rem;
  transition: transform 0.15s;
}
.nav-dropdown.open .nav-dropdown-caret {
  transform: rotate(180deg);
}
.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  min-width: 200px;
  padding: 0.3rem;
  display: none;
  z-index: 1000;
}
.nav-dropdown.open .nav-dropdown-menu {
  display: block;
}
.nav-dropdown-item {
  display: flex !important;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.65rem !important;
  color: #333 !important;
  font-size: 0.8rem;
  font-weight: 500 !important;
  border-radius: 4px !important;
  border: 1px solid transparent !important;
  text-decoration: none;
  white-space: nowrap;
  background: transparent !important;
}
.nav-dropdown-item:hover {
  background: #fef2f2 !important;
  color: var(--primary-dark) !important;
  border-color: transparent !important;
}
.nav-dropdown-item.active {
  background: var(--primary) !important;
  color: white !important;
  border-color: var(--primary) !important;
}
.nav-dropdown-separator {
  height: 1px;
  background: var(--border);
  margin: 0.3rem 0.2rem;
}

/* Mobile menu admin group */
.mobile-menu-group {
  margin-top: 0.25rem;
  padding-top: 0.25rem;
  border-top: 1px solid #eee;
}
.mobile-menu-group-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #9ca3af;
  padding: 0.5rem 1rem 0.2rem;
  letter-spacing: 0.05em;
}
.mobile-menu-sublink {
  padding-left: 1.75rem !important;
  font-size: 0.85rem !important;
}

/* Nav Stats Badge */
.nav-stats {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.5rem;
  background: rgba(255,255,255,0.15);
  border-radius: 6px;
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
}

.nav-stats-badge {
  background: #fbbf24;
  color: #000;
  padding: 0.1rem 0.4rem;
  border-radius: 10px;
  font-weight: 700;
  min-width: 22px;
  text-align: center;
  font-size: 0.75rem;
}


/* Nav Date */
.nav-date {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.5rem;
  background: rgba(255,255,255,0.2);
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.3);
}

.nav-date label {
  color: white;
  font-weight: 600;
  font-size: 0.75rem;
}

.nav-date-input {
  padding: 0.2rem 0.4rem;
  border: none;
  border-radius: 4px;
  background: white;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

.nav-date-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.5);
}

.nav-date-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.65rem;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 6px;
  background: white;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
}

.nav-date-trigger:hover {
  background: #fff7f7;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.5);
}

.nav-date-trigger .nav-date-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.nav-date-trigger .date-display {
  color: var(--text);
  white-space: nowrap;
}

/* Date Picker Modal */
.date-modal-content { max-width: 520px !important; }
.date-modal-current {
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  padding: 0.5rem 0;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.date-modal-stepper {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}
.date-step-btn {
  padding: 0.45rem 0.4rem;
  font-size: 0.8rem;
  white-space: nowrap;
  min-width: 0;
}
.date-modal-calendar {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem;
  background: #fafafa;
}
.date-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.date-cal-month-label {
  font-size: 1rem;
  font-weight: 700;
  text-transform: capitalize;
}
.date-cal-nav {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: white;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.date-cal-nav:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.date-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 4px;
}
.date-cal-weekdays span {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0;
}
.date-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.date-cal-day {
  aspect-ratio: 1 / 1;
  border: 1px solid transparent;
  border-radius: 6px;
  background: white;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.1s;
}
.date-cal-day.blank {
  background: transparent;
  cursor: default;
  pointer-events: none;
}
.date-cal-day:not(.blank):hover {
  border-color: var(--primary);
  background: #fff7f7;
}
.date-cal-day.today {
  border-color: var(--primary);
  color: var(--primary);
}
.date-cal-day.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}
.date-cal-day.selected.today {
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.3);
}

.date-display {
  color: white;
  font-weight: 600;
  font-size: 0.8rem;
  white-space: nowrap;
}

/* Warning state when date is not today */
.nav-date.date-warning {
  background: rgba(239, 68, 68, 0.4);
  border-color: #ef4444;
  animation: pulse-warning 1.5s ease-in-out infinite;
}

.nav-date.date-warning .date-display {
  color: #fef2f2;
  font-weight: 700;
}

.nav-date.date-warning .nav-date-trigger {
  background: #fee2e2;
  border-color: #ef4444;
  color: #991b1b;
}
.nav-date.date-warning .nav-date-trigger .date-display {
  color: #991b1b;
  font-weight: 700;
}

@keyframes pulse-warning {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
  50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

.date-reset-btn {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.75rem;
  border: 2px solid white;
  border-radius: 6px;
  background: white;
  color: var(--danger);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-left: 0.5rem;
}

.date-reset-btn:hover {
  background: #fef2f2;
  border-color: #fef2f2;
}

/* Nav Icons */
.nav-icon {
  font-size: 1.1rem;
}

/* Large print button */
.btn-large {
  padding: 1.25rem 3rem;
  font-size: 1.5rem;
  min-height: 60px;
}

/* Container */
.container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 1.5rem;
}

/* Cards */
.card {
  background: var(--card);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.card h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.5rem;
  font-size: 1rem;
  color: var(--text);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
}

input, select, textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fff;
  color: var(--text);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(26, 95, 42, 0.2);
}

input::placeholder {
  color: #9ca3af;
}

textarea { resize: vertical; min-height: 100px; }

/* Buttons - Large, easy to tap */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border: 2px solid transparent;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: none;
  letter-spacing: 0;
  min-height: 44px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn:active {
  transform: translateY(1px);
  box-shadow: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  border-color: var(--primary-dark);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark) 0%, #072f11 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--secondary) 0%, #a34d1f 100%);
  color: white;
  border-color: #a34d1f;
}
.btn-secondary:hover {
  background: linear-gradient(135deg, #a34d1f 0%, #7c3a18 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger) 0%, #991b1b 100%);
  color: white;
  border-color: #991b1b;
}
.btn-danger:hover {
  background: linear-gradient(135deg, #991b1b 0%, #7f1d1d 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}

.btn-warning {
  background: linear-gradient(135deg, var(--warning) 0%, #92400e 100%);
  color: white;
  border-color: #92400e;
}
.btn-warning:hover {
  background: linear-gradient(135deg, #92400e 0%, #78350f 100%);
  transform: translateY(-2px);
}

.btn-outline {
  background: #fff;
  border: 2px solid var(--border);
  color: var(--text);
  box-shadow: none;
}
.btn-outline:hover {
  background: #f3f4f6;
  border-color: var(--primary);
  color: var(--primary);
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  min-height: 36px;
  border-radius: 6px;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.1rem;
  min-height: 56px;
}

.btn-icon-only {
  padding: 0.5rem;
  min-width: 36px;
  width: 36px;
  height: 36px;
}

.btn-group { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }

/* Icon buttons for table actions */
.btn-action {
  padding: 0.35rem 0.6rem;
  min-height: 32px;
  font-size: 0.8rem;
  border-radius: 6px;
  gap: 0.3rem;
}

.btn-action .icon {
  font-size: 1rem;
}

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

/* Category Headers */
.category-header {
  grid-column: 1 / -1;
  background: var(--primary);
  color: white;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.25rem;
}

.category-header:first-child {
  margin-top: 0;
}

.category-header-name {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.category-header-count {
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0.8;
}

.category-header-uncategorized {
  background: #6b7280;
}

.product-card {
  background: #fef2f2;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  padding: 1.25rem;
  cursor: pointer;
  transition: all 0.2s;
  border: 3px solid #fca5a5;
  display: flex;
  flex-direction: column;
  min-height: 120px;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  border-color: #dc2626;
  background: #fecaca;
}

.product-card:active {
  transform: translateY(0);
  background: #fca5a5;
}

.product-card.selected {
  border-color: #dc2626;
  background: #fecaca;
}

.product-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text);
  line-height: 0.8;
}

.product-card .meta {
  font-size: 1rem;
  color: var(--text-light);
  font-weight: 500;
  margin-top: auto;
}

/* Card Size Variants */
/* Small cards */
.grid-products.size-s {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
}
.grid-products.size-s .product-card {
  padding: 0.75rem;
  min-height: 70px;
  border-radius: 8px;
  border-width: 2px;
}
.grid-products.size-s .product-card h3 {
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}
.grid-products.size-s .product-card .meta {
  font-size: 0.8rem;
}
.grid-products.size-s .btn-info {
  width: 22px;
  height: 22px;
  min-width: 22px;
  font-size: 0.75rem;
}

/* Medium cards (default) */
.grid-products.size-m {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}
.grid-products.size-m .product-card {
  padding: 1rem;
  min-height: 100px;
}
.grid-products.size-m .product-card h3 {
  font-size: 1.1rem;
}
.grid-products.size-m .product-card .meta {
  font-size: 0.9rem;
}

/* Large cards */
.grid-products.size-l {
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}
.grid-products.size-l .product-card {
  padding: 1.5rem;
  min-height: 130px;
}
.grid-products.size-l .product-card h3 {
  font-size: 1.35rem;
}
.grid-products.size-l .product-card .meta {
  font-size: 1.05rem;
}

/* XL cards */
.grid-products.size-xl {
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 1.5rem;
}
.grid-products.size-xl .product-card {
  padding: 2rem;
  min-height: 160px;
  border-radius: 16px;
  border-width: 4px;
}
.grid-products.size-xl .product-card h3 {
  font-size: 1.6rem;
  margin-bottom: 0.75rem;
}
.grid-products.size-xl .product-card .meta {
  font-size: 1.15rem;
}
.grid-products.size-xl .btn-info {
  width: 34px;
  height: 34px;
  min-width: 34px;
  font-size: 1.1rem;
}

.product-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  flex: 1;
}

.product-card-header h3 {
  flex: 1;
  margin-bottom: 0;
}

.btn-info {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 50%;
  border: 2px solid #dc2626;
  background: white;
  color: #dc2626;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  font-style: italic;
  font-family: Georgia, serif;
}

.btn-info:hover {
  background: #dc2626;
  color: white;
}

/* Product Info Modal */
.product-info-modal-content {
  max-width: 700px;
  width: 95%;
}

/* Product Info Two-Column Layout */
.product-info-columns {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.product-info-columns .product-info-image {
  flex: 0 0 50%;
  max-width: 50%;
  margin-bottom: 0;
}

.product-info-columns .product-info-details {
  flex: 0 0 50%;
  max-width: 50%;
}

.product-info-columns .product-label-preview {
  font-size: 0.85rem;
  padding: 1rem;
}

.product-info-columns .label-product-name {
  font-size: 1.1rem;
}

.product-info-columns .label-section,
.product-info-columns .label-nutrition {
  font-size: 0.8rem;
}

/* Product Info Image */
.product-info-image {
  text-align: center;
  margin-bottom: 1rem;
  border-radius: 8px;
  overflow: hidden;
  background: #f9fafb;
  border: 1px solid var(--border);
}

.product-info-image img {
  width: 100%;
  max-height: 350px;
  object-fit: contain;
}

/* Image Lightbox */
.image-lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.9);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.image-lightbox.active {
  display: flex;
}

.image-lightbox img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 8px;
}

/* Product Label Preview */
.product-label-preview {
  background: #fff;
  border: 2px solid #333;
  border-radius: 8px;
  padding: 1.25rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

.label-header {
  text-align: center;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #ddd;
}

.label-product-name {
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.25rem;
  line-height: 0.8;
}

.label-weight {
  text-align: center;
  color: var(--text-light);
  margin-bottom: 0.75rem;
}

.label-section {
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.label-allergens {
  color: var(--danger);
}

.label-dates {
  margin: 0.75rem 0;
  padding: 0.5rem;
  background: #f5f5f5;
  border-radius: 4px;
}

.label-expiry {
  font-size: 1.1rem;
  margin-top: 0.25rem;
}

.label-nutrition {
  font-size: 0.85rem;
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid #ddd;
  color: var(--text-light);
}

.label-serie-saga {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 0.5rem;
  text-align: right;
}

/* Loading Overlay */
.loading-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 1rem;
}

.loading-overlay.active {
  display: flex;
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 5px solid #e5e7eb;
  border-top: 5px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-text {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
}

/* Confirm Modal */
.confirm-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.confirm-modal.active {
  display: flex;
}

.confirm-modal-content {
  background: var(--card);
  border-radius: 16px;
  max-width: 400px;
  width: 100%;
  padding: 2rem;
  border: 3px solid var(--danger);
  box-shadow: 0 25px 50px rgba(0,0,0,0.3);
  text-align: center;
}

.confirm-modal-icon {
  font-size: 3rem;
  color: var(--danger);
  margin-bottom: 1rem;
}

.confirm-modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.confirm-modal-message {
  color: var(--text-light);
  margin-bottom: 1.5rem;
}

.confirm-modal-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.confirm-modal-buttons .btn {
  min-width: 120px;
}

/* Reprint Modal */
.reprint-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.reprint-modal.active {
  display: flex;
}

.reprint-modal-content {
  background: var(--card);
  border-radius: 16px;
  max-width: 400px;
  width: 100%;
  padding: 2rem;
  border: 3px solid var(--success);
  box-shadow: 0 25px 50px rgba(0,0,0,0.3);
  text-align: center;
}

.reprint-modal-icon {
  font-size: 3rem;
  color: var(--success);
  margin-bottom: 1rem;
}

.reprint-modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.reprint-modal-message {
  color: var(--text-light);
  margin-bottom: 1rem;
}

.reprint-progress-bar {
  width: 100%;
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.reprint-progress-fill {
  height: 100%;
  background: var(--success);
  border-radius: 3px;
  transition: width 0.1s linear;
}

.reprint-modal-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.reprint-modal-buttons .btn {
  min-width: 120px;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.modal.active { display: flex; }

.modal-content {
  background: var(--card);
  border-radius: 16px;
  max-width: 650px;
  width: 100%;
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  padding: 2rem;
  border: 3px solid var(--primary);
  box-shadow: 0 25px 50px rgba(0,0,0,0.3);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}

.modal-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.print-product-name {
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
  color: var(--text);
}

.modal-close {
  background: var(--danger);
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.modal-close:hover {
  background: #991b1b;
}

/* Search */
.search-bar {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  align-items: center;
  padding: 1rem;
  background: #f9fafb;
  border-radius: 12px;
  border: 2px solid var(--border);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.search-bar input {
  flex: 1;
  min-width: 250px;
  font-size: 1.1rem;
  padding: 1rem;
}

/* Nav Search - Compact version */
.nav-search {
  position: relative;
  min-width: 250px;
  max-width: 400px;
  flex: 1;
}

.nav-search input {
  width: 100%;
  padding: 0.3rem 2rem 0.3rem 0.6rem;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 6px;
  font-size: 0.85rem;
  background: rgba(255,255,255,0.95);
  color: var(--text);
}

.nav-search input:focus {
  outline: none;
  border-color: white;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.3);
}

.nav-search input::placeholder {
  color: #6b7280;
}

.nav-search .search-reset {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: #9ca3af;
  border: none;
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.75rem;
  display: none;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.nav-search .search-reset:hover {
  background: var(--danger);
}

.nav-search.has-text .search-reset {
  display: flex;
}

/* Table */
table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  font-weight: 600;
  background: var(--bg);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Unsaved row highlight */
tr.row-modified {
  background: #fef3c7 !important;
}

tr.row-modified td {
  background: #fef3c7 !important;
}

/* Nutrition Grid */
.nutrition-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
}

.nutrition-grid .form-group {
  margin-bottom: 0;
}

.nutrition-grid input {
  text-align: center;
}

/* Keypad - Large touch targets */
.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  max-width: 280px;
  margin: 1rem auto;
}

.keypad button {
  padding: 0.75rem;
  font-size: 1.5rem;
  font-weight: 700;
  background: #f3f4f6;
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 50px;
}

.keypad button:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.keypad button:active {
  transform: scale(0.95);
  background: var(--primary-dark);
}

.keypad-display {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 700;
  padding: 0.75rem;
  background: #fff;
  border: 2px solid var(--primary);
  border-radius: 8px;
  margin-bottom: 1rem;
  color: var(--primary);
}

/* Print Modal — content always scales down to fit viewport; scrollbar reserved
   as fallback only for extreme sub-350px heights. All sizes use clamp(min, Xvh, max)
   so buttons/fonts shrink smoothly on short screens. */
.print-modal .modal-content {
  display: flex;
  flex-direction: column;
  padding: clamp(0.4rem, 1.5vh, 2rem);
}
.print-modal .modal-header {
  margin-bottom: clamp(0.2rem, 0.8vh, 0.75rem);
  padding-bottom: clamp(0.15rem, 0.5vh, 0.5rem);
  flex-shrink: 0;
}
.print-modal .modal-header h2 {
  font-size: clamp(0.9rem, 2.8vh, 1.25rem);
}
.print-modal .modal-close {
  width: clamp(32px, 5vh, 44px);
  height: clamp(32px, 5vh, 44px);
  font-size: clamp(1.1rem, 2.5vh, 1.5rem);
}
.print-modal .print-product-name {
  margin-bottom: clamp(0.2rem, 0.7vh, 0.5rem);
}
.print-modal p {
  margin-bottom: clamp(0.15rem, 0.5vh, 0.5rem);
}
.print-modal .keypad {
  margin: clamp(0.3rem, 1vh, 1rem) auto;
}
.print-modal .keypad-display {
  margin-bottom: clamp(0.3rem, 1vh, 1rem);
}
.print-modal .btn-group {
  margin-top: clamp(0.3rem, 1vh, 1rem) !important;
  flex-shrink: 0;
}

.print-modal.size-s .keypad { max-width: 260px; row-gap: clamp(0.25rem, 0.6vh, 0.45rem); column-gap: clamp(0.5rem, 1.2vh, 1rem); }
.print-modal.size-s .keypad button { padding: clamp(0.45rem, 1.2vh, 0.9rem); font-size: clamp(1.1rem, 3.2vh, 1.6rem); min-height: clamp(42px, 7vh, 60px); border-radius: 8px; }
.print-modal.size-s .keypad-display { font-size: clamp(1.4rem, 3.8vh, 2.2rem); padding: clamp(0.3rem, 0.8vh, 0.7rem); min-width: 260px; box-sizing: border-box; }
.print-modal.size-s .modal-content { max-width: 360px !important; }
.print-modal.size-s .print-product-name { font-size: clamp(0.8rem, 2.2vh, 1rem) !important; }
.print-modal.size-s .btn-large { padding: clamp(0.35rem, 1vh, 0.5rem) 1.5rem; font-size: clamp(0.8rem, 2.2vh, 0.9rem); }

.print-modal.size-m .keypad { max-width: 340px; row-gap: clamp(0.3rem, 0.8vh, 0.6rem); column-gap: clamp(0.6rem, 1.6vh, 1.2rem); }
.print-modal.size-m .keypad button { padding: clamp(0.55rem, 1.4vh, 1.1rem); font-size: clamp(1.3rem, 3.8vh, 2rem); min-height: clamp(48px, 8vh, 72px); border-radius: 10px; }
.print-modal.size-m .keypad-display { font-size: clamp(1.6rem, 4.6vh, 2.8rem); padding: clamp(0.4rem, 1vh, 0.9rem); min-width: 340px; box-sizing: border-box; }
.print-modal.size-m .modal-content { max-width: 440px !important; }
.print-modal.size-m .print-product-name { font-size: clamp(0.9rem, 2.6vh, 1.1rem) !important; }
.print-modal.size-m .btn-large { padding: clamp(0.4rem, 1.2vh, 0.75rem) 1.75rem; font-size: clamp(0.85rem, 2.4vh, 1rem); }

.print-modal.size-l .keypad { max-width: 410px; row-gap: clamp(0.35rem, 0.9vh, 0.75rem); column-gap: clamp(0.75rem, 1.9vh, 1.4rem); }
.print-modal.size-l .keypad button { padding: clamp(0.6rem, 1.6vh, 1.3rem); font-size: clamp(1.4rem, 4.2vh, 2.25rem); min-height: clamp(52px, 9vh, 84px); border-radius: 10px; }
.print-modal.size-l .keypad-display { font-size: clamp(1.8rem, 5vh, 3.2rem); padding: clamp(0.45rem, 1.2vh, 1.1rem); min-width: 410px; box-sizing: border-box; }
.print-modal.size-l .modal-content { max-width: 520px !important; }
.print-modal.size-l .print-product-name { font-size: clamp(1rem, 2.8vh, 1.4rem) !important; }
.print-modal.size-l .btn-large { padding: clamp(0.4rem, 1.3vh, 0.85rem) 2rem; font-size: clamp(0.9rem, 2.6vh, 1.1rem); }

.print-modal.size-xl .keypad { max-width: 490px; row-gap: clamp(0.4rem, 1vh, 0.85rem); column-gap: clamp(0.9rem, 2.2vh, 1.7rem); }
.print-modal.size-xl .keypad button { padding: clamp(0.65rem, 1.8vh, 1.5rem); font-size: clamp(1.5rem, 4.6vh, 2.6rem); min-height: clamp(56px, 10vh, 100px); border-width: 3px; border-radius: 12px; }
.print-modal.size-xl .keypad-display { font-size: clamp(2rem, 6vh, 4rem); padding: clamp(0.45rem, 1.4vh, 1.35rem); border-width: 3px; border-radius: 12px; min-width: 490px; box-sizing: border-box; }
.print-modal.size-xl .modal-content { max-width: 620px !important; }
.print-modal.size-xl .print-product-name { font-size: clamp(1.05rem, 3vh, 1.6rem) !important; }
.print-modal.size-xl .btn-large { padding: clamp(0.45rem, 1.4vh, 1rem) 2.5rem; font-size: clamp(0.95rem, 2.8vh, 1.2rem); }

/* Tabs */
.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.tab {
  padding: 0.5rem 1rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-light);
  border-radius: 6px;
  transition: all 0.2s;
}

.tab:hover { color: var(--text); background: var(--bg); }
.tab.active { color: var(--primary); background: rgba(220, 38, 38, 0.1); }

/* Filter Tabs (for category filtering) */
.filter-tabs {
  background: white;
  padding: 0.5rem 1.5rem;
  border-bottom: 2px solid #f3f4f6;
  position: sticky;
  top: 42px;
  z-index: 99;
}

.filter-tabs .tabs {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
  flex-wrap: wrap;
}

.filter-tabs .tab {
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
}

.filter-tabs .tab.active {
  background: var(--primary);
  color: white;
}

/* Badge */
.badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }

/* AI Button */
.btn-ai {
  background: linear-gradient(135deg, #8b5cf6, #06b6d4);
  color: white;
}
.btn-ai:hover {
  background: linear-gradient(135deg, #7c3aed, #0891b2);
}

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

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Toast - High visibility */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 1.25rem 2rem;
  background: var(--text);
  color: white;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s;
  z-index: 2000;
  font-size: 1.1rem;
  font-weight: 600;
  border: 3px solid rgba(255,255,255,0.3);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.success {
  background: var(--success);
  border-color: #22c55e;
}

.toast.error {
  background: var(--danger);
  border-color: #ef4444;
}

/* Logout / customer-exit button (in nav — nav has dark gradient bg) */
.customer-exit-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.2s;
  line-height: 1;
  white-space: nowrap;
}
.customer-exit-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
}

/* Hamburger Button - hidden by default, shown in mobile */
.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 6px;
  padding: 8px;
  cursor: pointer;
  width: 40px;
  height: 40px;
  transition: background 0.2s;
}

.hamburger-btn:hover {
  background: rgba(255,255,255,0.3);
}

.hamburger-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: white;
  border-radius: 1px;
  transition: all 0.3s;
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 150;
  opacity: 0;
  transition: opacity 0.3s;
}

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

/* Mobile Menu Slide-out */
.mobile-menu {
  position: fixed;
  top: 0;
  right: -280px;
  width: 280px;
  height: 100%;
  background: white;
  z-index: 200;
  box-shadow: -4px 0 20px rgba(0,0,0,0.2);
  transition: right 0.3s ease;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.mobile-menu.active {
  right: 0;
}

.mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 2px solid var(--border);
  background: var(--primary);
  color: white;
  font-weight: 700;
  font-size: 1.1rem;
}

.mobile-menu-close {
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  font-size: 1.5rem;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-menu-close:hover {
  background: rgba(255,255,255,0.3);
}

.mobile-menu-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 1.25rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  border-bottom: 1px solid #f3f4f6;
  transition: background 0.15s;
}

.mobile-menu-link:hover {
  background: #fef2f2;
}

.mobile-menu-link.active {
  background: #fef2f2;
  color: var(--primary);
  border-left: 4px solid var(--primary);
}

.mobile-menu-section {
  padding: 1rem 1.25rem;
  border-top: 2px solid #f3f4f6;
  margin-top: auto;
}

.mobile-menu-date {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.mobile-menu-date label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-light);
}

.mobile-menu-date .nav-date-input {
  flex: 1;
}

.mobile-menu-stats {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mobile-menu-login {
  margin: 1rem 1.25rem;
  width: calc(100% - 2.5rem);
  justify-content: center;
  display: flex;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
  body {
    font-size: 14px;
  }

  /* Nav: show hamburger, hide nav-left/nav-right, keep search */
  .nav {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
  }

  .nav-left {
    display: none;
  }

  .nav-right {
    display: none;
  }

  .nav-center {
    order: 0;
    grid-column: 1;
  }

  .nav-search {
    min-width: 0;
    max-width: 100%;
    width: 100%;
  }

  .hamburger-btn {
    display: flex;
    order: 1;
    grid-column: 2;
  }

  /* Filter tabs */
  .filter-tabs {
    padding: 0.35rem 0.75rem;
    top: 40px;
  }

  .filter-tabs .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .filter-tabs .tabs::-webkit-scrollbar {
    display: none;
  }

  .filter-tabs .tab {
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Container */
  .container {
    padding: 0.75rem;
  }

  /* Product grid - force single column for all sizes */
  .grid-products,
  .grid-products.size-s,
  .grid-products.size-m,
  .grid-products.size-l,
  .grid-products.size-xl {
    grid-template-columns: 1fr !important;
    gap: 0.75rem;
  }

  /* Product cards */
  .product-card {
    padding: 0.85rem;
    min-height: 70px;
    border-radius: 8px;
    border-width: 2px;
  }

  .product-card h3 {
    font-size: 1.1rem;
  }

  .product-card .meta {
    font-size: 0.9rem;
  }

  /* Card size overrides - normalize all sizes on mobile */
  .grid-products.size-s .product-card,
  .grid-products.size-m .product-card,
  .grid-products.size-l .product-card,
  .grid-products.size-xl .product-card {
    padding: 0.85rem;
    min-height: 70px;
    border-radius: 8px;
    border-width: 2px;
  }

  .grid-products.size-s .product-card h3,
  .grid-products.size-m .product-card h3,
  .grid-products.size-l .product-card h3,
  .grid-products.size-xl .product-card h3 {
    font-size: 1.1rem;
  }

  .grid-products.size-s .product-card .meta,
  .grid-products.size-m .product-card .meta,
  .grid-products.size-l .product-card .meta,
  .grid-products.size-xl .product-card .meta {
    font-size: 0.9rem;
  }

  /* Category headers */
  .category-header {
    padding: 0.3rem 0.6rem;
  }

  .category-header-name {
    font-size: 0.75rem;
  }

  .category-header-count {
    font-size: 0.7rem;
  }

  /* Modals - full width on mobile */
  .modal-content {
    max-width: 100% !important;
    width: 100%;
    padding: 1.25rem;
    border-radius: 12px;
    margin: 0.5rem;
  }

  .modal-header h2 {
    font-size: 1.1rem;
  }

  .modal {
    padding: 0.5rem;
  }

  /* Keypad */
  .keypad {
    max-width: 100%;
    margin: 0.75rem auto;
  }

  .keypad button {
    padding: 0.65rem;
    font-size: 1.3rem;
    min-height: 44px;
  }

  .keypad-display {
    font-size: 2rem;
    padding: 0.5rem;
  }

  /* Print modal size overrides - all force full width on mobile */
  .print-modal.size-s .modal-content,
  .print-modal.size-m .modal-content,
  .print-modal.size-l .modal-content,
  .print-modal.size-xl .modal-content {
    max-width: 100% !important;
    padding: 1.25rem;
  }

  .print-modal.size-s .keypad,
  .print-modal.size-m .keypad,
  .print-modal.size-l .keypad,
  .print-modal.size-xl .keypad {
    max-width: 100%;
  }

  /* Product info modal */
  .product-info-modal-content {
    max-width: 100%;
    width: 100%;
  }

  .product-info-columns {
    flex-direction: column;
  }

  .product-info-columns .product-info-image {
    flex: none;
    max-width: 100%;
    width: 100%;
  }

  .product-info-columns .product-info-details {
    flex: none;
    max-width: 100%;
    width: 100%;
  }

  /* Gramaj modal */
  .gramaj-modal-content {
    max-width: 100%;
    width: 95%;
  }

  .gramaj-btn {
    padding: 1rem 1.25rem;
    font-size: 1.3rem;
    min-height: 60px;
  }

  /* PIN modal */
  .pin-modal-content {
    max-width: 100%;
    width: 95%;
  }

  /* Toast - centered bottom full width */
  .toast {
    left: 0.5rem;
    right: 0.5rem;
    bottom: 1rem;
    text-align: center;
    font-size: 0.95rem;
    padding: 1rem;
  }

  /* Buttons */
  .btn {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    min-height: 40px;
  }

  .btn-large {
    padding: 1rem 2rem;
    font-size: 1.25rem;
    min-height: 50px;
  }

  /* Forms */
  .form-row {
    grid-template-columns: 1fr;
  }

  input, select, textarea {
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
  }

  /* Tables */
  table {
    font-size: 0.85rem;
  }

  th, td {
    padding: 0.5rem;
  }

  /* Search bar */
  .search-bar {
    flex-direction: column;
    padding: 0.75rem;
    margin-bottom: 1rem;
  }

  .search-bar input {
    width: 100%;
    min-width: 0;
    font-size: 1rem;
    padding: 0.75rem;
  }

  /* Screensaver */
  .screensaver-text {
    font-size: 2.5rem;
  }

  .screensaver-dismiss {
    padding: 1rem 2rem;
    font-size: 1.2rem;
  }

  /* Cards */
  .card {
    padding: 1rem;
    margin-bottom: 1rem;
  }

  .card h2 {
    font-size: 1.1rem;
  }

  /* Label preview */
  .product-label-preview {
    padding: 1rem;
    font-size: 0.85rem;
  }

  .label-product-name {
    font-size: 1.1rem;
  }

  /* Confirm/Reprint modals */
  .confirm-modal-content,
  .reprint-modal-content {
    max-width: 100%;
    width: 95%;
    padding: 1.25rem;
  }

  /* Customer mode mobile menu visibility */
  body.customer-mode .mobile-menu .nav-hide-customer {
    display: none !important;
  }

  body.customer-mode .mobile-menu-section.nav-hide-customer {
    display: none !important;
  }
}

/* Extra-small phones */
@media (max-width: 374px) {
  body {
    font-size: 13px;
  }

  .container {
    padding: 0.5rem;
  }

  .nav {
    padding: 0.3rem 0.5rem;
  }

  .product-card {
    padding: 0.65rem;
    min-height: 60px;
  }

  .product-card h3 {
    font-size: 1rem;
  }

  .product-card .meta {
    font-size: 0.8rem;
  }

  .keypad button {
    padding: 0.5rem;
    font-size: 1.1rem;
    min-height: 38px;
  }

  .keypad-display {
    font-size: 1.75rem;
    padding: 0.4rem;
  }

  .modal-content {
    padding: 1rem;
  }

  .filter-tabs .tab {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
  }

  .gramaj-btn {
    padding: 0.75rem 1rem;
    font-size: 1.1rem;
    min-height: 50px;
  }
}

/* Extra touch-friendly for tablets in landscape */
@media (min-width: 768px) and (max-width: 1024px) {
  .product-card {
    padding: 1.5rem;
  }
  .product-card h3 {
    font-size: 1.4rem;
  }
  .btn {
    padding: 1rem 1.75rem;
    font-size: 1.15rem;
  }
}

/* Screen reader only - SEO h1 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Site Footer */
.site-footer {
  background: #1a1a2e;
  color: rgba(255, 255, 255, 0.7);
  padding: 1.5rem;
  font-size: 0.8rem;
  text-align: center;
  margin-top: 2rem;
}

.footer-content {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-logo {
  border-radius: 8px;
  width: 60px;
  height: 60px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.1);
}

.footer-info {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1rem;
  justify-content: center;
}

.footer-info strong {
  color: white;
  width: 100%;
  text-align: center;
}

.footer-info span {
  white-space: nowrap;
}

@media (max-width: 768px) {
  .site-footer {
    padding: 1rem;
    font-size: 0.75rem;
  }

  .footer-content {
    flex-direction: column;
    gap: 0.5rem;
  }

  .footer-logo {
    width: 48px;
    height: 48px;
  }
}

/* Legal info tab */
.legal-info-container {
  max-width: 700px;
  margin: 0 auto;
  padding: 1rem;
}

.legal-section {
  background: white;
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
  border: 2px solid var(--border);
}

.legal-section h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--primary);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.4rem;
}

.legal-section p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text);
}

.legal-section-image {
  max-width: 100%;
  border-radius: 8px;
  margin-top: 0.75rem;
}

.tab-legal {
  background: rgba(59,130,246,0.1) !important;
  color: #2563eb !important;
}

.tab-legal.active {
  background: #2563eb !important;
  color: white !important;
}

/* Print styles */
@media print {
  .nav, .search-bar, .btn, .modal, .site-footer {
    display: none !important;
  }
}
