:root {
  --primary-color: #1a1a1a;
  --primary-dark: #000000;
  --primary-light: #f5f5f5;
  --accent-color: #FFF001;
  --accent-hover: #E6D900;
  --text-primary: #212121;
  --text-secondary: #757575;
  --divider-color: #e0e0e0;
  --background: #fafafa;
  --white: #ffffff;
  --error: #d32f2f;
  --success: #388e3c;
}

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

body {
  font-family: 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--background);
  color: var(--text-primary);
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}

/* Header */
header {
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: relative;
}

.header-logo {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  background: #000000;
}

.header-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem 0.75rem 3rem;
  position: relative;
  background: #000000;
  color: var(--white);
}

.salon-name {
  font-size: 1.3rem;
  font-weight: 500;
  color: #FFF001;
}

.header-icons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.icon-button {
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  width: auto;
  line-height: 1;
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.icon-button:hover {
  color: var(--accent-color);
}

.cart-badge {
  background: var(--accent-color);
  color: var(--primary-dark);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.hamburger-menu {
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.8rem;
  cursor: pointer;
  padding: 0.5rem;
  width: auto;
  line-height: 1;
}

.hamburger-menu:hover {
  color: var(--accent-color);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 1rem;
  background: var(--white);
  border-radius: 4px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.2);
  margin-top: 0.5rem;
  min-width: 220px;
  max-width: 280px;
  z-index: 1000;
  max-height: 80vh;
  overflow-y: auto;
}

/* Menu Categories */
.menu-category {
  border-bottom: 1px solid var(--divider-color);
}

.menu-category:last-of-type {
  border-bottom: none;
}

.menu-category-header {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--primary-light);
  border: none;
  text-align: right;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
}

.menu-category-header:hover {
  background: var(--accent-color);
  color: var(--primary-dark);
}

.category-title {
  flex: 1;
  text-align: right;
}

.category-arrow {
  margin-left: 0.5rem;
  font-size: 0.8rem;
  transition: transform 0.2s ease;
}

.menu-category-items {
  max-height: 500px;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  opacity: 1;
}

.menu-category-items.collapsed {
  max-height: 0;
  opacity: 0;
}

/* Menu Items */
.dropdown-menu .menu-item {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2rem;
  background: none;
  border: none;
  text-align: right;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.dropdown-menu .menu-item:hover {
  background: var(--primary-light);
  padding-right: 1.5rem;
  border-left-color: var(--accent-color);
}

/* Standalone menu items (outside categories) */
.dropdown-menu > .menu-item {
  padding-left: 1rem;
  font-weight: 500;
}

.dropdown-menu > .menu-item:hover {
  background: var(--accent-color);
  color: var(--primary-dark);
}

@media (max-width: 768px) {
  .header-bottom {
    padding: 0.5rem 0.5rem 0.5rem 1.5rem;
  }

  .salon-name {
    font-size: 1rem;
  }

  .hamburger-menu {
    font-size: 1.5rem;
  }
}

/* Login Screen */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
}

.login-card {
  background: var(--white);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  width: 100%;
  max-width: 400px;
}

.login-logo {
  display: block;
  max-width: 200px;
  width: 100%;
  height: auto;
  margin: 0 auto 1rem;
  object-fit: contain;
}

.login-card h2 {
  color: var(--primary-dark);
  margin-bottom: 1.5rem;
  text-align: center;
}

.login-card {
  border-top: 4px solid var(--accent-color);
}

/* Form Elements */
.form-group {
  margin-bottom: 1.5rem;
}

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

input, select, textarea {
  width: 100%;
  max-width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--divider-color);
  border-radius: 4px;
  font-size: 1rem;
  transition: border-color 0.3s;
  box-sizing: border-box;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--accent-color);
}

/* Buttons */
button, .btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.1s;
  width: 100%;
}

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

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  background: var(--white);
  color: var(--text-primary);
  border: 1px solid var(--divider-color);
}

.btn-secondary:hover {
  background: var(--primary-light);
}

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* Search */
.search-container {
  background: var(--white);
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin-bottom: 1rem;
}

.search-input-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.search-input-row > div {
  flex: 1;
}

.search-input-row input {
  /* Width controlled by parent div */
}

.btn-scan {
  width: auto;
  padding: 0.75rem 1rem;
  font-size: 1.2rem;
  background: var(--white);
  border: 1px solid var(--divider-color);
}

