/* Materials Inventory V2 */
#ttMaterialsInventory {
  --inv-primary: var(--tt-primary-color, #0f4f7f);
  --inv-accent: var(--tt-accent-color, #078d8d);
  color: #162033;
  font-family: inherit;
}

.tt-drive-hidden-advanced { display: none !important; }

.tt-inv-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 18px;
  min-height: 0;
  padding: 0;
  color: #162033;
  background: transparent;
}

.tt-inv-page-head h1 {
  margin: 0;
  color: #102a43;
  font-size: clamp(1.65rem, 2.2vw, 2.2rem);
  line-height: 1.05;
}

.tt-inv-page-head p {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 0;
  color: #64748b;
  font-size: .84rem;
  font-weight: 700;
}

.tt-inv-shared-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16a36a;
  box-shadow: 0 0 0 4px #dcf8eb;
}

.tt-inv-head-actions,
.tt-inv-dialog-foot,
.tt-inv-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tt-inv-btn,
.tt-inv-icon-text-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid #d6e0ea;
  border-radius: 10px;
  background: #fff;
  color: #263b52;
  font: inherit;
  font-size: .86rem;
  font-weight: 850;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.tt-inv-btn svg,
.tt-inv-icon-text-btn svg,
.tt-inv-page-head svg,
.tt-inv-library-foot svg {
  width: 18px;
  height: 18px;
}

