* {
  box-sizing: border-box;
}

:root {
  color-scheme: light dark;
  --ti-text: #020617;
  --ti-heading: #020617;
  --ti-muted: #334155;
  --ti-label: #0f172a;
  --tensor-banner-from: #0c1445;
  --tensor-banner-to: #3d5a9e;
  --tensor-banner-shadow: rgba(12, 20, 69, 0.3);
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #eef2ff;
  color: var(--ti-text);
}

h1,
h2,
h3,
h4,
h5,
h6,
label,
legend,
strong {
  color: var(--ti-heading);
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(520px, 100%);
}

#loginButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

#loginButton:disabled {
  opacity: 0.85;
  cursor: wait;
}

#loginButton[aria-busy="true"]::before {
  content: "";
  width: 1em;
  height: 1em;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: tensor-login-spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes tensor-login-spin {
  to {
    transform: rotate(360deg);
  }
}

.auth-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

button {
  background: #1e3a7a;
  color: #ffffff;
  border: 1px solid #1e3a7a;
  border-radius: 0;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
}

button:hover {
  background: #152a5e;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

button:disabled:hover {
  background: #1e3a7a;
}

button.secondary {
  background: #ffffff;
  color: #3d5a9e;
  border-color: #93b4f5;
}

button.secondary:hover {
  background: #eef2ff;
}

.tensor-workspace-quota-banner {
  margin: 0 0 0.75rem;
  padding: 0.55rem 1rem;
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.45;
  grid-column: 1 / -1;
}

.tensor-workspace-quota-banner.hidden {
  display: none;
}

.tensor-workspace-quota-banner p {
  margin: 0.2rem 0;
}

.tensor-workspace-quota-banner a {
  color: #b91c1c;
  font-weight: 600;
  text-decoration: underline;
}

.shell {
  align-items: stretch;
  display: grid;
  gap: 16px;
  grid-template-columns: 58px minmax(0, 1fr);
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
}

.header {
  align-items: flex-start;
  background: linear-gradient(135deg, var(--tensor-banner-from), var(--tensor-banner-to));
  border: none;
  border-radius: 0;
  box-shadow: 0 12px 28px var(--tensor-banner-shadow);
  color: #ffffff;
  grid-column: 1 / -1;
  padding: 22px 26px;
  min-height: 112px;
}

.header h1,
.header h2,
.header h3,
.header p {
  color: #ffffff;
}

.header h1 {
  margin: 0 0 8px;
  font-size: 27px;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subtitle {
  margin: 0;
  color: var(--ti-muted);
}

.shell > .header .subtitle {
  color: rgba(255, 255, 255, 0.92);
  line-height: 1.2;
  max-width: min(720px, 100%);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tensor-app-beta-notice {
  color: rgba(255, 255, 255, 0.9);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  margin: 8px 0 0;
  width: 100%;
}

.main-nav {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 6px;
  grid-column: 1;
  margin: 0;
  position: sticky;
  top: 16px;
  width: 58px;
}

.main-nav a {
  align-items: center;
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  border-radius: 0;
  color: #065f46;
  display: inline-flex;
  font-size: 0;
  font-weight: 700;
  height: 46px;
  justify-content: center;
  line-height: 1.25;
  padding: 0;
  position: relative;
  text-decoration: none;
  width: 100%;
}

.main-nav a::before {
  background: currentColor;
  content: "";
  display: block;
  height: 23px;
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: contain;
  width: 23px;
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: contain;
}

.main-nav a[data-page="dashboard"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M3 13h8V3H3v10zm0 8h8v-6H3v6zm10 0h8V11h-8v10zm0-18v6h8V3h-8z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M3 13h8V3H3v10zm0 8h8v-6H3v6zm10 0h8V11h-8v10zm0-18v6h8V3h-8z'/%3E%3C/svg%3E");
}

.main-nav a[data-page="goods-items"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 2 3 6v12l9 4 9-4V6l-9-4Zm0 2.2L17.5 7 12 9.8 6.5 7 12 4.2ZM5 8.6l6 3v7.7l-6-3V8.6Zm14 7.7-6 3v-7.7l6-3v7.7Z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 2 3 6v12l9 4 9-4V6l-9-4Zm0 2.2L17.5 7 12 9.8 6.5 7 12 4.2ZM5 8.6l6 3v7.7l-6-3V8.6Zm14 7.7-6 3v-7.7l6-3v7.7Z'/%3E%3C/svg%3E");
}

.main-nav a[data-page="order"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M6 2h9l5 5v15H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2Zm8 1.5V8h4.5L14 3.5ZM7 12h10v2H7v-2Zm0 4h8v2H7v-2Z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M6 2h9l5 5v15H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2Zm8 1.5V8h4.5L14 3.5ZM7 12h10v2H7v-2Zm0 4h8v2H7v-2Z'/%3E%3C/svg%3E");
}

.main-nav a[data-page="warehouse"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M3 21V8l9-5 9 5v13h-2v-2H5v2H3Zm2-4h14V9.2l-7-3.9-7 3.9V17Zm3-6h8v2H8v-2Zm0 3h8v2H8v-2Z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M3 21V8l9-5 9 5v13h-2v-2H5v2H3Zm2-4h14V9.2l-7-3.9-7 3.9V17Zm3-6h8v2H8v-2Zm0 3h8v2H8v-2Z'/%3E%3C/svg%3E");
}

.main-nav a[data-page="shipping-delivery"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M3 5h12v10h2.2L20 10h-3V7h4l2 3v7h-2a3 3 0 1 1-6 0H9a3 3 0 1 1-6 0H1V7a2 2 0 0 1 2-2Zm0 2v8h12V7H3Zm3 12a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm12 0a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M3 5h12v10h2.2L20 10h-3V7h4l2 3v7h-2a3 3 0 1 1-6 0H9a3 3 0 1 1-6 0H1V7a2 2 0 0 1 2-2Zm0 2v8h12V7H3Zm3 12a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm12 0a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z'/%3E%3C/svg%3E");
}

.main-nav a[data-page="online-return"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M7 7h9.2l-2.6-2.6L15 3l5 5-5 5-1.4-1.4L16.2 9H7a3 3 0 0 0 0 6h10v2H7A5 5 0 0 1 7 7Z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M7 7h9.2l-2.6-2.6L15 3l5 5-5 5-1.4-1.4L16.2 9H7a3 3 0 0 0 0 6h10v2H7A5 5 0 0 1 7 7Z'/%3E%3C/svg%3E");
}

.main-nav a[data-page="contacts"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8Zm0 2c-4 0-7 2-7 5v1h14v-1c0-3-3-5-7-5Zm7-2V9h3V7h-3V4h-2v3h-3v2h3v3h2Z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8Zm0 2c-4 0-7 2-7 5v1h14v-1c0-3-3-5-7-5Zm7-2V9h3V7h-3V4h-2v3h-3v2h3v3h2Z'/%3E%3C/svg%3E");
}

.main-nav a.active {
  background: #047857;
  border-color: #065f46;
  color: #ffffff;
}

.main-nav a:hover {
  background: #d1fae5;
  border-color: #047857;
  color: #064e3b;
}

.main-nav a.active:hover {
  background: #065f46;
  border-color: #064e3b;
  color: #ffffff;
}

.main-nav a[data-page="mro"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M20 7h-4V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v2H4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2zm-8-2h4v2h-4V5zm10 13H4V9h16v9z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M20 7h-4V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v2H4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2zm-8-2h4v2h-4V5zm10 13H4V9h16v9z'/%3E%3C/svg%3E");
}

.mro-associate-layout {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(260px, 1fr) minmax(280px, 1.2fr);
}

@media (max-width: 900px) {
  .mro-associate-layout {
    grid-template-columns: 1fr;
  }
}

.mro-tree-root {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mro-tree-node {
  border-left: 3px solid #1e3a7a;
  padding-left: 12px;
}

.mro-tree-good {
  font-weight: 700;
  margin-bottom: 6px;
}

.mro-tree-children {
  list-style: none;
  margin: 0 0 8px;
  padding: 0 0 0 16px;
}

.mro-tree-children li {
  margin: 4px 0;
  position: relative;
}

.mro-tree-children li::before {
  color: #1e3a7a;
  content: "└";
  left: -12px;
  position: absolute;
}

.mro-alert-leaf {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.mro-alert-leaf--empty {
  opacity: 0.85;
}

.mro-alert-spare-name {
  font-weight: 600;
  min-width: 8rem;
}

.mro-alert-desc {
  flex: 1 1 12rem;
  min-width: 8rem;
}

.mro-spare-checks {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
}

.mro-spare-check {
  align-items: center;
  display: flex;
  gap: 8px;
}

.mro-associated-hint {
  background: #ecfdf5;
  border: 1px solid #c5d4f0;
  border-radius: 0;
  margin: 8px 0 12px;
  padding: 10px 12px;
}

.mro-consumption-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

.mro-consumption-list li {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  padding: 6px 0;
}

.mro-saved-list {
  margin-top: 20px;
}

.mro-alert-badge {
  border-radius: 0;
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 10px;
}

.mro-alert-badge--ok {
  background: #dcfce7;
  color: #166534;
}

.mro-alert-badge--due-soon {
  background: #fef9c3;
  color: #854d0e;
}

.mro-alert-badge--action-required {
  background: #ffedd5;
  color: #9a3412;
}

.mro-alert-badge--overdue {
  background: #fee2e2;
  color: #991b1b;
}

.sr-only {
  border: 0;
  clip: rect(0, 0, 0, 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}

.mro-maintenance-link-row {
  margin: 8px 0 12px;
}

.mro-consume-hint {
  font-size: 12px;
  margin: 0 0 12px;
}

.mro-maintenance-embed {
  margin: 12px 0 16px;
  padding: 12px;
}

.mro-maintenance-embed-head {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 8px;
}

.mro-maintenance-embed-head h3 {
  margin: 0;
}

.mro-maintenance-embed-head .secondary-button {
  font-size: 12px;
  padding: 6px 10px;
  text-decoration: none;
}

.mro-maintenance-frame {
  border: 1px solid #c5d4f0;
  border-radius: 0;
  display: block;
  height: min(720px, 70vh);
  width: 100%;
}

.shell > :not(.header):not(.main-nav):not(.footer) {
  grid-column: 2;
  min-width: 0;
  width: 100%;
}

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

.card {
  background: #ffffff;
  border: 1px solid #c5d4f0;
  border-radius: 0;
  color: var(--ti-text);
  padding: 16px;
}

.card p,
.card li,
.card td,
.card dd,
.card dt {
  color: var(--ti-text);
}

.kpi-label {
  display: block;
  color: var(--ti-muted);
  font-size: 12px;
}

.kpi-value {
  display: block;
  font-size: 29px;
  margin: 4px 0;
}

.kpi-note {
  margin: 0;
  color: var(--ti-muted);
  font-size: 12px;
}

.inventory-dashboard-insights {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  width: 100%;
}

.inventory-dashboard-charts {
  align-items: start;
  display: grid;
  column-gap: 16px;
  grid-auto-rows: min-content;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 0;
  row-gap: 12px;
  width: 100%;
}

.inventory-dashboard-charts .inventory-chart-card {
  height: auto;
  min-width: 0;
}

.inventory-dashboard-table-card {
  min-width: 0;
  width: 100%;
}

.inventory-chart-card {
  height: auto;
}

.inventory-chart-head {
  margin-bottom: 10px;
}

.inventory-chart-head h2 {
  font-size: 18px;
  line-height: 1.25;
  margin: 0;
}

.inventory-chart-subtitle {
  color: var(--ti-muted);
  display: block;
  font-size: 12px;
  line-height: 1.3;
  margin: 4px 0 0;
}

.inventory-bar-chart {
  display: grid;
  gap: 12px;
}

.inventory-bar-row {
  display: grid;
  gap: 6px;
}

.inventory-bar-meta {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  font-size: 12px;
}

.inventory-bar-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-bar-meta strong {
  color: var(--ti-heading);
  flex-shrink: 0;
}

.inventory-bar-track {
  background: #dcfce7;
  border-radius: 0;
  height: 12px;
  overflow: hidden;
}

.inventory-bar-track span {
  background: linear-gradient(90deg, #1e3a7a, #3d5a9e, #93b4f5);
  border-radius: inherit;
  display: block;
  height: 100%;
  min-width: 10px;
}

.inventory-donut-layout {
  align-items: center;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(120px, 150px) minmax(0, 1fr);
}

.inventory-donut {
  align-items: center;
  aspect-ratio: 1;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 150px;
  position: relative;
  width: 100%;
}

.inventory-donut::after {
  background: #ffffff;
  border-radius: 50%;
  content: "";
  inset: 24%;
  position: absolute;
}

.inventory-donut strong,
.inventory-donut span {
  position: relative;
  z-index: 1;
}

.inventory-donut strong {
  color: var(--ti-heading);
  font-size: 23px;
}

.inventory-donut span {
  color: var(--ti-muted);
  font-size: 11px;
  font-weight: 700;
}

.inventory-donut-legend {
  display: grid;
  gap: 8px;
  font-size: 12px;
  max-height: 168px;
  overflow-y: auto;
}

.inventory-donut-legend div {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 10px minmax(0, 1fr) auto;
}

.inventory-donut-legend span {
  border-radius: 50%;
  height: 10px;
  width: 10px;
}

@media (max-width: 960px) {
  .inventory-dashboard-charts {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .inventory-donut-layout {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .inventory-donut-card .inventory-donut-legend {
    width: 100%;
  }
}

h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid #c5d4f0;
  color: var(--ti-text);
  padding: 10px 8px;
  font-size: 13px;
}

th {
  color: var(--ti-heading);
  font-size: 12px;
  font-weight: 700;
}

.table-wrap {
  overflow-x: auto;
}

.plain-table {
  border: 0;
  min-width: 100%;
}

.plain-table th,
.plain-table td {
  line-height: 1.2;
  padding: 5px 6px;
  vertical-align: middle;
  white-space: nowrap;
}

.plain-table .link-button + .link-button {
  margin-left: 8px;
}

.ti-table-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  white-space: nowrap;
}

.ti-icon-btn {
  align-items: center;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  color: #152a5e;
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 32px;
  height: 32px;
  justify-content: center;
  min-height: 32px;
  min-width: 32px;
  padding: 0;
  width: 32px;
}

.ti-icon-btn svg {
  height: 16px;
  width: 16px;
}

.ti-icon-btn:hover {
  background: #eef2ff;
  border-color: #94a3b8;
  color: #0f172a;
}

.ti-icon-btn--danger {
  color: #b91c1c;
}

.ti-icon-btn--danger:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
}

.ti-icon-btn:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 1px;
}

.inventory-plain-table {
  min-width: 1180px;
}

.inventory-plain-table .ti-warehouse-stock-summary {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-plain-table td:nth-child(2) {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ti-spw-controls-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  margin: 12px 0 14px;
}

.ti-spw-controls-row > .card {
  min-width: 0;
  height: 100%;
}

.ti-spw-controls-row .inventory-spw-card-title {
  margin-top: 0;
}

.ti-spw-controls-row .inventory-cloud-form {
  margin: 0;
  border: 0;
  padding: 0;
}

@media (max-width: 960px) {
  .ti-spw-controls-row {
    grid-template-columns: 1fr;
  }
}

.inventory-cloud-form {
  border: 1px solid #c5d4f0;
  border-radius: 0;
  display: grid;
  gap: 12px;
  margin: 12px 0 14px;
  padding: 12px;
}

.inventory-form-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.inventory-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
}

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

.inventory-form-grid input,
.inventory-form-grid select,
.inventory-form-grid textarea {
  border: 1px solid #c5d4f0;
  border-radius: 0;
  color: var(--ti-text);
  font: inherit;
  padding: 8px 10px;
}

.inventory-form-grid input::placeholder,
.inventory-form-grid textarea::placeholder,
.label-tools input[type="text"]::placeholder {
  color: var(--ti-muted);
  opacity: 1;
}

.ti-barcode-field > span:first-child {
  font-size: 12px;
  font-weight: 700;
}

.ti-barcode-controls {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.ti-barcode-controls input {
  flex: 1 1 auto;
  min-width: 0;
}

.ti-camera-scan-btn {
  flex: 0 0 auto;
  align-self: stretch;
}

.ti-camera-scan-btn.ti-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 0 12px;
}

.ti-camera-scan-btn.ti-icon-btn .ti-camera-scan-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ti-camera-scan-icon {
  display: block;
  flex: 0 0 auto;
}

.ti-barcode-just-filled {
  outline: 2px solid #0f766e;
  outline-offset: 1px;
}

.ti-camera-scan-dialog {
  border: none;
  border-radius: 8px;
  padding: 0;
  max-width: min(520px, calc(100vw - 24px));
  width: 100%;
  background: var(--ti-surface, #fff);
  color: var(--ti-text, #0f172a);
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.28);
}

.ti-camera-scan-dialog::backdrop {
  background: rgba(15, 23, 42, 0.55);
}

.ti-camera-scan-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}

.ti-camera-scan-panel h2 {
  margin: 0;
  font-size: 1.1rem;
}

.ti-camera-scan-video-wrap,
.ti-camera-scan-region {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  background: #0f172a;
  aspect-ratio: 4 / 3;
  width: 100%;
  min-height: 220px;
}

.ti-camera-scan-region video,
.ti-camera-scan-region canvas {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

.ti-camera-scan-video-wrap video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.ti-camera-scan-reticle {
  pointer-events: none;
  position: absolute;
  inset: 18% 12%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 4px;
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.28);
  z-index: 1;
}

.ti-camera-scan-status {
  margin: 0;
  min-height: 1.25em;
}

.ti-camera-scan-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.inventory-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.link-button {
  background: transparent;
  border: 0;
  color: #152a5e;
  padding: 0;
  text-decoration: underline;
}

.muted {
  color: var(--ti-muted);
  font-size: 12px;
}

body[data-density="compact"] .table-wrap th,
body[data-density="compact"] .table-wrap td {
  padding: 6px;
  font-size: 12px;
}

.erp-crm-contacts-form-card {
  border: 1px solid #c5d4f0;
  border-radius: 0;
  margin: 12px 0 16px;
  padding: 12px;
}

.erp-crm-contacts-form-head {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 10px;
}

.erp-crm-contacts-form-head h4 {
  margin: 0;
}

.erp-crm-contacts-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.erp-crm-contacts-form-actions button {
  cursor: pointer;
}

.erp-crm-contacts-form-panel select,
.erp-crm-contacts-form-panel button,
.erp-crm-contacts-form-panel input:not(.erp-crm-field-readonly) {
  pointer-events: auto;
}

.erp-crm-field-readonly {
  background: #f8fafc;
  color: #64748b;
  cursor: not-allowed;
}

.erp-crm-contacts-list-title {
  margin: 0 0 10px;
}

.ti-crm-contacts-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  white-space: nowrap;
}

.inventory-goods-photo-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.inventory-goods-photo-preview {
  max-width: 120px;
  max-height: 120px;
  object-fit: contain;
  border-radius: 0;
  border: 1px solid #a8b8d8;
  background: #eef2ff;
}

.inventory-submenu-layout {
  align-items: stretch;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(152px, 184px) minmax(0, 1fr);
}

.inventory-page-submenu {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: static;
  top: auto;
}

.inventory-page-submenu a {
  background: #ffffff;
  border: 1px solid #c5d4f0;
  border-radius: 0;
  color: var(--ti-text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  padding: 8px 10px;
  text-decoration: none;
}

.inventory-page-submenu a:hover {
  background: #eef2ff;
  border-color: #86efac;
}

.inventory-page-submenu a.active {
  background: #1e3a7a;
  border-color: #047857;
  color: #ffffff;
}

.inventory-submenu-panels {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.inventory-submenu-section[hidden] {
  display: none !important;
}

.inventory-submenu-section {
  scroll-margin-top: 18px;
}

.inventory-submenu-section--split {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.inventory-module-layout {
  display: grid;
  gap: 14px;
  margin-top: 12px;
  min-width: 0;
}

.inventory-module-layout.ti-fin-workflow-split,
.inventory-submenu-section--split.ti-fin-workflow-split,
.ti-fin-workflow-split {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.inventory-module-form-card,
.inventory-module-list-card {
  margin: 0;
  min-width: 0;
}

.inventory-module-list-body {
  max-width: 100%;
  min-width: 0;
}

.inventory-module-list-body .table-wrap {
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  overflow-x: auto;
}

#goods-inventory .table-wrap,
#goods-catalog .table-wrap {
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  overflow-x: auto;
}

table[data-goods-submenu-table="inventory"],
table[data-inventory-goods-tab-table] {
  min-width: 1280px;
  width: max-content;
}

table[data-goods-submenu-table="inventory"] th,
table[data-goods-submenu-table="inventory"] td,
table[data-inventory-goods-tab-table] th,
table[data-inventory-goods-tab-table] td {
  white-space: nowrap;
}

.inventory-module-form-head {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
}

.inventory-module-form-head h3,
.inventory-module-list-title {
  font-size: 15px;
  margin: 0;
}

.inventory-module-form-card .inventory-cloud-form {
  border: 0;
  margin: 0;
  padding: 0;
}

.inventory-goods-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 10px;
}

.inventory-goods-tab {
  background: #ffffff;
  border: 1px solid #c5d4f0;
  border-radius: 0;
  color: var(--ti-text);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  padding: 6px 12px;
}

.inventory-goods-tab:hover {
  background: #eef2ff;
  border-color: #86efac;
}

.inventory-goods-tab.active {
  background: #1e3a7a;
  border-color: #047857;
  color: #ffffff;
}

.inventory-goods-tab-panels {
  min-width: 0;
}

.inventory-goods-tab-panel {
  min-width: 0;
}

.inventory-goods-tab-desc {
  margin: 0 0 10px;
}

.erp-goods-list-panel {
  margin-top: 0;
}

.inventory-goods-list-title {
  margin: 0 0 6px;
  font-size: 0.9875rem;
}

.inventory-goods-list-desc {
  margin: 0 0 10px;
  font-size: 0.8375rem;
}

#goods-inventory .inventory-goods-tab-panel .table-wrap,
#goods-inventory [data-inventory-goods-tab-table] {
  max-width: 100%;
}

.footer {
  grid-column: 1 / -1;
  margin-top: 16px;
  color: var(--ti-muted);
  font-size: 12px;
}

.label-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 16px;
}

.label-tools label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--ti-label);
}

.label-tools input[type="text"] {
  min-width: 240px;
  padding: 8px 10px;
  border-radius: 0;
  border: 1px solid #c5d4f0;
  color: var(--ti-text);
  font-size: 13px;
}

.label-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-start;
  margin-top: 16px;
}

.label-preview canvas {
  border: 1px dashed #86efac;
  border-radius: 0;
  background: #ffffff;
}

.label-preview svg {
  max-width: 100%;
  height: auto;
}

.pref-field {
  margin-bottom: 14px;
}

.pref-field select {
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 0;
  border: 1px solid #c5d4f0;
  color: var(--ti-text);
  font-size: 13px;
  min-width: 220px;
}

.pref-subheading {
  margin: 16px 0 8px;
  font-size: 13px;
  font-weight: 700;
}

.pref-toggle {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  margin: 12px 0 0;
  font-size: 13px;
  font-weight: 700;
}

.ti-toggle-switch {
  display: inline-flex;
  flex: 0 0 auto;
  height: 28px;
  position: relative;
  width: 48px;
}

.ti-toggle-switch input {
  height: 0;
  opacity: 0;
  position: absolute;
  width: 0;
}

.ti-toggle-slider {
  background: #c5d4f0;
  border-radius: 999px;
  bottom: 0;
  cursor: pointer;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
  transition: background 0.15s ease;
}

.ti-toggle-slider::before {
  background: #fff;
  border-radius: 50%;
  bottom: 3px;
  content: "";
  height: 22px;
  left: 3px;
  position: absolute;
  transition: transform 0.15s ease;
  width: 22px;
}

.ti-toggle-switch input:checked + .ti-toggle-slider {
  background: #0f766e;
}

.ti-toggle-switch input:checked + .ti-toggle-slider::before {
  transform: translateX(20px);
}

.ti-toggle-switch input:focus-visible + .ti-toggle-slider {
  outline: 2px solid #0f766e;
  outline-offset: 2px;
}

.pref-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.pref-actions-save {
  align-items: center;
  margin-top: 16px;
}

.ti-hw-device-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

.ti-hw-device-item {
  align-items: center;
  border: 1px solid #c5d4f0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 10px 12px;
}

.ti-hw-device-name {
  font-size: 13px;
  font-weight: 600;
}

.ti-hw-device-kind {
  font-size: 12px;
}

.ti-hw-device-empty {
  margin-top: 8px;
}

.muted {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--ti-muted);
}