.btn-scan:hover {
  background: var(--accent-color);
}

/* Search Filters Grid */
.search-filters-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.filter-checkboxes {
  display: flex;
  gap: 1.5rem;
}

.filter-checkboxes label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-weight: normal;
  color: var(--text-primary);
  margin: 0;
}

.filter-checkboxes input[type="checkbox"] {
  width: auto;
  cursor: pointer;
  margin: 0;
}

/* Filter Row for Numbers - Quantity and Price in one row */
.filter-row-numbers {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem;
  align-items: center;
}

/* Mobile: slightly smaller padding */
@media (max-width: 768px) {
  .filter-input {
    padding: 0.65rem 0.5rem;
    font-size: 0.9rem;
  }

  .multi-select-display {
    padding: 0.65rem 0.8rem;
    font-size: 0.9rem;
  }
}

.filter-input {
  padding: 0.75rem;
  border: 1px solid var(--divider-color);
  border-radius: 4px;
  font-size: 0.9rem;
}

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

.multi-select-wrapper {
  position: relative;
  /* Width controlled by parent grid */
}

.multi-select-display {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--white);
  border: 1px solid var(--divider-color);
  border-radius: 4px;
  cursor: pointer;
  min-height: 44px;
  transition: border-color 0.2s;
}

.multi-select-display:hover {
  border-color: var(--accent-color);
}

.multi-select-display.active {
  border-color: var(--accent-color);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.dropdown-arrow {
  color: var(--text-secondary);
  transition: transform 0.2s;
}

.multi-select-display.active .dropdown-arrow {
  transform: rotate(180deg);
}

.multi-select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--white);
  border: 1px solid var(--accent-color);
  border-top: none;
  border-radius: 0 0 4px 4px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  max-height: 300px;
  overflow: hidden;
  z-index: 1000;
}

.multi-select-search {
  padding: 0.5rem;
  border-bottom: 1px solid var(--divider-color);
}

.multi-select-search input {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--divider-color);
  border-radius: 4px;
  font-size: 0.9rem;
}

.multi-select-options {
  max-height: 240px;
  overflow-y: auto;
}

.multi-select-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.multi-select-option:hover {
  background: var(--background);
}

.multi-select-option input[type="checkbox"] {
  width: auto;
  cursor: pointer;
  margin: 0;
}

.multi-select-option label {
  cursor: pointer;
  margin: 0;
  flex: 1;
  font-weight: normal;
}

/* Highlight for POZOSTALE supplier */
.supplier-pozostale {
  background-color: rgba(211, 47, 47, 0.08) !important;
}

.supplier-pozostale:hover {
  background-color: rgba(211, 47, 47, 0.15) !important;
}

.btn-scan {
  width: auto;
  padding: 0.75rem 1rem;
  background: var(--primary-dark);
  color: var(--accent-color);
  font-weight: 600;
}

.btn-scan:hover {
  background: var(--primary-color);
}

/* Results List */
.results-list {
  background: var(--white);
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  overflow: hidden;
}

.result-item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background-color 0.2s;
  border-bottom: 1px solid var(--divider-color);
}

.result-item:last-child {
  border-bottom: none;
}

.result-item.alternate {
  background: #f5f5f5;
}

.result-item:hover {
  background: var(--accent-color);
}

.result-item.alternate:hover {
  background: var(--accent-color);
}

.result-row-1 {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  align-items: baseline;
}

.result-code {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  min-width: 60px;
}

.result-name {
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
}

.result-row-2 {
  display: flex;
  gap: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.result-row-2 strong {
  color: var(--text-primary);
}

.result-price {
  margin-left: auto;
  color: var(--success);
  font-weight: 500;
}

/* Legacy table styles (for other tables) */
table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: var(--primary-dark);
}

th {
  padding: 1rem;
  text-align: left;
  font-weight: 500;
  color: var(--accent-color);
}

td {
  padding: 1rem;
  border-bottom: 1px solid var(--divider-color);
}

/* Product Details */
.product-details {
  background: var(--white);
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  padding: 1.5rem;
}

