/* Minimal dark UI styling */

body {
  font-family: system-ui, sans-serif;
  background-color: #111;
  color: #eee;
  margin: 0;
  padding: 16px;
}

h1 {
  color: rgb(255, 166, 0);
  font-size: 1rem;
  text-align: center;
  margin-bottom: 20px;
}

/* Navigation */
.navigation {
  margin-bottom: 20px;
  text-align: center;
}

.nav-link {
  display: inline-block;
  background: #333;
  color: #ffa500;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 4px;
  border: 1px solid #444;
  transition: background-color 0.2s;
}

.nav-link:hover {
  background: #444;
}

/* Helper tables layout */
.helper-tables {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

.helper-table {
  width: 100%;
  border-collapse: collapse;
  background: #222;
  font-size: 0.8rem;
}

.helper-table th, 
.helper-table td {
  border: 1px solid #333;
  padding: 6px 8px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.helper-table th {
  background: #333;
  color: #ffa500;
}

.helper-table tr:nth-child(even) {
  background: #181818;
}

/* Main data table */
#sales-table-container {
  width: 100%;
  overflow-x: auto;
  margin-top: 20px;
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

#sales-table {
  width: 100%;
  border-collapse: collapse;
  background: #222;
  font-size: 0.75rem; /* Slightly smaller font for mobile */
  min-width: 600px; /* Reduced minimum width for better mobile experience */
}

#sales-table th, 
#sales-table td {
  border: 1px solid #333;
  padding: 6px 8px; /* Reduced padding for more compact look */
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px; /* Limit cell width */
}

#sales-table th {
  background: #333;
  color: #ffa500;
  position: sticky;
  left: 0; /* Keep headers visible when scrolling */
  z-index: 1;
}

#sales-table th:first-child,
#sales-table td:first-child {
  position: sticky;
  left: 0;
  background: #222;
  z-index: 2;
}

#sales-table tr:nth-child(even) {
  background: #181818;
}

/* Make first column more visible on mobile */
#sales-table th:first-child,
#sales-table td:first-child {
  box-shadow: 1px 0 0 #333;
}

/* Responsive table improvements */
@media (max-width: 767px) {
  #sales-table {
    font-size: 0.7rem; /* Even smaller font on very small screens */
    min-width: 500px;
  }
  
  #sales-table th, 
  #sales-table td {
    padding: 4px 6px;
    max-width: 100px;
  }
  
  /* Hide less important columns on very small screens */
  #sales-table th:nth-child(n+9),
  #sales-table td:nth-child(n+9) {
    display: none;
  }
  
  .helper-table {
    font-size: 0.7rem;
  }
  
  .helper-table th, 
  .helper-table td {
    padding: 4px 6px;
  }
}

/* Responsive design */
@media (min-width: 768px) {
  .helper-tables {
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  .helper-table {
    flex: 1;
    min-width: 200px;
  }
  
  body {
    padding: 20px;
  }
  
  h1 {
    font-size: 2rem;
    text-align: left;
  }
}

input, select, button {
  background: #222;
  color: #eee;
  border: 1px solid #444;
  padding: 6px 10px;
  margin: 5px 0;
  border-radius: 4px;
}

button {
  cursor: pointer;
  background: #0ff;
  color: #000;
  font-weight: bold;
}

button:hover {
  background: #0cc;
}