.shell > .header.app-header--with-shortcuts {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.tensor-workspace-chrome {
  flex: 0 0 auto;
  max-width: min(420px, 100%);
}

.tensor-workspace-chrome-inner {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tensor-workspace-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.15);
}

.tensor-workspace-chrome-meta strong {
  display: block;
  font-size: 0.8875rem;
  color: #ffffff;
}

.tensor-workspace-chrome-sub {
  font-size: 0.6875rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.3;
}

.shell > .header.app-header--with-shortcuts .app-header-brand {
  flex: 1;
  min-width: 0;
}

.finance-banner-brand-row {
  align-items: center;
  display: flex;
  gap: 14px;
  min-width: 0;
}

.finance-banner-logo-wrap {
  flex-shrink: 0;
}

.shell > .header .finance-banner-logo {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 0;
  box-sizing: border-box;
  display: block;
  height: 52px;
  object-fit: contain;
  padding: 5px;
  width: auto;
}

.finance-banner-titles {
  flex: 1;
  min-width: 0;
}

.hidden {
  display: none !important;
}

.shell > .header.app-header--with-shortcuts .crm-header-shortcuts {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.shell > .header.app-header--with-shortcuts .crm-prefs-shortcut,
.shell > .header.app-header--with-shortcuts .tensor-banner-logout,
.shell > .header.app-header--with-shortcuts a.tensor-erp-launcher,
.shell > .header.app-header--with-shortcuts a.tensor-finance-launcher {
  order: 1;
}

.shell > .header.app-header--with-shortcuts .crm-prefs-shortcut {
  align-items: center;
  background: rgba(15, 23, 42, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 0;
  box-sizing: border-box;
  color: rgba(255, 255, 255, 0.95);
  display: inline-flex;
  height: 2.35rem;
  justify-content: center;
  text-decoration: none;
  transition: background 0.15s ease;
  width: 2.35rem;
}

.shell > .header.app-header--with-shortcuts .crm-prefs-shortcut:hover {
  background: rgba(15, 23, 42, 0.38);
  color: #fff;
}

.shell > .header.app-header--with-shortcuts .crm-prefs-shortcut:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.shell > .header.app-header--with-shortcuts .tensor-banner-session {
  color: rgba(255, 255, 255, 0.92);
  flex-basis: 100%;
  font-size: 12px;
  font-weight: 700;
  margin-top: 0;
  max-width: min(420px, 48vw);
  order: 1;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shell > .header.app-header--with-shortcuts .tensor-banner-logout {
  background: rgba(15, 23, 42, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 0;
  color: rgba(255, 255, 255, 0.96);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 14px;
}

.shell > .header.app-header--with-shortcuts .tensor-banner-logout:hover {
  background: rgba(15, 23, 42, 0.38);
  color: #fff;
}

.shell > .header.app-header--with-shortcuts a.tensor-erp-launcher,
.shell > .header.app-header--with-shortcuts a.tensor-finance-launcher {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  min-width: 2.35rem;
  min-height: 2.35rem;
  padding: 0;
  overflow: hidden;
  color: transparent;
  font-size: 0;
  line-height: 0;
  text-decoration: none;
  background-color: rgba(255, 255, 255, 0.18);
  background-position: center;
  background-repeat: no-repeat;
  background-size: 24px 24px;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32), 0 8px 18px rgba(15, 23, 42, 0.12);
  -webkit-backdrop-filter: blur(10px) saturate(145%);
  backdrop-filter: blur(10px) saturate(145%);
}

.shell > .header.app-header--with-shortcuts a.tensor-erp-launcher {
  background-image: url("tensorERP-logo-removebg-preview.png?v=td22");
}

.shell > .header.app-header--with-shortcuts a.tensor-finance-launcher {
  background-image: url("tensorFinance-icon-removebg.png?v=ti2");
}

@media (prefers-color-scheme: dark) {
  .shell > .header.app-header--with-shortcuts a.tensor-finance-launcher {
    background-image: url("tensorFinance-icon-dark-mode.png?v=ti2");
  }
}

.shell > .header.app-header--with-shortcuts a.tensor-erp-launcher:hover,
.shell > .header.app-header--with-shortcuts a.tensor-finance-launcher:hover {
  background-color: rgba(255, 255, 255, 0.28);
}

.shell > .header.app-header--with-shortcuts a.tensor-erp-launcher:focus-visible,
.shell > .header.app-header--with-shortcuts a.tensor-finance-launcher:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ti-text: #e8edf8;
    --ti-heading: #ffffff;
    --ti-muted: #a8b8d8;
    --ti-label: #c5d4f0;
    --tensor-banner-from: #080f2e;
    --tensor-banner-to: #2a3a7a;
    --tensor-banner-shadow: rgba(0, 0, 0, 0.42);
  }

  body {
    background: #000000;
    color: #e8edf8;
  }

  button.secondary,
  .main-nav a {
    background: #0f1528;
    border-color: #1e3a7a;
    color: #e8edf8;
  }

  .card,
  .inventory-cloud-form,
  .inventory-submenu-section {
    background: rgba(8, 12, 28, 0.32);
    border-color: rgba(20, 30, 70, 0.45);
    color: #e8edf8;
  }

  .inventory-page-submenu a {
    background: #0c1020;
    border-color: #1a2848;
    color: #a8b8d8;
  }

  button.secondary:hover,
  .main-nav a:hover {
    background: #152040;
    border-color: #152a5e;
  }

  .inventory-page-submenu a:hover {
    background: #101828;
    border-color: #243058;
  }

  .main-nav a.active {
    background: #152a5e;
    border-color: #3d5a9e;
    color: #ffffff;
  }

  .inventory-page-submenu a.active {
    background: #0f1828;
    border-color: #1e3a7a;
    color: #e8edf8;
  }

  .subtitle,
  .kpi-label,
  .kpi-note,
  th,
  td,
  .muted,
  .footer,
  .label-tools label {
    color: var(--ti-muted);
  }

  th,
  td {
    border-bottom-color: #1e3a7a;
  }

  .inventory-form-grid input,
  .inventory-form-grid select,
  .inventory-form-grid textarea,
  .label-tools input[type="text"],
  .pref-field select {
    background: #0c1020;
    border-color: #1e3a7a;
    color: #e8edf8;
  }

  .inventory-form-grid input::placeholder,
  .inventory-form-grid textarea::placeholder,
  .label-tools input[type="text"]::placeholder {
    color: #6b7fa8;
  }

  .link-button {
    color: #7eb3d9;
  }

  .inventory-bar-meta strong,
  .inventory-donut strong {
    color: #e8edf8;
  }

  .inventory-bar-track {
    background: #152040;
  }

  .inventory-donut::after {
    background: #0f1528;
  }

  .inventory-donut span {
    color: #c5d4f0;
  }

  .label-preview canvas {
    background: #ffffff;
    border-color: #1e3a7a;
  }
}

/* Industrial graphite ERP theme */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --erp-bg: #0B1120;
    --erp-sidebar: #111827;
    --erp-surface: #1F2937;
    --erp-panel: rgba(15, 20, 31, 0.32);
    --erp-panel-border: rgba(55, 65, 81, 0.42);
    --erp-border: #374151;
    --erp-text: #F8FAFC;
    --erp-muted: #D1D5DB;
    --erp-subtle: #9CA3AF;
    --ti-icon: #E5E7EB;
    --module-primary: #152a5e;
    --module-hover: #1e3a7a;
    --module-soft: rgba(30, 58, 122, 0.18);
    --tensor-banner-from: var(--erp-sidebar);
    --tensor-banner-to: var(--module-primary);
    --tensor-banner-shadow: rgba(0, 0, 0, 0.36);
  }

  body {
    background: var(--erp-bg) !important;
    color: var(--erp-text) !important;
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  legend,
  strong {
    color: var(--erp-text) !important;
  }

  p,
  .subtitle,
  label,
  th,
  td,
  .muted,
  .kpi-label,
  .kpi-note,
  .footer,
  .label-tools label,
  .inventory-bar-meta,
  [data-module-message] {
    color: var(--erp-muted) !important;
  }

  td strong,
  .inventory-bar-meta strong,
  .inventory-donut strong {
    color: var(--erp-text) !important;
  }

  input,
  select,
  textarea {
    background: var(--erp-sidebar) !important;
    border-color: var(--erp-border) !important;
    color: var(--erp-text) !important;
  }

  .header {
    background: linear-gradient(135deg, var(--erp-sidebar), var(--module-primary)) !important;
    border: 1px solid var(--erp-border) !important;
    color: var(--erp-text) !important;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.32);
  }

  .main-nav {
    background: var(--erp-sidebar) !important;
    border-color: var(--erp-border) !important;
    color: var(--erp-text) !important;
  }

  .card,
  .inventory-cloud-form,
  .inventory-submenu-section {
    background: var(--erp-panel) !important;
    border-color: var(--erp-panel-border) !important;
    color: var(--erp-text) !important;
  }

  .main-nav a {
    background: var(--erp-surface) !important;
    border-color: var(--erp-border) !important;
    color: var(--ti-icon) !important;
  }

  .inventory-page-submenu a {
    background: #0f1419 !important;
    border-color: #1e293b !important;
    color: #94a3b8 !important;
  }

  .main-nav a::before,
  .inventory-page-submenu a::before {
    background: var(--ti-icon) !important;
  }

  .main-nav a.active {
    color: #ffffff !important;
  }

  .inventory-page-submenu a.active {
    background: #0f1828 !important;
    border-color: #1e3a7a !important;
    color: #a8b8d8 !important;
  }

  .main-nav a.active::before,
  .inventory-page-submenu a.active::before {
    background: #ffffff !important;
  }

  .main-nav a:hover {
    color: var(--erp-text) !important;
  }

  .inventory-page-submenu a:hover {
    background: #151b26 !important;
    border-color: #334155 !important;
    color: var(--erp-muted) !important;
  }

  .main-nav a:hover::before,
  .inventory-page-submenu a:hover::before {
    background: var(--erp-text) !important;
  }

  button,
  button.secondary,
  .main-nav a.active {
    background: var(--module-primary) !important;
    border-color: var(--module-primary) !important;
    color: var(--erp-text) !important;
  }

  button:hover,
  button.secondary:hover,
  .main-nav a.active:hover {
    background: var(--module-hover) !important;
    border-color: var(--module-hover) !important;
    color: #ffffff !important;
  }

  .inventory-page-submenu a.active:hover {
    background: #152040 !important;
    border-color: #152a5e !important;
    color: #c5d4f0 !important;
  }

  .link-button,
  a.link-button {
    color: #93b4f5 !important;
  }

  .ti-icon-btn {
    background: var(--erp-surface) !important;
    border-color: var(--erp-border) !important;
    color: var(--ti-icon) !important;
  }

  .ti-icon-btn:hover {
    background: #152040 !important;
    border-color: #1e3a7a !important;
    color: var(--erp-text) !important;
  }

  .ti-icon-btn--danger {
    color: #fca5a5 !important;
  }

  .ti-icon-btn--danger:hover {
    background: rgba(127, 29, 29, 0.35) !important;
    border-color: #b91c1c !important;
    color: #fecaca !important;
  }

  svg,
  .ti-inline-icon {
    color: var(--ti-icon);
    stroke: currentColor;
  }

  .tensor-banner-session,
  .header h1,
  .header .subtitle,
  .header p {
    color: var(--erp-text) !important;
  }

  input::placeholder,
  textarea::placeholder {
    color: var(--erp-subtle) !important;
  }

  table,
  td,
  th,
  hr {
    border-color: var(--erp-border) !important;
  }

  @media print {
    .main-nav,
    .auth-row,
    .footer,
    .label-tools button,
    #printLabelsButton {
      display: none !important;
    }

    body {
      background: #ffffff;
    }

    .shell {
      max-width: none;
      padding: 0;
    }

    .card {
      border: none;
    }
  }

  /* Mobile: burger toggles main navigation links */
  .nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    width: 46px;
    height: 42px;
    padding: 0;
    margin: 0 10px 0 0;
    border-radius: 0;
    border: 1px solid rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.18);
    cursor: pointer;
    flex-shrink: 0;
  }

  .nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 0;
    background: #ffffff;
  }

  @media (max-width: 768px) {
    .shell {
      grid-template-columns: 1fr;
      padding: 12px;
    }

    .main-nav {
      display: flex;
      grid-column: 1;
      flex-wrap: wrap;
      flex-direction: row;
      align-items: center;
      padding: 6px;
      gap: 6px;
      position: static;
      width: 100%;
    }

    .nav-toggle {
      display: inline-flex;
    }

    .main-nav a {
      flex: 0 0 46px;
      width: 46px;
    }

    .main-nav:not(.is-open) a {
      display: none;
    }

    .inventory-submenu-layout {
      grid-template-columns: 1fr;
    }

    .inventory-page-submenu {
      flex-direction: row;
      flex-wrap: wrap;
      position: static;
    }

    .inventory-page-submenu a {
      flex: 0 0 auto;
    }

    .shell > .header.app-header--with-shortcuts {
      flex-direction: row;
      align-items: center;
    }

    .shell > .header.app-header--with-shortcuts .app-header-brand {
      flex: 1 1 auto;
      min-width: 0;
    }

    .shell > .header.app-header--with-shortcuts .crm-header-shortcuts {
      width: auto;
      max-width: 100%;
      justify-content: flex-end;
    }

    .shell > .header.app-header--with-shortcuts .tensor-banner-session {
      flex-basis: auto;
      width: auto;
      max-width: 100%;
      white-space: nowrap;
      overflow: hidden;
      text-align: right;
    }
  }

  @media (max-width: 640px) {
    .shell > .header {
      min-height: auto;
      padding: 14px 16px;
    }

    .shell > .header .app-header-brand,
    .shell > .header h1,
    .shell > .header .subtitle,
    .shell > .header p {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .shell > .header.app-header--with-shortcuts .crm-header-shortcuts {
      align-items: center;
      width: auto;
    }

    .shell > .header.app-header--with-shortcuts .tensor-banner-logout {
      max-width: 100%;
      white-space: nowrap;
    }
  }

}