.product-header {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.product-image {
  width: 80px;
  height: auto;
  object-fit: contain;
  border: 1px solid var(--divider-color);
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.2s;
}

.product-image:hover {
  transform: scale(1.05);
}

.product-info h2 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.product-info .code {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.info-table {
  width: 100%;
  margin: 1rem 0;
}

.info-table tr:nth-child(even) {
  background: #f5f5f5;
}

.info-table td {
  padding: 0.5rem;
}

.info-table td:first-child {
  font-weight: 500;
  color: var(--text-secondary);
  width: 40%;
}

.product-description {
  margin: 1.5rem 0;
  padding: 0;
  background: var(--primary-light);
  border-radius: 4px;
  border: 1px solid var(--divider-color);
}

.product-description summary {
  padding: 1rem;
  cursor: pointer;
  font-weight: 500;
  color: var(--primary-color);
  font-size: 1.05rem;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  transition: background-color 0.2s;
}

.product-description summary::-webkit-details-marker {
  display: none;
}

.product-description summary:before {
  content: '▶';
  margin-right: 0.75rem;
  transition: transform 0.2s;
  font-size: 0.8rem;
  color: var(--accent-color);
}

.product-description[open] summary:before {
  transform: rotate(90deg);
}

.product-description summary:hover {
  background: rgba(0, 0, 0, 0.02);
}

.product-description p {
  padding: 0 1rem 1rem 2.5rem;
  line-height: 1.6;
  color: var(--text-primary);
  margin: 0;
}

.stock-section {
  margin: 1.5rem 0;
  padding: 1rem;
  background: var(--primary-light);
  border-radius: 4px;
}

.stock-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.stock-item {
  text-align: center;
  padding: 0.75rem;
  background: var(--white);
  border-radius: 4px;
}

.stock-item .label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.stock-item .value {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--primary-color);
}

.price-section {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 1rem 0;
}

.price-item {
  /* grid item */
}

.price-item .label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.price-item .value {
  font-size: 1.8rem;
  font-weight: 500;
  color: var(--success);
}

/* Cart */
.cart-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.quantity-input {
  width: 80px;
}

/* Loading Spinner */
.spinner {
  border: 3px solid var(--divider-color);
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 2rem auto;
}

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

/* Alerts */
.alert {
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.alert-error {
  background: #ffebee;
  color: var(--error);
}

.alert-success {
  background: #e8f5e9;
  color: var(--success);
}

/* Responsive */
@media (max-width: 768px) {
  .product-header {
    flex-direction: column;
  }

  .product-image {
    width: 80px;
    height: auto;
  }

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

  table {
    font-size: 0.9rem;
  }

  th, td {
    padding: 0.5rem;
  }
}

/* Utility Classes */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

/* Clear Icon for Input Fields */
.clear-icon {
  background: #ccc;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  line-height: 1;
  transition: background 0.2s ease;
}

.clear-icon:hover {
  background: #999;
}

.mt-1 { margin-top: 1rem; }
.mb-1 { margin-bottom: 1rem; }

.sync-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

.sync-buttons button {
  width: 100%;
}

#sync-status {
  padding: 1rem;
  background: var(--primary-light);
  border-radius: 4px;
  display: none;
}

#sync-status.show {
  display: block;
}

.back-button {
  background: var(--divider-color);
  color: var(--text-primary);
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin-bottom: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.back-button:hover {
  background: #d0d0d0;
}

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

.modal-content {
  background: var(--white);
  border-radius: 8px;
  padding: 1.5rem;
  max-width: 90%;
  max-height: 90%;
  overflow: auto;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

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

.modal-header h3 {
  margin: 0;
  color: var(--primary-color);
}

.modal-close {
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: #999;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
}

.modal-close:hover {
  color: var(--error);
}

#scanner-container {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

/* Image Modal */
.image-modal-content {
  position: relative;
  background: var(--white);
  border-radius: 8px;
  padding: 1rem;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-modal-content img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  display: block;
}

.image-modal-content .modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--white);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Order Modal */
.order-modal-content {
  max-width: 500px;
  width: 90%;
}

.order-items {
  max-height: 400px;
  overflow-y: auto;
  margin-bottom: 1rem;
}

.order-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem;
  border-bottom: 1px solid var(--divider-color);
}

.order-item:last-child {
  border-bottom: none;
}

.order-item-details strong {
  display: block;
  color: var(--text-primary);
  margin-bottom: 0.15rem;
  font-size: 0.85rem;
}

.order-item-details .product-link {
  cursor: pointer;
  transition: color 0.2s;
}