.tt-inv-btn:hover,
.tt-inv-icon-text-btn:hover { background: #f6f9fc; border-color: #b9cad9; }
.tt-inv-btn.primary { border-color: var(--inv-primary); background: var(--inv-primary); color: #fff; }
.tt-inv-btn.primary:hover { filter: brightness(.94); }
.tt-inv-btn.secondary { background: #fff; }
.tt-inv-btn.danger { border-color: #f0c6c9; background: #fff4f4; color: #b6323d; }
.tt-inv-btn.danger:hover { border-color: #e79aa0; background: #ffe9ea; }
.tt-inv-foot-spacer { flex: 1 1 auto; }

.tt-inv-header-advanced { position: relative; }
.tt-inv-header-advanced > summary { list-style: none; }
.tt-inv-header-advanced > summary::-webkit-details-marker { display: none; }
.tt-inv-header-advanced > div {
  display: grid;
  gap: 7px;
  width: max-content;
  min-width: 210px;
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  z-index: 30;
  padding: 9px;
  border: 1px solid #cfdae4;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(16, 42, 67, .18);
}
.tt-inv-header-advanced > div .tt-inv-btn { width: 100%; justify-content: flex-start; }

.tt-inv-overview {
  margin-bottom: 12px;
  overflow: hidden;
  border: 1px solid #dce5ed;
  border-radius: 12px;
  background: #fff;
}
.tt-inv-overview > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 7px 14px;
  color: #31475c;
  background: #f9fbfd;
  font-size: .8rem;
  cursor: pointer;
}
.tt-inv-overview > summary > svg { width: 17px; height: 17px; color: var(--inv-primary); }
.tt-inv-overview > summary > span { margin-left: auto; color: #718195; font-size: .7rem; font-weight: 800; }
.tt-inv-overview[open] > summary { border-bottom: 1px solid #e7edf3; }
.tt-inv-overview .tt-inv-stats { margin: 0; padding: 12px; }

.tt-inv-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.tt-inv-stats > div,
.tt-inv-stats > button {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid #dce5ed;
  border-radius: 12px;
  background: #fff;
  text-align: left;
  color: inherit;
}

.tt-inv-stats > button { font: inherit; cursor: pointer; }
.tt-inv-stats > button:hover { border-color: #e3aa43; background: #fffaf0; }
.tt-inv-stats > button.attention { border-color: #f3d492; background: #fffbef; }
.tt-inv-stats > * > span {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #edf5fb;
  color: #27658f;
}
.tt-inv-stats > * > span.digital { background: #e8f8f7; color: #078d8d; }
.tt-inv-stats > button > span { background: #fff0d5; color: #b96d00; }
.tt-inv-stats svg { width: 21px; height: 21px; }
.tt-inv-stats p { min-width: 0; margin: 0; }
.tt-inv-stats strong { display: block; color: #17253a; font-size: 1.2rem; line-height: 1.1; }
.tt-inv-stats small { display: block; margin-top: 3px; color: #738196; font-size: .72rem; font-weight: 750; white-space: nowrap; }

.tt-inv-library {
  overflow: hidden;
  border: 1px solid #dbe5ee;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 25px rgba(38, 59, 82, .055);
}

.tt-inv-main-toolbar {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr);
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border-bottom: 1px solid #e6edf3;
}

.tt-inv-tabs {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border-radius: 10px;
  background: #edf2f6;
}
.tt-inv-tabs button {
  min-height: 34px;
  padding: 6px 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #516174;
  font: inherit;
  font-size: .8rem;
  font-weight: 850;
  cursor: pointer;
}
.tt-inv-tabs button span { margin-left: 4px; color: #8795a7; font-size: .67rem; }
.tt-inv-tabs button.active { background: #fff; color: var(--inv-primary); box-shadow: 0 1px 4px rgba(15, 42, 67, .14); }

.tt-inv-search {
  position: relative;
  display: flex;
  align-items: center;
  justify-self: end;
  width: min(100%, 390px);
}
.tt-inv-search svg { position: absolute; left: 12px; width: 18px; height: 18px; color: #7b8ca0; pointer-events: none; }
.tt-inv-search input {
  width: 100%;
  height: 40px;
  padding: 8px 12px 8px 39px;
  border: 1px solid #d5e0ea;
  border-radius: 10px;
  background: #f9fbfd;
  color: #1e2e43;
  font: inherit;
  font-size: .84rem;
  font-weight: 650;
}
.tt-inv-search input:focus { outline: 3px solid color-mix(in srgb, var(--inv-accent) 16%, transparent); border-color: var(--inv-accent); background: #fff; }

.tt-inv-icon-text-btn { min-height: 40px; padding: 7px 11px; }

.tt-inv-filters { border-bottom: 1px solid #e9eff4; background: #fafcfe; }
.tt-inv-filters summary { display: inline-flex; align-items: center; gap: 7px; width: fit-content; margin: 0 15px; padding: 10px 0; color: #52657a; font-size: .77rem; font-weight: 850; cursor: pointer; }
.tt-inv-filters summary svg { width: 15px; height: 15px; }
.tt-inv-filters > div { display: flex; align-items: end; gap: 10px; padding: 0 15px 13px; }
.tt-inv-filters label { min-width: 185px; color: #617287; font-size: .7rem; font-weight: 850; }
.tt-inv-filters select { display: block; width: 100%; height: 37px; margin-top: 5px; padding: 7px 30px 7px 9px; border: 1px solid #d5e0ea; border-radius: 8px; background: #fff; color: #263b52; font: inherit; font-size: .8rem; font-weight: 750; }
.tt-inv-filters button { height: 37px; padding: 7px 10px; border: 0; background: transparent; color: var(--inv-primary); font: inherit; font-size: .76rem; font-weight: 850; cursor: pointer; }
.tt-inv-filters .tt-inv-compact-btn { min-height: 37px; border: 1px solid #d6e0ea; }

.tt-inv-collection-section { border-bottom: 1px solid #e7edf3; background: #fff; }
.tt-inv-collection-section > summary {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 7px 15px;
  color: #31475c;
  background: #f9fbfd;
  cursor: pointer;
}
.tt-inv-collection-section > summary > div { display: inline-flex; align-items: center; gap: 7px; }
.tt-inv-collection-section > summary svg { width: 17px; height: 17px; color: var(--inv-primary); }
.tt-inv-collection-section > summary strong { font-size: .78rem; }
.tt-inv-collection-section > summary span { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; color: #66778a; background: #edf2f6; font-size: .64rem; font-weight: 900; }
.tt-inv-collection-section[open] > summary { border-bottom: 1px solid #eef2f5; }
.tt-inv-collection-body { padding: 10px 15px 0; }
.tt-inv-collection-actions { display: flex; justify-content: flex-end; }
.tt-inv-compact-btn { min-height: 34px; padding: 6px 10px; font-size: .74rem; }
.tt-inv-no-collections { margin: 0; padding: 10px 0 14px; color: #7b8999; font-size: .72rem; font-weight: 700; }

.tt-inv-collections {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 10px 0;
  scrollbar-width: thin;
}
.tt-inv-collections > button,
.tt-inv-collection {
  flex: 0 0 auto;
  border: 1px solid #d7e2eb;
  border-radius: 9px;
  background: #fff;
}
.tt-inv-collections > button,
.tt-inv-collection > button:first-child {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 6px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #43556b;
  font: inherit;
  font-size: .77rem;
  font-weight: 800;
  cursor: pointer;
}
.tt-inv-collection { display: flex; align-items: center; }
.tt-inv-collections > button.active,
.tt-inv-collection.active { border-color: #8cc7c7; background: #effafa; color: #087d7d; }
.tt-inv-collection svg { width: 16px; height: 16px; color: #5b7c9a; }
.tt-inv-collection small { padding: 2px 6px; border-radius: 999px; background: #eef3f6; color: #6b7a8c; font-size: .64rem; }
.tt-inv-collection-menu { display: grid; place-items: center; width: 30px; height: 30px; margin-right: 3px; border: 0; border-radius: 7px; background: transparent; color: #617287; cursor: pointer; }
.tt-inv-collection-menu:hover { background: #e6f1f5; }

.tt-inv-table-wrap { min-height: 250px; overflow-x: auto; }
.tt-inv-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.tt-inv-table th {
  padding: 9px 14px;
  border-bottom: 1px solid #dfe8ef;
  background: #f7f9fb;
  color: #6b7a8c;
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .035em;
  text-align: left;
  text-transform: uppercase;
}
.tt-inv-table th:nth-child(1) { width: 34%; }
.tt-inv-table th:nth-child(2) { width: 17%; }
.tt-inv-table th:nth-child(3) { width: 25%; }
.tt-inv-table th:nth-child(4) { width: 11%; }
.tt-inv-table th:nth-child(5) { width: 13%; }
.tt-inv-table td { padding: 12px 14px; border-bottom: 1px solid #e9eef3; color: #33465b; font-size: .8rem; vertical-align: middle; }
.tt-inv-table tbody tr:hover { background: #fbfdff; }
.tt-inv-table tbody tr:last-child td { border-bottom: 0; }
.tt-inv-table td > strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-inv-item-name { display: flex; align-items: center; gap: 11px; min-width: 0; }
.tt-inv-item-name > div { min-width: 0; }
.tt-inv-item-name strong { display: block; overflow: hidden; color: #192a40; font-size: .86rem; text-overflow: ellipsis; white-space: nowrap; }
.tt-inv-item-name small,
.tt-inv-provider small,
.tt-inv-stock small,
.tt-inv-row-note { display: block; margin-top: 3px; color: #7c8b9d; font-size: .69rem; font-weight: 700; }
.tt-inv-type-icon { display: grid; place-items: center; flex: 0 0 38px; width: 38px; height: 38px; border-radius: 10px; background: #edf5fb; color: #27658f; }
.tt-inv-type-icon.digital { background: #e8f8f7; color: #078d8d; }
.tt-inv-type-icon.novel { background: #f3ecff; color: #7452a6; }
.tt-inv-type-icon.workbook { background: #eaf3ff; color: #376fa8; }
.tt-inv-type-icon.worksheet,
.tt-inv-type-icon.handout { background: #fff4df; color: #a96813; }
.tt-inv-type-icon.quiz { background: #ffeceb; color: #b64a4a; }
.tt-inv-type-icon.teacher-guide,
.tt-inv-type-icon.reference { background: #edf0ff; color: #4d60a8; }
.tt-inv-type-icon.flashcards,
.tt-inv-type-icon.teaching-aid,
.tt-inv-type-icon.game { background: #e9f8ef; color: #2c8051; }
.tt-inv-type-icon.art-supplies { background: #fff0f6; color: #ad4f78; }
.tt-inv-type-icon.audio-video,
.tt-inv-type-icon.equipment { background: #ebf6f7; color: #35777c; }
.tt-inv-type-icon svg { width: 19px; height: 19px; }
.tt-inv-stock strong { display: block; color: #22354b; font-size: .86rem; }
.tt-inv-stock strong span { color: #7b8a9d; font-size: .71rem; }
.tt-inv-stock small.good { color: #188456; }
.tt-inv-stock small.low { color: #ad6800; }
.tt-inv-stock small.out { color: #c33d46; }
.tt-inv-provider strong { color: #22354b; font-size: .82rem; }
.tt-inv-row-note { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-inv-access { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 999px; font-size: .68rem; font-weight: 850; white-space: nowrap; }
.tt-inv-access.shared { background: #e8f8ef; color: #18754e; }
.tt-inv-access.locked { background: #eef1f5; color: #536174; }
.tt-inv-access svg { width: 13px; height: 13px; }
.tt-inv-access-help { display: inline-grid; place-items: center; width: 16px; height: 16px; margin-left: 3px; border: 1px solid #aab8c6; border-radius: 50%; color: #617286; background: #fff; font-size: .61rem; font-weight: 950; cursor: help; vertical-align: middle; text-transform: none; }
.tt-inv-row-actions { justify-content: flex-end; }
.tt-inv-icon-btn { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #546a80; cursor: pointer; }
.tt-inv-icon-btn:hover:not(:disabled) { border-color: #d7e1e9; background: #f1f6f9; color: var(--inv-primary); }
.tt-inv-icon-btn.danger:hover:not(:disabled) { border-color: #f5c4c7; background: #fff1f1; color: #c53c46; }
.tt-inv-icon-btn:disabled { opacity: .28; cursor: not-allowed; }
.tt-inv-icon-btn svg { width: 17px; height: 17px; }

.tt-inv-empty { display: grid; place-items: center; min-height: 320px; padding: 40px 20px; text-align: center; }
.tt-inv-empty > span { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 16px; background: #edf5f8; color: #377092; }
.tt-inv-empty > span svg { width: 28px; height: 28px; }
.tt-inv-empty h2 { margin: 15px 0 6px; color: #1b2d43; font-size: 1.05rem; }
.tt-inv-empty p { max-width: 470px; margin: 0 0 17px; color: #718096; font-size: .82rem; font-weight: 650; }
.tt-inv-empty > div { display: flex; gap: 8px; }
.tt-inv-library-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 45px; padding: 8px 15px; border-top: 1px solid #e7edf3; background: #fafcfd; color: #78879a; font-size: .72rem; font-weight: 750; }
.tt-inv-library-foot button { display: inline-flex; align-items: center; gap: 6px; padding: 5px; border: 0; background: transparent; color: var(--inv-primary); font: inherit; font-size: .72rem; font-weight: 850; cursor: pointer; }

.tt-inv-modal {
  position: fixed;
  inset: 0;
  z-index: 1000002;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow-y: auto;
  background: rgba(15, 30, 48, .62);
  backdrop-filter: blur(5px);
}
.tt-inv-dialog { width: min(760px, 100%); max-height: calc(100vh - 48px); overflow-y: auto; border-radius: 16px; background: #fff; box-shadow: 0 28px 80px rgba(10, 26, 43, .33); }
.tt-inv-dialog-small { width: min(520px, 100%); }
.tt-inv-dialog-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 20px 22px 17px; border-bottom: 1px solid #e2e9ef; background: #fff; }
.tt-inv-dialog-head small { display: block; margin-bottom: 4px; color: var(--inv-accent); font-size: .66rem; font-weight: 950; letter-spacing: .11em; text-transform: uppercase; }
.tt-inv-dialog-head h2 { margin: 0; color: #17263a; font-size: 1.25rem; }
.tt-inv-dialog-head p { margin: 5px 0 0; color: #718096; font-size: .78rem; font-weight: 650; }
.tt-inv-close { display: grid; place-items: center; flex: 0 0 40px; width: 40px; height: 40px; padding: 0; border: 1px solid #d6e0e8; border-radius: 50%; background: #fff; color: #31485f; cursor: pointer; }
.tt-inv-close:hover { background: #f3f7fa; }
.tt-inv-close svg { width: 20px; height: 20px; }
.tt-inv-form { padding: 20px 22px 0; }
.tt-inv-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.tt-inv-form label > span,
.tt-inv-form-grid label > span { display: block; margin-bottom: 6px; color: #43556a; font-size: .74rem; font-weight: 850; }
.tt-inv-form input:not([type="radio"]):not([type="checkbox"]),
.tt-inv-form select,
.tt-inv-form textarea { width: 100%; box-sizing: border-box; min-height: 42px; padding: 9px 11px; border: 1px solid #cedbe5; border-radius: 9px; background: #fff; color: #1f3045; font: inherit; font-size: .84rem; font-weight: 650; }
.tt-inv-form textarea { resize: vertical; }
.tt-inv-form input:focus,
.tt-inv-form select:focus,
.tt-inv-form textarea:focus { outline: 3px solid color-mix(in srgb, var(--inv-accent) 15%, transparent); border-color: var(--inv-accent); }
.tt-inv-span-2 { grid-column: 1 / -1; }
.tt-inv-kind-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 17px; }
.tt-inv-kind-switch input { position: absolute; opacity: 0; pointer-events: none; }
.tt-inv-kind-switch span { display: flex !important; align-items: center; justify-content: center; gap: 8px; min-height: 44px; margin: 0 !important; border: 1px solid #d3dee7; border-radius: 10px; background: #f8fafc; color: #536477 !important; cursor: pointer; }
.tt-inv-kind-switch input:checked + span { border-color: #7abdbd; background: #edfafa; color: #087d7d !important; box-shadow: 0 0 0 2px rgba(7, 141, 141, .08); }
.tt-inv-kind-switch svg { width: 18px; height: 18px; }
.tt-inv-lock-choice { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; margin-top: 17px; padding: 12px 13px; border: 1px solid #dbe4ec; border-radius: 10px; background: #f8fafc; cursor: pointer; }
.tt-inv-lock-choice input { grid-row: 1 / 3; width: 17px; height: 17px; accent-color: var(--inv-primary); }
.tt-inv-lock-choice span { display: flex !important; align-items: center; gap: 7px; margin: 0 !important; color: #2a4056 !important; font-size: .79rem !important; }
.tt-inv-lock-choice span svg { width: 16px; height: 16px; }
.tt-inv-lock-choice small { color: #7b899a; font-size: .69rem; font-weight: 650; }
.tt-inv-dialog-foot { position: sticky; bottom: 0; justify-content: flex-end; margin: 20px -22px 0; padding: 13px 22px; border-top: 1px solid #e1e9ef; background: #fff; }

.tt-inv-import-dialog { width: min(850px, 100%); }
.tt-inv-import-summary { display: flex; gap: 8px; padding: 15px 22px 0; }
.tt-inv-import-summary span { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 8px; background: #edf5f8; color: #365a76; font-size: .74rem; font-weight: 850; }
.tt-inv-import-summary svg { width: 16px; height: 16px; }
.tt-inv-import-preview { margin: 14px 22px; overflow: auto; border: 1px solid #d9e3eb; border-radius: 10px; }
.tt-inv-import-preview table { width: 100%; border-collapse: collapse; }
.tt-inv-import-preview th { padding: 8px 10px; border-bottom: 1px solid #dfe7ee; background: #f5f8fa; color: #68788a; font-size: .66rem; text-align: left; text-transform: uppercase; }
.tt-inv-import-preview td { padding: 8px 10px; border-bottom: 1px solid #e9eef2; color: #374a5e; font-size: .75rem; }
.tt-inv-import-preview td strong,
.tt-inv-import-preview td small { display: block; }
.tt-inv-import-preview td small { margin-top: 2px; color: #8290a0; font-size: .65rem; }
.tt-inv-import-preview > p { margin: 9px; color: #748396; font-size: .71rem; font-weight: 800; text-align: center; }
.tt-inv-import-errors { margin: 10px 22px; padding: 10px 12px; border-radius: 9px; background: #fff4f3; color: #9a3e45; font-size: .73rem; }
.tt-inv-import-errors p { margin: 5px 0; }
.tt-inv-import-update { display: grid; grid-template-columns: auto 1fr; column-gap: 9px; margin: 14px 22px; padding: 11px 12px; border: 1px solid #dce5ec; border-radius: 9px; }
.tt-inv-import-update input { grid-row: 1 / 3; width: 17px; height: 17px; accent-color: var(--inv-primary); }
.tt-inv-import-update span { color: #31465b; font-size: .78rem; font-weight: 850; }
.tt-inv-import-update small { color: #7b8999; font-size: .68rem; }
.tt-inv-import-dialog > .tt-inv-dialog-foot { margin: 0; }

@media (max-width: 980px) {
  .tt-inv-page-head { align-items: flex-start; flex-direction: column; }
  .tt-inv-head-actions { width: 100%; }
  .tt-inv-head-actions .tt-inv-btn { flex: 1; }
  .tt-inv-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tt-inv-main-toolbar { grid-template-columns: 1fr auto; }
  .tt-inv-tabs { grid-column: 1 / -1; }
  .tt-inv-search { justify-self: stretch; width: 100%; }
  .tt-inv-table th:nth-child(3), .tt-inv-table td:nth-child(3) { display: none; }
  .tt-inv-table th:nth-child(1) { width: 39%; }
  .tt-inv-table th:nth-child(2) { width: 24%; }
  .tt-inv-table th:nth-child(4) { width: 15%; }
  .tt-inv-table th:nth-child(5) { width: 22%; }
}

@media (max-width: 680px) {
  .tt-inv-page-head p { align-items: flex-start; }
  .tt-inv-head-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .tt-inv-head-actions #ttInvAdd { grid-column: auto; }
  .tt-inv-header-advanced { grid-column: 1 / -1; }
  .tt-inv-header-advanced > summary { width: 100%; box-sizing: border-box; }
  .tt-inv-header-advanced > div { width: 100%; box-sizing: border-box; }
  .tt-inv-stats { gap: 7px; }
  .tt-inv-stats > div, .tt-inv-stats > button { padding: 11px; }
  .tt-inv-stats > * > span { flex-basis: 33px; width: 33px; height: 33px; }
  .tt-inv-stats small { white-space: normal; }
  .tt-inv-main-toolbar { grid-template-columns: 1fr auto; }
  .tt-inv-tabs { width: 100%; }
  .tt-inv-tabs button { flex: 1; }
  .tt-inv-icon-text-btn { width: 42px; padding: 0; font-size: 0; }
  .tt-inv-filters > div { align-items: stretch; flex-direction: column; }
  .tt-inv-table { table-layout: auto; }
  .tt-inv-table th:nth-child(2), .tt-inv-table td:nth-child(2),
  .tt-inv-table th:nth-child(4), .tt-inv-table td:nth-child(4) { display: none; }
  .tt-inv-table th:nth-child(1) { width: auto; }
  .tt-inv-table th:nth-child(5) { width: 136px; }
  .tt-inv-table td, .tt-inv-table th { padding-left: 10px; padding-right: 10px; }
  .tt-inv-row-actions { gap: 2px; }
  .tt-inv-icon-btn { width: 30px; height: 30px; }
  .tt-inv-library-foot { align-items: flex-start; flex-direction: column; }
  .tt-inv-modal { place-items: start center; padding: 10px; }
  .tt-inv-dialog { max-height: calc(100vh - 20px); border-radius: 13px; }
  .tt-inv-dialog-head { padding: 17px; }
  .tt-inv-form { padding: 17px 17px 0; }
  .tt-inv-form-grid { grid-template-columns: 1fr; }
  .tt-inv-span-2 { grid-column: auto; }
  .tt-inv-dialog-foot { margin-left: -17px; margin-right: -17px; padding-left: 17px; padding-right: 17px; }
  .tt-inv-kind-switch { grid-template-columns: 1fr; }
}

/* One authoritative Materials button palette. These rules intentionally sit
   last so generic page-header and school-theme rules cannot create white text
   or icons on a white control. */
html body #books-tab #ttMaterialsInventory .tt-inv-btn.secondary,
html body #books-tab #ttMaterialsInventory .tt-inv-icon-text-btn,
html body .tt-inv-modal .tt-inv-btn.secondary {
  border-color: #c7d5e1 !important;
  background: #ffffff !important;
  color: #20384f !important;
  box-shadow: 0 1px 3px rgba(10, 34, 55, .1) !important;
}

html body #books-tab #ttMaterialsInventory .tt-inv-btn.secondary:hover,
html body #books-tab #ttMaterialsInventory .tt-inv-btn.secondary:focus-visible,
html body #books-tab #ttMaterialsInventory .tt-inv-icon-text-btn:hover,
html body #books-tab #ttMaterialsInventory .tt-inv-icon-text-btn:focus-visible,
html body .tt-inv-modal .tt-inv-btn.secondary:hover,
html body .tt-inv-modal .tt-inv-btn.secondary:focus-visible {
  border-color: #8eacbf !important;
  background: #eef7fb !important;
  color: #102a43 !important;
}

html body #books-tab #ttMaterialsInventory .tt-inv-btn.primary,
html body .tt-inv-modal .tt-inv-btn.primary {
  border-color: #0d5688 !important;
  background: #0d5688 !important;
  color: #ffffff !important;
}

html body #books-tab #ttMaterialsInventory .tt-inv-btn.secondary svg,
html body #books-tab #ttMaterialsInventory .tt-inv-btn.secondary svg *,
html body #books-tab #ttMaterialsInventory .tt-inv-icon-text-btn svg,
html body #books-tab #ttMaterialsInventory .tt-inv-icon-text-btn svg *,
html body .tt-inv-modal .tt-inv-btn.secondary svg,
html body .tt-inv-modal .tt-inv-btn.secondary svg * {
  color: #20384f !important;
  stroke: currentColor !important;
  fill: none !important;
  visibility: visible !important;
  opacity: 1 !important;
}