.inventory-list-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin: 0.75rem 0 0;
}

.inventory-list-pagination-status {
  font-size: 0.8125rem;
  color: var(--muted, #64748b);
}

.inventory-list-pagination button[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

/* === Tensor Finance shell alignment (structure; colors unchanged) === */
body {
  font-size: 15px;
}

.shell {
  gap: 0;
  max-width: 1280px;
  padding: 0;
}

.shell:has(> .main-nav) {
  gap: 0;
  grid-template-columns: max-content minmax(0, 1fr);
}

.shell:has(> .main-nav) > :not(.header):not(.main-nav) {
  min-width: 0;
}

.header {
  border-radius: 0;
  box-shadow: none;
  margin-bottom: 0;
  min-height: 0;
  padding: 14px 20px;
}

.header h1 {
  font-size: 1.4375rem;
  line-height: 1.2;
  margin: 0 0 4px;
}

.header p,
.header .subtitle,
.shell > .header .subtitle {
  font-size: 0.75rem;
  line-height: 1.35;
}

.main-nav {
  align-self: stretch;
  border-radius: 0;
  border-bottom: 0;
  border-left: 0;
  border-top: 0;
  gap: 5px;
  height: 100%;
  margin: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 8px;
  position: static;
  top: auto;
  -webkit-overflow-scrolling: touch;
}

.main-nav a {
  border-radius: 0;
  box-sizing: border-box;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.25;
  padding: 7px 9px;
  text-align: left;
  width: 100%;
}

.shell:has(> .main-nav) .main-nav {
  width: max-content;
}

.shell:has(> .main-nav) .main-nav a {
  align-items: center;
  display: inline-flex;
  font-size: 0;
  height: 42px;
  justify-content: center;
  min-height: 42px;
  min-width: 42px;
  padding: 8px 6px;
  text-align: center;
}

.production-app-shell {
  gap: 0;
  max-width: 1280px;
  padding: 0;
}

.production-app-sidebar {
  align-self: stretch;
  border-radius: 0;
  border-bottom: 0;
  border-left: 0;
  border-top: 0;
  gap: 5px;
  height: 100%;
  margin: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 8px;
  position: static;
  top: auto;
  -webkit-overflow-scrolling: touch;
}

.production-sidebar-toggle {
  border-radius: 0;
}

.production-app-sidebar .production-sidebar-link,
.production-app-sidebar .production-sidebar-sublink {
  border-radius: 0;
  font-size: 0;
  gap: 0;
  justify-content: center;
  line-height: 0;
  overflow: hidden;
  white-space: nowrap;
}

@media (min-width: 769px) {
  .production-app-sidebar .production-sidebar-link,
  .production-app-sidebar .production-sidebar-sublink {
    height: 42px;
    min-height: 42px;
    min-width: 42px;
    padding: 8px 6px;
    width: 100%;
  }
}

.hr-workflow-layout,
.hr-attendance-layout,
.inventory-submenu-layout,
.production-page-layout {
  gap: 0;
  grid-template-columns: max-content minmax(0, 1fr);
}

.hr-page-submenu,
.hr-attendance-submenu,
.inventory-page-submenu,
.production-page-submenu {
  align-self: stretch;
  border-bottom: 0;
  border-left: 0;
  border-top: 0;
  gap: 5px;
  height: 100%;
  margin: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 8px;
  position: static;
  top: auto;
  width: max-content;
  -webkit-overflow-scrolling: touch;
}

.hr-page-submenu a,
.hr-attendance-submenu a,
.inventory-page-submenu a,
.production-page-submenu a {
  border-radius: 0;
  box-sizing: border-box;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.25;
  padding: 7px 9px;
  text-align: left;
  width: 100%;
}

.hr-workflow-panels,
.inventory-submenu-panels,
.production-page-panels {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0;
  -webkit-overflow-scrolling: touch;
}

.hr-workflow-panels > .card + .card,
.hr-workflow-panels > .hr-submenu-section + .hr-submenu-section,
.inventory-submenu-panels > .card + .card,
.inventory-submenu-panels > .inventory-submenu-section + .inventory-submenu-section,
.production-page-panels > .card + .card,
.production-page-panels > .production-submenu-section + .production-submenu-section {
  border-top: 0;
}

.card {
  border-radius: 0;
  padding: 16px;
}

button,
.secondary-button,
.link-button {
  border-radius: 0;
  font-weight: 600;
  padding: 8px 12px;
}

input,
select,
textarea {
  border-radius: 0;
  padding: 8px 10px;
}

/* Local scroll: banner + sidebar/submenus fixed; main content scrolls */
html:has(.shell > .main-nav),
html:has(.shell > .main-nav) body {
  height: 100%;
  overflow: hidden;
}

.shell:has(> .main-nav) {
  box-sizing: border-box;
  display: grid;
  gap: 0;
  grid-template-columns: max-content minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  height: 100dvh;
  margin: 0 auto;
  max-height: 100dvh;
  max-width: 1280px;
  min-height: 0;
  overflow: hidden;
  padding: 0;
}

.shell:has(> .main-nav) > .header {
  grid-column: 1 / -1;
  grid-row: 1;
}

.shell:has(> .main-nav) > .main-nav {
  align-self: stretch;
  grid-column: 1;
  grid-row: 2 / -1;
  min-height: 0;
}

.shell:has(> .main-nav) > .shell-scroll {
  grid-column: 2;
  grid-row: 2;
  min-height: 0;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.shell:has(> .main-nav) > .inventory-submenu-layout {
  grid-column: 2;
  grid-row: 2;
  height: 100%;
  min-height: 0;
}

.inventory-submenu-layout {
  align-items: stretch;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.inventory-submenu-panels {
  height: 100%;
  max-height: 100%;
  min-height: 0;
}

.inventory-page-submenu {
  position: static;
  top: auto;
}

@media (max-width: 720px) {
  html:has(.shell > .main-nav),
  html:has(.shell > .main-nav) body {
    height: auto;
    overflow: auto;
  }

  .shell:has(> .main-nav) {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .shell:has(> .main-nav) > .shell-scroll {
    overflow: visible;
  }

  .main-nav,
  .inventory-page-submenu {
    border-right: 0;
    flex-direction: row;
    flex-wrap: wrap;
    height: auto;
    overflow: visible;
    width: 100%;
  }

  .shell:has(> .main-nav) .main-nav a {
    font-size: 0.75rem;
    height: auto;
    min-height: 0;
    min-width: 44px;
    padding: 7px 9px;
    width: auto;
  }

  .inventory-submenu-layout {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  .inventory-submenu-panels {
    height: auto;
    overflow: visible;
  }
}

.global-alert-widget {
  align-items: center;
  display: inline-flex;
  position: relative;
}

.alert-bell {
  align-items: center;
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
  border-radius: 0;
  color: #475569;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  gap: 6px;
  height: 42px;
  justify-content: center;
  line-height: 1.2;
  min-width: 42px;
  padding: 0 12px;
  white-space: nowrap;
}

.alert-bell.has-alerts {
  background: #b45309;
  border-color: #92400e;
  color: #ffffff;
}

.alert-bell strong {
  align-items: center;
  background: #ffffff;
  border-radius: 999px;
  color: #92400e;
  display: inline-flex;
  font-size: 10px;
  font-weight: 800;
  justify-content: center;
  line-height: 1;
  min-width: 1.25rem;
  padding: 3px 6px;
}

.alert-dot {
  background: #fbbf24;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.22);
  display: inline-block;
  flex-shrink: 0;
  height: 8px;
  width: 8px;
}

.alert-dot.idle {
  background: #94a3b8;
  box-shadow: none;
}

.global-alert-panel {
  margin-top: 10px;
  max-width: min(380px, calc(100vw - 24px));
  min-width: 300px;
  width: max-content;
}

.shell > .header.app-header--with-shortcuts .crm-header-shortcuts .global-alert-widget {
  order: 1;
}

.shell > .header.app-header--with-shortcuts .alert-bell {
  background: rgba(15, 23, 42, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.38);
  box-shadow: none;
  color: rgba(255, 255, 255, 0.95);
  font-size: 12px;
  font-weight: 700;
  height: 2.35rem;
  min-width: auto;
  padding: 0 10px;
}

.shell > .header.app-header--with-shortcuts .alert-bell:hover {
  background: rgba(15, 23, 42, 0.32);
  color: #fff;
}

.shell > .header.app-header--with-shortcuts .alert-bell.has-alerts {
  background: rgba(180, 83, 9, 0.9);
  border-color: rgba(255, 255, 255, 0.46);
  color: #fff;
}

.shell > .header.app-header--with-shortcuts .alert-bell.has-alerts strong {
  background: rgba(255, 255, 255, 0.95);
  color: #92400e;
}

.shell > .header.app-header--with-shortcuts .alert-bell:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.shell > .header .global-alert-panel {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.14);
  color: #0f172a;
  margin-top: 0;
  overflow: hidden;
  padding: 0;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 500;
}

.shell > .header .global-alert-panel .empty-state {
  color: #64748b;
  font-size: 0.8125rem;
  line-height: 1.45;
  margin: 0;
  padding: 16px 14px 18px;
  text-align: center;
}

.shell > .header .global-alert-panel .follow-up-alert-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 3px solid #f59e0b;
  border-radius: 8px;
  box-shadow: none;
  color: #0f172a;
}

.shell > .header .global-alert-panel .follow-up-alert-card h3 {
  color: #0f172a;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 0 0 4px;
}

.shell > .header .global-alert-panel .follow-up-alert-card .alert-meta {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.35;
  margin: 0 0 4px;
}

.shell > .header .global-alert-panel .follow-up-alert-card .alert-message {
  color: #0f172a;
  font-size: 0.8125rem;
  line-height: 1.45;
  margin: 0 0 10px;
  opacity: 0.92;
}

.shell > .header .global-alert-panel .follow-up-alert-card p:not(.alert-meta):not(.alert-message) {
  color: #64748b;
  font-size: 0.8125rem;
  margin: 0 0 8px;
}

.shell > .header .global-alert-panel .alert-actions {
  gap: 6px;
}

.shell > .header .global-alert-panel .alert-actions .button-link,
.shell > .header .global-alert-panel .alert-actions .table-button {
  color: #1d4ed8;
  font-size: 0.8125rem;
  font-weight: 600;
}

.follow-up-alert-card {
  background: #fffbeb;
  border: 1px solid #fbbf24;
  border-radius: 0;
  padding: 16px;
}

.follow-up-alert-card.compact {
  box-shadow: none;
  padding: 10px 12px;
}

.follow-up-alert-card h3 {
  color: #78350f;
  margin-bottom: 6px;
}

.follow-up-alert-card p {
  color: #92400e;
  margin-bottom: 8px;
}

.alert-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.global-alert-panel-head {
  align-items: center;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 0;
  padding: 10px 12px;
}

.global-alert-panel-title {
  color: #0f172a;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
}

.global-alert-panel-head .alert-mark-all-read {
  flex-shrink: 0;
  font-size: 0.75rem;
  padding: 4px 10px;
}

.global-alert-panel-scroll {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(70vh, 420px);
  overflow-y: auto;
  padding: 8px;
  scrollbar-gutter: stable;
}

@media (prefers-color-scheme: dark) {
  .shell > .header .global-alert-panel {
    background: #1e293b;
    border-color: #475569;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
    color: #e2e8f0;
  }

  .shell > .header .global-alert-panel .empty-state {
    color: #94a3b8;
  }

  .shell > .header .global-alert-panel .follow-up-alert-card {
    background: #1e293b;
    border-color: #475569;
    border-left-color: #f59e0b;
    color: #e2e8f0;
  }

  .shell > .header .global-alert-panel .follow-up-alert-card h3 {
    color: #f8fafc;
  }

  .shell > .header .global-alert-panel .follow-up-alert-card .alert-meta {
    color: #94a3b8;
  }

  .shell > .header .global-alert-panel .follow-up-alert-card .alert-message {
    color: #e2e8f0;
    opacity: 1;
  }

  .shell > .header .global-alert-panel .follow-up-alert-card p:not(.alert-meta):not(.alert-message) {
    color: #fcd34d;
  }

  .shell > .header .global-alert-panel .alert-actions .button-link,
  .shell > .header .global-alert-panel .alert-actions .table-button {
    color: #93c5fd;
  }

  .follow-up-alert-card {
    background: #422006;
    border-color: #d97706;
  }

  .follow-up-alert-card h3 {
    color: #fef3c7;
  }

  .follow-up-alert-card p {
    color: #fcd34d;
  }
}

/* Finance-style workflow: collapsible editor + saved list */
:root {
  --ti-fin-editor-panel-bg: color-mix(in srgb, var(--surface, #ffffff) 78%, var(--accent, #1e3a7a) 22%);
  --ti-fin-editor-panel-border: color-mix(in srgb, var(--border, #c5d4f0) 55%, var(--accent, #1e3a7a) 45%);
  --ti-fin-collapsed-header-bg: color-mix(in srgb, var(--surface, #ffffff) 90%, var(--accent, #1e3a7a) 10%);
  --ti-fin-collapsed-header-border: color-mix(in srgb, var(--border, #c5d4f0) 68%, var(--accent, #1e3a7a) 32%);
  --ti-fin-saved-panel-bg: color-mix(in srgb, var(--surface, #ffffff) 96%, var(--accent, #1e3a7a) 4%);
  --ti-fin-saved-panel-border: color-mix(in srgb, var(--border, #c5d4f0) 82%, var(--accent, #1e3a7a) 18%);
}

.ti-fin-workflow-split > .card.ti-fin-editor-panel,
.ti-fin-workflow-split > [data-ti-fin-saved-panel] {
  border-radius: 0;
}

.ti-fin-editor-panel-head {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  justify-content: space-between;
}

.ti-fin-editor-panel-head > h3 {
  flex: 1 1 12rem;
  font-size: 15px;
  margin: 0;
}

.ti-fin-editor-toolbar {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin: 0;
}

.ti-fin-editor-panel:not(.is-collapsed) .ti-fin-editor-panel-head {
  border-bottom: 1px solid var(--border, #c5d4f0);
  margin: -16px -16px 12px;
  padding: 0 0 10px;
}

.ti-fin-editor-panel.is-collapsed {
  background: var(--ti-fin-collapsed-header-bg);
  border-color: var(--ti-fin-collapsed-header-border);
  border-left: 3px solid var(--accent, #1e3a7a);
  padding: 0;
}

.ti-fin-editor-panel.is-collapsed .ti-fin-editor-panel-head {
  background: var(--ti-fin-collapsed-header-bg);
  padding: 10px 14px;
}

.ti-fin-editor-panel.is-collapsed > *:not(.ti-fin-editor-panel-head) {
  display: none;
}

.ti-fin-editor-panel:not(.is-collapsed) {
  background: var(--ti-fin-editor-panel-bg);
  border-color: var(--ti-fin-editor-panel-border);
}

.ti-fin-editor-toggle-bridge {
  align-items: center;
  display: flex;
  flex-shrink: 0;
  height: 0;
  justify-content: center;
  line-height: 0;
  margin: 0;
  overflow: visible;
  padding: 0;
  position: relative;
  z-index: 2;
}

.ti-fin-editor-toggle-bridge [data-ti-fin-form-toggle] {
  align-items: center;
  background: var(--surface, #ffffff);
  border: 1px solid color-mix(in srgb, var(--border, #c5d4f0) 70%, var(--accent, #1e3a7a) 30%);
  color: var(--ti-text, #020617);
  display: inline-flex;
  gap: 0.35em;
  min-width: 9.5rem;
  position: relative;
  transform: translateY(-50%);
  z-index: 1;
}

.ti-fin-editor-toggle-bridge [data-ti-fin-form-toggle]:hover {
  background: color-mix(in srgb, var(--surface, #ffffff) 90%, var(--accent, #1e3a7a) 10%);
  color: var(--ti-heading, #020617);
}

.ti-fin-form-toggle-arrow {
  font-size: 1.1em;
  line-height: 1;
}

.ti-fin-editor-panel.is-collapsed + .ti-fin-editor-toggle-bridge [data-ti-fin-form-toggle].ti-fin-form-toggle-show,
.ti-fin-editor-toggle-bridge [data-ti-fin-form-toggle].ti-fin-form-toggle-show {
  border-color: color-mix(in srgb, var(--accent, #1e3a7a) 55%, var(--border, #c5d4f0));
  color: var(--accent, #1e3a7a);
  display: inline-flex;
  font-weight: 600;
}

.ti-fin-editor-panel.is-collapsed + .ti-fin-editor-toggle-bridge + [data-ti-fin-saved-panel] > .inventory-module-list-title,
.ti-fin-editor-panel.is-collapsed + .ti-fin-editor-toggle-bridge + [data-ti-fin-saved-panel] > h3.erp-crm-contacts-list-title,
.ti-fin-editor-panel.is-collapsed + .ti-fin-editor-toggle-bridge + [data-ti-fin-saved-panel] > h3.inventory-module-list-title,
[data-ti-fin-saved-panel] > .inventory-module-layout + * {
  margin-top: 1.1rem;
}

[data-ti-fin-saved-panel] {
  background: var(--ti-fin-saved-panel-bg);
  border-color: var(--ti-fin-saved-panel-border);
}

.ti-fin-workflow-split > [data-ti-fin-saved-panel] {
  flex: 1 1 auto;
  min-height: 0;
}

.inventory-submenu-section--split.ti-fin-workflow-split > .muted:first-of-type {
  margin-bottom: 0;
}

.ti-msl-table .ti-msl-num {
  text-align: right;
  white-space: nowrap;
}

.ti-msl-below-min {
  background: color-mix(in srgb, #fef2f2 85%, var(--surface, #fff) 15%);
}

.ti-msl-diff-negative {
  color: #b91c1c;
  font-weight: 600;
}

.ti-msl-min-input {
  width: 100%;
  max-width: 8rem;
  box-sizing: border-box;
}