.order-item-details .product-link:hover {
  color: var(--accent-color);
  text-decoration: underline;
}

.order-item-details small {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.order-item-quantity {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.order-item-quantity input {
  width: 50px;
  padding: 0.25rem;
  text-align: center;
  font-size: 0.9rem;
}

.order-item-quantity span {
  font-size: 0.85rem;
  color: var(--text-secondary);
  flex: 1;
}

.order-item-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.order-item-total strong {
  color: var(--success);
  font-size: 1rem;
}

.remove-btn {
  background: var(--error);
  color: white;
  border: none;
  padding: 0.35rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  width: auto;
}

.remove-btn:hover {
  background: #b71c1c;
}

.order-summary {
  background: var(--primary-light);
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
}

.summary-row:last-child {
  border-top: 2px solid var(--divider-color);
  padding-top: 1rem;
  margin-top: 0.5rem;
}

.summary-row strong {
  font-size: 1.1rem;
  color: var(--success);
}

@media (max-width: 600px) {
  .order-item {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .order-item-quantity,
  .order-item-total {
    text-align: left;
  }

  .order-modal-content {
    width: 95%;
    padding: 1rem;
  }
}

/* Help Modal */
.help-modal-content {
  max-width: 700px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
}

.help-content {
  line-height: 1.6;
}

.help-content h4 {
  color: var(--primary-color);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}

.help-content h4:first-child {
  margin-top: 0;
}

.help-content ul {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.help-content li {
  margin-bottom: 0.5rem;
}

.help-content ul ul {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.help-content strong {
  color: var(--primary-color);
}

/* Logs container - ensure proper scrolling */
#logs-container {
  display: block !important;
  position: relative;
  overflow-y: auto !important;
  overflow-x: auto !important;
}

/* Modal width constraints for mobile */
@media (max-width: 768px) {
  .modal-content {
    max-width: 95%;
    width: 95%;
    padding: 1rem;
  }

  #edit-user-modal .modal-content {
    max-width: 95%;
    width: 95%;
  }

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

  .form-group label {
    max-width: 100%;
    overflow: hidden;
  }
}

/* Browse Supplier Section */
.browse-supplier-section {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  background: var(--white);
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.browse-supplier-section details {
  outline: none;
}

.browse-supplier-section summary {
  outline: none;
  list-style: none;
}

.browse-supplier-section summary::-webkit-details-marker {
  display: none;
}

.browse-supplier-section summary::before {
  content: '▶';
  display: inline-block;
  margin-right: 0.5rem;
  transition: transform 0.2s;
  font-size: 0.8rem;
}

.browse-supplier-section details[open] summary::before {
  transform: rotate(90deg);
}

.browse-supplier-section summary:hover {
  color: var(--primary-color);
}

.browse-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Pagination Controls */
.pagination-controls {
  display: flex;
  flex-direction: column;
  margin-top: 1rem;
  padding: 1rem;
  background: var(--white);
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  gap: 0.75rem;
}

.pagination-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pagination-bottom-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pagination-info {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.pagination-buttons {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.pagination-buttons button {
  padding: 0.5rem 1rem;
  border: 1px solid var(--divider-color);
  background: var(--white);
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
  font-size: 0.9rem;
}

.pagination-buttons button:hover:not(:disabled) {
  background: var(--accent-color);
  border-color: var(--accent-color);
}

.pagination-buttons button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-buttons .current-page {
  padding: 0.5rem 1rem;
  font-weight: 500;
  color: var(--text-primary);
}

.page-size-selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.current-page-info {
  font-size: 0.9rem;
  color: var(--text-secondary);
  white-space: nowrap;
  font-weight: 500;
}

.page-size-selector label {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.page-size-selector select {
  padding: 0.5rem;
  border: 1px solid var(--divider-color);
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: pointer;
}

@media (max-width: 600px) {
  .filter-checkboxes {
    flex-wrap: wrap;
  }

  .browse-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .browse-controls button {
    width: 100%;
    margin-left: 0 !important;
  }

  .pagination-top-row {
    gap: 0.5rem;
  }

  .pagination-bottom-row {
    gap: 0.5rem;
  }

  .pagination-buttons {
    justify-content: flex-start;
  }

  .page-size-selector {
    justify-content: flex-end;
  }

  .page-size-selector select {
    width: auto;
    min-width: 60px;
  }

  .stat-card {
    padding: 0.75rem;
  }

  .stat-label {
    font-size: 0.8em;
  }

  .stat-value {
    font-size: 1.5em;
  }
}

/* Statistics styles */
.stat-card {
  background: white;
  padding: 1rem;
  border-radius: 5px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  text-align: center;
}

.stat-label {
  color: #666;
  font-size: 0.9em;
  margin-bottom: 0.5rem;
}

.stat-value {
  color: var(--primary-color);
  font-size: 2em;
  font-weight: bold;
}

.stats-user-row {
  cursor: pointer;
  transition: background 0.2s;
}

/* Desktop-only columns for statistics */
.stats-desktop-only {
  display: table-cell;
}

@media (max-width: 768px) {
  .stats-user-row:hover {
    background: #f9f9f9;
  }

  /* Hide desktop-only columns on mobile */
  .stats-desktop-only {
    display: none !important;
  }

  /* Make name cell take full width and show compact info */
  .stats-name-cell {
    width: 100%;
  }

  .hide-mobile {
    display: none !important;
  }

  .mobile-hint {
    display: block !important;
  }

  #statistics-users table {
    font-size: 0.9em;
  }

  #statistics-users th:first-child,
  #statistics-users td:first-child {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* Price Tags Tab Buttons */
.tab-button {
  padding: 0.7rem 1.5rem;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.tab-button:hover {
  color: var(--text-primary);
  border-bottom-color: #ddd;
}

.tab-button.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent-color);
  font-weight: 700;
}

/* ============================================
   BARCODE REPORTS STYLES
   ============================================ */

.barcode-filters-container {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: #f5f5f5;
    border-radius: 4px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    align-items: start;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.filter-input {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    width: 100%;
    background: white;
}

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

.barcode-report-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.barcode-report-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: var(--accent-color);
}

.barcode-report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f0f0f0;
}

.barcode-report-body {
    font-size: 0.9rem;
    line-height: 1.6;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-left: 0.5rem;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-assigned {
    background: #d1ecf1;
    color: #0c5460;
}

.status-completed {
    background: #d4edda;
    color: #155724;
}

.status-rejected {
    background: #f8d7da;
    color: #721c24;
}

/* Image Reports Styling */
.image-report-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.image-report-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: var(--accent-color);
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f0f0f0;
}

.report-icon {
    font-size: 1.2rem;
    margin-right: 0.5rem;
}

.report-type {
    font-weight: 500;
}

.report-info {
    font-size: 0.9rem;
    line-height: 1.6;
}

.image-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.product-search-result {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.2s ease;
}

.product-search-result:hover {
    background: #f5f5f5;
}

.product-search-result:last-child {
    border-bottom: none;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
}

.modal-content {
    background: white;
    border-radius: 8px;
    max-width: 600px;
    width: 100%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #ddd;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.primary-button {
    background: var(--accent-color);
    color: var(--primary-dark);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.primary-button:hover {
    background: var(--accent-hover);
}

.primary-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Diagnostics */
.diagnostics-container {
    max-width: 1400px;
    margin: 0 auto;
}

.diagnostics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.diagnostics-header h2 {
    font-size: 1.75rem;
    margin: 0;
}

.diagnostics-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.diagnostics-timestamp {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.diagnostics-overall {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.diagnostics-status {
    font-size: 1.25rem;
    padding: 1rem;
    border-radius: 8px;
}

.diagnostics-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.diagnostics-card h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

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

.metric {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.metric.full-width {
    grid-column: 1 / -1;
}

.metric-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.metric-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.metric-box {
    background: var(--background);
    padding: 1rem;
    border-radius: 6px;
}

.metric-box h4 {
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.diagnostics-details {
    margin-top: 1.5rem;
    border-top: 1px solid var(--divider-color);
    padding-top: 1rem;
}

.diagnostics-details summary {
    cursor: pointer;
    font-weight: 600;
    margin-bottom: 1rem;
    user-select: none;
}

.diagnostics-details summary:hover {
    color: var(--accent-hover);
}

.diagnostics-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
}

.diagnostics-table th {
    background: var(--background);
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--divider-color);
}

.diagnostics-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--divider-color);
}

.diagnostics-table tr:last-child td {
    border-bottom: none;
}

.diagnostics-table tr:hover {
    background: var(--background);
}

.progress-bar {
    position: relative;
    height: 30px;
    background: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-fill.healthy {
    background: linear-gradient(90deg, #4caf50, #66bb6a);
}

.progress-fill.warning {
    background: linear-gradient(90deg, #ff9800, #ffb74d);
}

.progress-fill.critical {
    background: linear-gradient(90deg, #f44336, #e57373);
}

.progress-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 600;
    color: var(--text-primary);
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.status-healthy {
    color: var(--success);
}

.status-warning {
    color: #f57c00;
}

.status-critical {
    color: var(--error);
}

.warning-message {
    background: #fff3cd;
    border-left: 4px solid #ff9800;
    padding: 1rem;
    margin-top: 1rem;
    border-radius: 4px;
}

.error-message {
    background: #f8d7da;
    border-left: 4px solid var(--error);
    padding: 1rem;
    margin-top: 1rem;
    border-radius: 4px;
}

.info-message {
    background: #d1ecf1;
    border-left: 4px solid #17a2b8;
    padding: 1rem;
    margin-top: 1rem;
    border-radius: 4px;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .barcode-report-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .modal-content {
        margin: 0.5rem;
        max-height: calc(100vh - 1rem);
    }

    .diagnostics-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .diagnostics-actions {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }

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

    .diagnostics-table {
        font-size: 0.9rem;
    }

    .diagnostics-table th,
    .diagnostics-table td {
        padding: 0.5rem;
    }
}

/* ============================================================================
   IMPERSONATION STYLES
   ============================================================================ */

/* Impersonation Banner */
.impersonation-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background: linear-gradient(90deg, #673ab7 0%, #9c27b0 100%);
    color: white;
    padding: 0.5rem 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

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

.impersonation-exit-btn {
    background: white;
    color: #673ab7;
    border: none;
    padding: 0.4rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
    font-size: 0.9rem;
}

.impersonation-exit-btn:hover {
    background: #f5f5f5;
}

/* When impersonation banner is visible, push content down */
body.impersonating #app-screen header {
    margin-top: 50px;
}

body.impersonating .impersonation-banner {
    display: block;
}

/* Impersonation User List */
.impersonation-user-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.2s;
}

.impersonation-user-item:hover {
    background: #f5f5f5;
}

.impersonation-user-item:last-child {
    border-bottom: none;
}

.impersonation-user-email {
    font-weight: 500;
    color: #333;
}

.impersonation-user-details {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.25rem;
}

/* Impersonation button in users list */
.impersonate-btn {
    background: #673ab7;
    color: white;
    border: none;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.impersonate-btn:hover {
    background: #5e35b1;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .impersonation-banner {
        padding: 0.4rem 0.5rem;
    }

    .impersonation-banner-content {
        font-size: 0.85rem;
        gap: 0.5rem;
    }

    .impersonation-exit-btn {
        padding: 0.3rem 0.75rem;
        font-size: 0.8rem;
    }

    body.impersonating #app-screen header {
        margin-top: 45px;
    }
}

/* ============================================
   HOME SCREEN - Quick Access Tiles
   ============================================ */
.home-greeting {
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    padding: 0 0.25rem;
}

.home-group-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    padding: 0 0.25rem;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 0.4rem;
}

.home-tiles-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.home-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--white);
    border: 2px solid var(--divider-color);
    border-radius: 12px;
    padding: 1.5rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    min-height: 120px;
    -webkit-tap-highlight-color: transparent;
}

.home-tile:hover {
    border-color: var(--accent-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.home-tile:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background: var(--primary-light);
}

.home-tile-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    line-height: 1;
}

.home-tile-label {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    text-align: center;
    line-height: 1.3;
}

@media (min-width: 768px) {
    .home-tiles-grid {
        grid-template-columns: repeat(3, 1fr);
        max-width: 700px;
    }

    .home-tile {
        min-height: 140px;
        padding: 2rem 1.5rem;
    }

    .home-tile-icon {
        font-size: 3rem;
    }

    .home-tile-label {
        font-size: 1.1rem;
    }
}

/* ============================================
   FILTER BUTTONS (invoices, etc.)
   ============================================ */
.filter-btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    background: #333;
    color: #aaa;
    border: 1px solid #555;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    background: #444;
    color: white;
}

.filter-btn.active {
    background: var(--accent-color);
    color: #000;
    border-color: var(--accent-color);
    font-weight: 600;
}
