/* Instructor Report Specific Styles */
table.data.instructor-report-table {
  width: 100%;
  min-width: 1200px;
  table-layout: fixed !important;
  border-collapse: collapse;
  margin: 0;  /* Override stats.css centering */
}

/* Base cell styles */
table.data.instructor-report-table th,
table.data.instructor-report-table td {
  padding: var(--spacing-xs) var(--spacing-sm);
  white-space: normal;
  vertical-align: middle;
  font-size: var(--text-sm);
  box-sizing: border-box;
  height: 100%;
}

/* Instructor Column */
table.data.instructor-report-table th:first-child,
table.data.instructor-report-table td:first-child {
  width: 6% !important;
}

/* Lessons Taught Columns (2-3) */
table.data.instructor-report-table th:nth-child(2) {
  width: 4% !important;
}
table.data.instructor-report-table th:nth-child(3) {
  width: 4% !important;
}

/* Opportunities Columns (4-7) */
table.data.instructor-report-table th:nth-child(4) {
  width: 3% !important;
}
table.data.instructor-report-table th:nth-child(5) {
  width: 3% !important;
}
table.data.instructor-report-table th:nth-child(6) {
  width: 3% !important;
}
table.data.instructor-report-table th:nth-child(7) {
  width: 3% !important;
}

/* Sales Columns (8-19) */
/* ORG */
table.data.instructor-report-table th:nth-child(8) {
  width: 5.5% !important;
}
table.data.instructor-report-table th:nth-child(9) {
  width: 5.5% !important;
}
/* PRE */
table.data.instructor-report-table th:nth-child(10) {
  width: 5.5% !important;
}
table.data.instructor-report-table th:nth-child(11) {
  width: 5.5% !important;
}
/* EXT */
table.data.instructor-report-table th:nth-child(12) {
  width: 5.5% !important;
}
table.data.instructor-report-table th:nth-child(13) {
  width: 5.5% !important;
}
/* REX */
table.data.instructor-report-table th:nth-child(14) {
  width: 5.5% !important;
}
table.data.instructor-report-table th:nth-child(15) {
  width: 5.5% !important;
}
/* REN */
table.data.instructor-report-table th:nth-child(16) {
  width: 5.5% !important;
}
table.data.instructor-report-table th:nth-child(17) {
  width: 5.5% !important;
}
/* MISC */
table.data.instructor-report-table th:nth-child(18) {
  width: 5.5% !important;
}
table.data.instructor-report-table th:nth-child(19) {
  width: 5.5% !important;
}

/* Totals Columns (20-21) - Dynamic sizing based on footer content */
table.data.instructor-report-table {
  width: auto; /* Allow table to size based on content */
}

/* Remove fixed width from the last two columns */
table.data.instructor-report-table th:nth-child(20),
table.data.instructor-report-table th:nth-child(21) {
  width: auto !important;
  min-width: calc(var(--text-base) * 8) !important; /* Minimum width to prevent too narrow columns */
  white-space: nowrap !important;
}

/* Make sure the cells in these columns don't wrap */
table.data.instructor-report-table td:nth-child(20),
table.data.instructor-report-table td:nth-child(21),
table.data.instructor-report-table tfoot th:nth-child(20),
table.data.instructor-report-table tfoot th:nth-child(21) {
  white-space: nowrap !important;
  width: auto !important;
}

/* Ensure content in these columns is right-aligned */
table.data.instructor-report-table td:nth-child(20),
table.data.instructor-report-table td:nth-child(21),
table.data.instructor-report-table tfoot th:nth-child(20),
table.data.instructor-report-table tfoot th:nth-child(21) {
  text-align: right !important;
  padding-left: var(--spacing-md) !important;
  padding-right: var(--spacing-md) !important;
}

/* Ensure TD widths match TH widths */
table.data.instructor-report-table td {
  width: inherit;
}

/* Monetary values alignment */
table.data.instructor-report-table td[data-type="money"],
table.data.instructor-report-table td:nth-child(n+8):nth-child(-n+21) {
  text-align: right;
  white-space: nowrap;
}

/* P/G rows styling */
table.data.instructor-report-table tr:nth-child(even) td {
  font-size: var(--text-xs);
  padding-bottom: var(--spacing-xs);
}

/* Header actions */
table.data.instructor-report-table th.header-actions {
  padding: var(--spacing-sm) var(--spacing-md);
  white-space: nowrap;
}

/* Progressive font scaling for narrower viewports */
@media screen and (max-width: 1500px) /* --breakpoint-xl */ {
  table.data.instructor-report-table,
  table.data.instructor-report-table tfoot tr td,
  table.data.instructor-report-table tfoot tr th,
  table.data.instructor-report-table td div {
    font-size: var(--text-xs);
  }

  table.data.instructor-report-table tr:nth-child(even) td,
  table.data.instructor-report-table tr:nth-child(even) td div,
  table.data.instructor-report-table tfoot tr:nth-child(even) td {
    font-size: calc(var(--text-xs) * 0.9);
  }
}

@media screen and (max-width: 1200px) /* --breakpoint-lg */ {
  table.data.instructor-report-table,
  table.data.instructor-report-table tfoot tr td,
  table.data.instructor-report-table tfoot tr th,
  table.data.instructor-report-table td div {
    font-size: calc(var(--text-xs) * 0.8);
  }

  table.data.instructor-report-table tr:nth-child(even) td,
  table.data.instructor-report-table tr:nth-child(even) td div,
  table.data.instructor-report-table tfoot tr:nth-child(even) td {
    font-size: calc(var(--text-xs) * 0.7);
  }

  table.data.instructor-report-table th,
  table.data.instructor-report-table td,
  table.data.instructor-report-table tfoot tr th,
  table.data.instructor-report-table tfoot tr td {
    padding: var(--spacing-xxs) var(--spacing-xs);
  }

  #content:has(.instructor-report-table) {
    overflow-x: auto;
  }
}

/* Print styles */
@media print {
  table.data.instructor-report-table {
    font-size: var(--text-xs);
    width: 100%;
    min-width: 100%;
  }

  table.data.instructor-report-table th,
  table.data.instructor-report-table td {
    padding: var(--spacing-xxs) var(--spacing-xs);
    vertical-align: middle;
  }
}

#id_date {
  width: var(--input-width-md);
}

/* Instructor Inventory toolbar */
.header-actions .toolbar {
  display: flex;
  align-items: center;
  gap: var(--spacing-base);
  flex-wrap: wrap;
}

.header-actions .toolbar label {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.header-actions .toolbar .print-button {
  margin-left: auto;
}

.header-actions .inventory-summary {
  text-align: center;
  background-color: var(--color-disabled);
  font-size: var(--text-base);
}

/* Inventory status colors */
.days-warning {
  color: orange;
}

.days-danger {
  color: red;
}

.balance-danger {
  color: red;
  font-weight: var(--font-bold);
}

.inventory-note {
  font-size: var(--text-sm);
  color: var(--color-disabled-text);
}