body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: #f9fbff;
  color: #222;
  margin: 0;
  padding: 0;
}

.header {
  background: #0d6efd;
  color: #fff;
  text-align: center;
  padding: 1.5rem;
}

.header input {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  width: 90%;
  max-width: 400px;
  border: none;
  border-radius: 0.5rem;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(500px, 1fr));
  gap: 1rem;
  padding: 2rem;
}

.card {
  background: #fff;
  border-radius: 0.75rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  padding: 1.25rem;
  transition: transform 0.2s ease;
}

.card:hover {
  transform: scale(1.02);
}

.footer {
  text-align: center;
  padding: 1rem;
  background: #eee;
  font-size: 0.9rem;
}
.breakdown-table {
  width: 100% !important;         /* table occupies full width */
  max-width: 100% !important;     /* remove the 1200px limit */
  border-collapse: collapse;
  table-layout: auto !important;  /* let browser adjust column widths */
  margin-top: 0.5rem;
  font-size: 0.95rem;
}

.breakdown-table th,
.breakdown-table td {
  border: 1px solid #ddd;
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
  white-space: nowrap; /* prevent wrapping */
}

.breakdown-table th[data-key="customer"],
.breakdown-table td:nth-child(1) {
  min-width: 280px !important; /* wider column */
  max-width: 450px !important;
  font-size: 0.90rem;
}

.breakdown-table th[data-key="month"],
.breakdown-table td:nth-child(2) {
  width: 120px;
}

.breakdown-table th[data-key="totalQty"],
.breakdown-table td:nth-child(3),
.breakdown-table th[data-key="avgPrice"],
.breakdown-table td:nth-child(4),
.breakdown-table th[data-key="avgCost"],
.breakdown-table td:nth-child(5) {
  width: 100px;
  text-align: left;
}

.breakdown-table th {
  background-color: #f7f7f7;
  cursor: pointer;
}

.breakdown-table th:hover {
  background-color: #f0f0f0;
}

.breakdown-table tr:nth-child(even) {
  background-color: #fafafa;
}

.breakdown-table th.sorted {
  background-color: #eef5ff;
  color: #0056b3;
}
.breakdown-table td:nth-child(3),
.breakdown-table th[data-key="description"] {
  max-width: 550px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.95rem;
}

.breakdown-table td:nth-child(3):hover::after {
  content: attr(data-full);
  position: absolute;
  background: #fff;
  border: 1px solid #ccc;
  padding: 4px 8px;
  white-space: normal;
  z-index: 100;
  width: max-content;
  max-width: 400px;
}
.filters-container {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 8px;
}

.filters-container label {
  display: flex;
  flex-direction: column;
  font-size: 14px;
}

.filters-container input,
.filters-container select {
  padding: 6px 8px;
  border-radius: 4px;
  border: 1px solid #ccc;
  font-size: 14px;
  min-width: 120px;
}

/* --- Products Table (SKU × Type) --- */
/* --- Make Products Table Scrollable --- */
.results-grid {
  overflow-x: auto;       /* horizontal scroll if table too wide */
  padding: 1rem 2rem;
}

.products-table {
  min-width: 900px;       /* ensures table doesn't shrink too much */
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.80rem;     /* slightly smaller font */
}

.products-table th,
.products-table td {
  border: 1px solid #ddd;
  padding: 2px 4px;
  white-space: nowrap;    /* prevent wrapping */
  vertical-align: middle;
  text-align: left;
}

.products-table th {
  background-color: #f7f7f7;
  cursor: pointer;
}

.products-table th:hover {
  background-color: #f0f0f0;
}

.products-table tr:nth-child(even) {
  background-color: #fafafa;
}

/* --- Force Description column narrower --- */
.products-table td:nth-child(1),
.products-table th:nth-child(1) {
  max-width: 100px;      /* adjust as needed */
  width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;   /* prevent wrapping */
}

/* --- On hover, show full description --- */
.products-table td:nth-child(1):hover {
  white-space: normal;       /* allow wrapping on hover */
  background: #fffdf0;       /* subtle highlight */
  position: relative;
  z-index: 10;
}

/* --- Force Description column narrower --- */
.products-table td:nth-child(2),
.products-table th:nth-child(2) {
  max-width: 140px;      /* adjust as needed */
  width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;   /* prevent wrapping */
}

/* --- On hover, show full description --- */
.products-table td:nth-child(2):hover {
  white-space: normal;       /* allow wrapping on hover */
  background: #fffdf0;       /* subtle highlight */
  position: relative;
  z-index: 10;
}

/* --- Force Description column narrower --- */
.products-table td:nth-child(3),
.products-table th:nth-child(3) {
  max-width: 60px !important;      /* adjust as needed */
  width: 60px !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;   /* prevent wrapping */
}

/* --- Force Description column narrower --- */
/* --- Force columns 4, 5, and 6 narrower --- */
.products-table td:nth-child(4),
.products-table th:nth-child(4),
.products-table td:nth-child(5),
.products-table th:nth-child(5),
.products-table td:nth-child(6),
.products-table th:nth-child(6),
.products-table td:nth-child(7),
.products-table th:nth-child(7),
.products-table td:nth-child(8),
.products-table th:nth-child(8),
.products-table td:nth-child(9),
.products-table th:nth-child(9),
.products-table td:nth-child(10),
.products-table th:nth-child(10),
.products-table td:nth-child(11),
.products-table th:nth-child(11),
.products-table td:nth-child(12),
.products-table th:nth-child(12),
.products-table td:nth-child(13),
.products-table th:nth-child(13),
.products-table td:nth-child(14),
.products-table th:nth-child(14),
.products-table td:nth-child(15),
.products-table th:nth-child(15) {
  max-width: 100px;      /* adjust as needed */
  width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;   /* prevent wrapping */
}

.footer-notes {
  margin-top: 25px;
  border-top: 1px solid #aaa;
  padding-top: 10px;
  font-size: 0.9rem;
  display: block;
  min-height: 60px;
}
