* {
  box-sizing: border-box;
}

:root {
  color-scheme: light dark;
  --tensor-banner-from: #0f172a;
  --tensor-banner-to: #475569;
  --tensor-banner-shadow: rgba(15, 23, 42, 0.28);
}

.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;
}

.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;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f1f5f9;
  color: #0f172a;
}

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

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

.login-logo-wrap {
  display: flex;
  justify-content: center;
  margin: 0 0 12px;
}

.login-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 16px;
}

#loginButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 18px;
  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: #1e3a5f;
  color: #ffffff;
  border: 1px solid #1e3a5f;
  border-radius: 0;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
}

button:hover {
  background: #0f172a;
}

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

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

.shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
}

.production-app-shell {
  align-items: stretch;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr);
}

.production-app-shell > .header,
.production-app-shell > .footer {
  grid-column: 1 / -1;
}

.production-shell-main {
  min-width: 0;
  width: 100%;
}

@media (min-width: 769px) {
  .production-app-shell {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .production-app-shell > .production-app-sidebar {
    align-self: stretch;
    grid-column: 1;
    grid-row: 2;
    position: static;
    top: auto;
    z-index: 50;
  }

  .production-app-shell > .production-shell-main {
    grid-column: 2;
    grid-row: 2;
    position: relative;
    z-index: 1;
  }
}

.header {
  align-items: center;
  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;
  margin-bottom: 12px;
  min-height: 0;
  padding: 12px 16px;
}

.header h1 {
  font-size: clamp(20px, 2.2vw, 24px);
  line-height: 1.2;
  margin: 0;
}

.subtitle {
  color: #64748b;
  font-size: 12px;
  line-height: 1.3;
  margin: 0;
}

.shell > .header .subtitle {
  color: rgba(255, 255, 255, 0.88);
}

.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%;
}

.production-app-sidebar {
  background: #ffffff;
  border: 1px solid #dbe4f1;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
  overflow: visible;
  padding: 10px;
  position: relative;
  z-index: 40;
}

.production-sidebar-inner,
.production-sidebar-group,
.production-sidebar-submenu {
  overflow: visible;
}

.production-sidebar-toggle {
  align-items: center;
  background: #ffffff;
  border: 1px solid #dbe4f1;
  border-radius: 0;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  height: 42px;
  justify-content: center;
  padding: 0;
  width: 46px;
}

.production-sidebar-toggle span {
  background: #1e3a5f;
  border-radius: 0;
  display: block;
  height: 2px;
  width: 20px;
}

.production-sidebar-inner {
  display: none;
  flex-direction: column;
  gap: 4px;
}

.production-app-sidebar.is-open .production-sidebar-inner {
  display: flex;
}

.production-sidebar-link,
.production-sidebar-sublink {
  align-items: center;
  border-radius: 0;
  color: #334155;
  display: flex;
  font-size: 13px;
  font-weight: 600;
  gap: 10px;
  line-height: 1.25;
  padding: 10px 12px;
  text-decoration: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

.production-sidebar-link::before {
  background: currentColor;
  content: "";
  flex: 0 0 22px;
  height: 22px;
  mask: var(--production-sidebar-icon) center / contain no-repeat;
  width: 22px;
  -webkit-mask: var(--production-sidebar-icon) center / contain no-repeat;
}

.production-sidebar-link[data-icon="dashboard"] {
  --production-sidebar-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M4 13h7V4H4v9Zm0 7h7v-5H4v5Zm9 0h7v-9h-7v9Zm0-16v5h7V4h-7Z'/%3E%3C/svg%3E");
}

.production-sidebar-link[data-icon="customers"] {
  --production-sidebar-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M16 11a4 4 0 1 0-3.999-4A4 4 0 0 0 16 11ZM8 12a3 3 0 1 0-2.999-3A3 3 0 0 0 8 12Zm8 2c-2.97 0-8 1.49-8 4.46V21h16v-2.54C24 15.49 18.97 14 16 14Zm-8 0c-.38 0-.82.03-1.3.08C4.58 14.34 1 15.4 1 17.54V21h5v-2.54c0-1.35.78-2.5 2-3.3Z'/%3E%3C/svg%3E");
}

.production-sidebar-link[data-icon="my-production-plan"] {
  --production-sidebar-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M9 5H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-2M9 3h6v4H9V3Zm0 8h6v2H9v-2Zm0 4h6v2H9v-2Z'/%3E%3C/svg%3E");
}

.production-sidebar-link[data-icon="planning"] {
  --production-sidebar-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M5 3h10l4 4v14H5V3Zm9 1.5V8h3.5L14 4.5ZM8 11h8v2H8v-2Zm0 4h8v2H8v-2Z'/%3E%3C/svg%3E");
}

.production-sidebar-link[data-icon="human-resource"] {
  --production-sidebar-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8Zm-7 9a7 7 0 0 1 14 0H5Z'/%3E%3C/svg%3E");
}

.production-sidebar-link[data-icon="products"] {
  --production-sidebar-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M4 8h16v12H4V8Zm2-4h12l2 4H4l2-4Z'/%3E%3C/svg%3E");
}

.production-sidebar-link[data-icon="stocks"] {
  --production-sidebar-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M4 6h16v14H4V6Zm2-3h12l2 4H4l2-4Zm4 9h2v4H8v-4Zm4 0h2v4h-2v-4Z'/%3E%3C/svg%3E");
}

.production-sidebar-link[data-icon="warehouse"] {
  --production-sidebar-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M3 10.5 12 4l9 6.5V20a1 1 0 0 1-1 1h-5v-6H9v6H4a1 1 0 0 1-1-1v-9.5Z'/%3E%3C/svg%3E");
}

.production-sidebar-link[data-icon="procurement"] {
  --production-sidebar-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M7 4h10l1 3H6l1-3Zm-2 5h14l-1 11H6L5 9Zm4 2v2h2v-2H9Zm4 0v2h2v-2h-2Z'/%3E%3C/svg%3E");
}

.production-sidebar-link[data-icon="accounting"] {
  --production-sidebar-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M4 5h16v14H4V5Zm2 2v2h12V7H6Zm0 4v2h4v-2H6Zm6 0v2h4v-2h-4Z'/%3E%3C/svg%3E");
}

.production-sidebar-link[data-icon="manufacturing-orders"] {
  --production-sidebar-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M5 3h10l4 4v14H5V3Zm9 1.5V8h3.5L14 4.5ZM8 11h8v2H8v-2Zm0 4h8v2H8v-2Z'/%3E%3C/svg%3E");
}

.production-sidebar-link[data-icon="production-schedule"] {
  --production-sidebar-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M7 2h2v3h6V2h2v3h3v16H4V5h3V2Zm-1 8v9h12v-9H6Zm2 2h3v3H8v-3Z'/%3E%3C/svg%3E");
}

.production-sidebar-link[data-icon="mps"] {
  --production-sidebar-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M4 19h16v2H4v-2Zm1-2h3V9H5v8Zm5 0h3V4h-3v13Zm5 0h3v-6h-3v6Z'/%3E%3C/svg%3E");
}

.production-sidebar-link[data-icon="workstations"] {
  --production-sidebar-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M3 5h18v10H3V5Zm2 2v6h14V7H5Zm2 10h10v2H7v-2Zm3-2h4v2h-4v-2Z'/%3E%3C/svg%3E");
}

.production-sidebar-link[data-icon="workstation-groups"] {
  --production-sidebar-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M4 4h7v7H4V4Zm9 0h7v7h-7V4ZM4 13h7v7H4v-7Zm9 0h7v7h-7v-7Z'/%3E%3C/svg%3E");
}

.production-sidebar-link[data-icon="bom"] {
  --production-sidebar-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M12 2 3 7v10l9 5 9-5V7l-9-5Zm0 2.3L17.8 8 12 11.2 6.2 8 12 4.3ZM5 9.7l6 3.4v6.2l-6-3.4V9.7Zm14 0v6.2l-6 3.4v-6.2l6-3.4Z'/%3E%3C/svg%3E");
}

.production-sidebar-link[data-icon="routings"] {
  --production-sidebar-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M6 4a3 3 0 1 0 0 6h4v4H8a3 3 0 1 0 0 2h6a4 4 0 0 0 0-8h-4V6h6a3 3 0 1 0 0-2H6Z'/%3E%3C/svg%3E");
}

.production-sidebar-link:hover,
.production-sidebar-sublink:hover {
  background: linear-gradient(180deg, #f8fbff 0%, #eef4fb 100%);
  box-shadow: inset 0 0 0 1px rgba(30, 58, 95, 0.08);
  transform: translateY(-1px);
}

.production-sidebar-link.active,
.production-sidebar-sublink.active {
  background: linear-gradient(180deg, #274a75 0%, #1e3a5f 100%);
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(30, 58, 95, 0.26), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.production-sidebar-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.production-sidebar-group.is-open .production-sidebar-submenu {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.production-sidebar-submenu {
  display: none;
}

.production-sidebar-group.is-active .production-sidebar-group-head {
  background: #e8eef7;
  color: #1e3a5f;
}

/* Production planning items sit one level below main sidebar entries */
.production-sidebar-planning-block {
  align-items: center;
  background: linear-gradient(165deg, #e8f1fc 0%, #d2e0f4 52%, #c5d6ef 100%);
  border: 1px solid #b3c5e3;
  border-radius: 0;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 2px 8px rgba(30, 58, 95, 0.08);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 4px;
  width: 100%;
}

.production-sidebar-planning-link {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(30, 58, 95, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.production-sidebar-planning-link:hover,
.production-sidebar-planning-link:focus-visible {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(30, 58, 95, 0.16);
}

.production-sidebar-planning-link.active {
  background: linear-gradient(180deg, #2d5280 0%, #1e3a5f 100%);
  border-color: #163352;
  box-shadow: 0 4px 12px rgba(30, 58, 95, 0.22);
  color: #ffffff;
}

.production-sidebar-planning-divider {
  background: transparent;
  display: block;
  height: 10px;
  margin: 2px 0;
  width: 32px;
}

.production-sidebar--planning-hidden .production-sidebar-planning-block,
.production-sidebar--planning-hidden .production-sidebar-planning-divider {
  display: none;
}

.production-mpp-toolbar {
  margin: 12px 0 8px;
  flex-wrap: wrap;
  gap: 8px;
}

.production-mpp-schedule-panel {
  margin: 12px 0 20px;
  padding: 12px 0 0;
  border-top: 1px solid #d8e2f0;
}

.production-mpp-form-card {
  margin-bottom: 16px;
}

.production-mpp-form-hint {
  margin: 0 12px 12px;
}

.production-mpp-form-panel {
  border: 1px solid #dbe4f1;
  border-radius: 0;
  margin: 0 12px 8px;
  overflow: hidden;
}

.production-mpp-form-panel__head {
  align-items: center;
  background: #f8fafc;
  border-bottom: 1px solid #dbe4f1;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 10px 12px;
}

.production-mpp-form-panel__title {
  font-size: 0.9375rem;
  margin: 0;
}

.production-mpp-form-panel__body .production-cloud-form {
  border: none;
  border-radius: 0;
  margin: 0;
}

.production-mpp-form-panel--collapsed .production-mpp-form-panel__body {
  display: none;
}

.production-mpp-form-panel--collapsed .production-mpp-form-panel__head {
  border-bottom: none;
}

.production-mpp-list-title {
  margin-top: 8px;
}

.production-mpp-list-toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-bottom: 10px;
}

.production-mpp-search-label {
  flex: 1 1 220px;
  margin: 0;
  max-width: 420px;
}

.production-mpp-search {
  border: 1px solid #dbe4f1;
  border-radius: 0;
  font: inherit;
  padding: 8px 12px;
  width: 100%;
}

.production-mpp-list-count {
  font-size: 12px;
  margin: 0;
}

.production-mpp-list-scroll {
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
}

.production-mpp-list-scroll table {
  min-width: 960px;
}

.production-mpp-done-card {
  margin-top: 16px;
  border-color: #bbf7d0;
}

.production-mpp-done-card h2 {
  color: #166534;
}

.production-mpp-revert-btn {
  font-size: 11px;
  padding: 4px 10px;
}

.production-mpp-report-dialog {
  border: 1px solid #b3c5e3;
  border-radius: 0;
  padding: 0;
  max-width: 480px;
  width: calc(100% - 32px);
  box-shadow: 0 12px 40px rgba(30, 58, 95, 0.18);
}

.production-mpp-report-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.production-mpp-report-form {
  padding: 20px;
}

.production-mpp-report-form h3 {
  margin: 0 0 8px;
}

.production-mpp-report-mode-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
}

.production-mpp-report-mode-label {
  color: #475569;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.production-mpp-report-mode {
  display: inline-flex;
  flex: 1 1 auto;
  gap: 0;
  min-width: 0;
}

.production-mpp-report-mode-option {
  cursor: pointer;
  font-size: 12px;
  margin: 0;
  position: relative;
}

.production-mpp-report-mode-option input {
  height: 1px;
  margin: 0;
  opacity: 0;
  position: absolute;
  width: 1px;
}

.production-mpp-report-mode-option span {
  border: 1px solid #dbe4f1;
  display: block;
  line-height: 1.2;
  padding: 6px 12px;
  white-space: nowrap;
}

.production-mpp-report-mode-option:first-of-type span {
  border-radius: 0;
}

.production-mpp-report-mode-option:last-of-type span {
  border-radius: 0;
  margin-left: -1px;
}

.production-mpp-report-mode-option input:checked + span {
  background: #1e3a5f;
  border-color: #1e3a5f;
  color: #fff;
  font-weight: 600;
  z-index: 1;
}

.production-mpp-report-mode-option input:focus-visible + span {
  outline: 2px solid #64748b;
  outline-offset: 1px;
}

.production-mpp-report-qty-hint {
  font-size: 11px;
  line-height: 1.35;
  margin: -4px 0 10px;
}

.production-planning-hub {
  margin-top: 4px;
}

.production-planning-hub-card {
  color: inherit;
  display: block;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.production-planning-hub-card:hover {
  border-color: #1e3a5f;
  box-shadow: 0 8px 20px rgba(30, 58, 95, 0.12);
}

.production-planning-hub-card strong {
  display: block;
  font-size: 15px;
  margin-bottom: 6px;
}

@media (min-width: 769px) {
  .production-app-sidebar {
    align-items: center;
    margin-bottom: 0;
    padding: 8px 6px;
  }

  .production-sidebar-toggle {
    display: none;
  }

  .production-sidebar-inner {
    align-items: center;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 32px);
    overflow-x: visible;
    overflow-y: auto;
    width: 100%;
  }

  .production-sidebar-group {
    align-items: center;
    width: 100%;
  }

  .production-sidebar-link,
  .production-sidebar-sublink {
    font-size: 0;
    gap: 0;
    height: 48px;
    justify-content: center;
    padding: 0;
    position: relative;
    width: 48px;
    border-radius: 0;
  }

  .production-sidebar-link:hover,
  .production-sidebar-link:focus-visible,
  .production-sidebar-sublink:hover,
  .production-sidebar-sublink:focus-visible {
    z-index: 120;
  }

  .production-sidebar-link::after,
  .production-sidebar-sublink::after {
    background: #0f172a;
    border-radius: 0;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.22);
    color: #ffffff;
    content: attr(aria-label);
    font-size: 0.7175rem;
    font-weight: 800;
    left: calc(100% + 10px);
    line-height: 1;
    opacity: 0;
    padding: 9px 10px;
    pointer-events: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%) translateX(-4px);
    transition: opacity 0.16s ease, transform 0.16s ease;
    white-space: nowrap;
    z-index: 130;
  }

  .production-sidebar-link.active::before,
  .production-sidebar-sublink.active::before {
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.42));
  }

  .production-sidebar-link:hover::after,
  .production-sidebar-link:focus-visible::after,
  .production-sidebar-sublink:hover::after,
  .production-sidebar-sublink:focus-visible::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }

  .production-sidebar-submenu {
    align-items: center;
    display: none;
    width: 100%;
  }

  .production-sidebar-group.is-open .production-sidebar-submenu {
    display: flex;
  }
}

@media (max-width: 768px) {
  .production-app-sidebar.is-open .production-sidebar-inner {
    align-items: stretch;
  }

  .production-app-sidebar.is-open .production-sidebar-link,
  .production-app-sidebar.is-open .production-sidebar-sublink {
    font-size: 0;
    gap: 0;
    height: 48px;
    justify-content: center;
    padding: 0;
    position: relative;
    width: 48px;
  }

  .production-app-sidebar.is-open .production-sidebar-link:hover,
  .production-app-sidebar.is-open .production-sidebar-link:focus-visible,
  .production-app-sidebar.is-open .production-sidebar-sublink:hover,
  .production-app-sidebar.is-open .production-sidebar-sublink:focus-visible {
    z-index: 120;
  }

  .production-app-sidebar.is-open .production-sidebar-sublink {
    margin-left: 8px;
  }

  .production-app-sidebar.is-open .production-sidebar-link::after,
  .production-app-sidebar.is-open .production-sidebar-sublink::after {
    background: #0f172a;
    border-radius: 0;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.22);
    color: #ffffff;
    content: attr(aria-label);
    font-size: 0.7175rem;
    font-weight: 800;
    left: calc(100% + 10px);
    line-height: 1;
    opacity: 0;
    padding: 9px 10px;
    pointer-events: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%) translateX(-4px);
    transition: opacity 0.16s ease, transform 0.16s ease;
    white-space: nowrap;
    z-index: 130;
  }

  .production-app-sidebar.is-open .production-sidebar-link:hover::after,
  .production-app-sidebar.is-open .production-sidebar-link:focus-visible::after,
  .production-app-sidebar.is-open .production-sidebar-sublink:hover::after,
  .production-app-sidebar.is-open .production-sidebar-sublink:focus-visible::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }
}

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

.card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0;
  padding: 16px;
}

.kpi-label {
  display: block;
  color: #64748b;
  font-size: 12px;
}

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

.kpi-note {
  margin: 0;
  color: #475569;
  font-size: 12px;
}

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

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

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

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

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

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

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

.production-chart-subtitle {
  color: #64748b;
  display: block;
  font-size: 12px;
  line-height: 1.3;
  margin: 4px 0 0;
}

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

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

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

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

.production-bar-meta strong {
  color: #0f172a;
  flex-shrink: 0;
}

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

.production-bar-track span {
  background: linear-gradient(90deg, #0f172a, #475569, #f59e0b);
  border-radius: inherit;
  display: block;
  height: 100%;
  min-width: 8px;
}

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

.production-donut {
  align-items: center;
  aspect-ratio: 1;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

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

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

.production-donut strong {
  color: #0f172a;
  font-size: 23px;
}

.production-donut span {
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.production-donut-legend {
  display: grid;
  font-size: 12px;
  gap: 8px;
}

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

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

.production-pipeline-bar {
  border-radius: 0;
  display: flex;
  height: 18px;
  overflow: hidden;
  width: 100%;
}

.production-pipeline-bar span {
  display: block;
  height: 100%;
  min-width: 4px;
  transition: width 0.2s ease;
}

.production-pipeline-legend {
  display: flex;
  flex-wrap: wrap;
  font-size: 11px;
  gap: 8px 14px;
  margin-top: 12px;
}

.production-pipeline-legend span {
  align-items: center;
  color: #475569;
  display: inline-flex;
  gap: 6px;
}

.production-pipeline-legend i {
  border-radius: 0;
  display: inline-block;
  height: 10px;
  width: 10px;
}

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

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

  .production-donut-card .production-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 #e2e8f0;
  padding: 10px 8px;
  font-size: 13px;
}

th {
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

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

.visually-hidden {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.production-stk-form-panel {
  border: 1px solid #dbe4f1;
  border-radius: 0;
  margin: 0 0 16px;
  overflow: hidden;
}

.production-stk-form-panel__head {
  align-items: center;
  background: #f8fafc;
  border-bottom: 1px solid #dbe4f1;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 10px 12px;
}

.production-stk-form-panel__title {
  font-size: 0.9375rem;
  margin: 0;
}

.production-stk-form-panel__body .production-cloud-form {
  border: none;
  border-radius: 0;
  margin: 0;
}

.production-stk-form-panel--collapsed .production-stk-form-panel__body {
  display: none;
}

.production-stk-form-panel--collapsed .production-stk-form-panel__head {
  border-bottom: none;
}

.production-stk-list-panel {
  margin-top: 4px;
}

.production-stk-list-title {
  font-size: 0.9875rem;
  margin: 0 0 8px;
}

.production-stk-list-toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-bottom: 10px;
}

.production-stk-search-label {
  flex: 1 1 220px;
  margin: 0;
  max-width: 420px;
}

.production-stk-search {
  border: 1px solid #dbe4f1;
  border-radius: 0;
  font: inherit;
  padding: 8px 12px;
  width: 100%;
}

.production-stk-list-count {
  font-size: 12px;
  margin: 0;
}

.production-stk-list-scroll {
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
}

.production-stk-list-scroll table {
  min-width: 1080px;
  width: max-content;
}

.production-stk-source {
  border-radius: 0;
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 2px 8px;
  text-transform: uppercase;
  white-space: nowrap;
}

.production-stk-source--stock {
  background: #e0f2fe;
  color: #0c4a6e;
}

.production-stk-source--product {
  background: #fef3c7;
  color: #92400e;
}

.production-stk-source--group {
  background: #ede9fe;
  color: #5b21b6;
}

.production-stk-row--group td,
.production-stk-row--product td {
  vertical-align: top;
}

.production-stk-list-scroll th,
.production-stk-list-scroll td {
  white-space: nowrap;
}

.production-stk-lots-list-panel {
  margin-top: 4px;
}

.production-stk-lots-list-panel .production-stk-list-title {
  margin: 0 0 8px;
}

.production-stk-lots-list-scroll table {
  min-width: 1120px;
}

.production-co-stock-actions {
  margin-top: 10px;
}

.production-bom-routing-hint,
.production-routing-bom-hint {
  margin: 0;
}

.production-weekday-hours {
  border: 1px solid #dbe4f1;
  border-radius: 0;
  margin: 12px 0;
  padding: 12px;
}

.production-weekday-hours-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.production-weekday-row {
  border: 1px solid #e8eef5;
  border-radius: 0;
  display: grid;
  gap: 8px;
  grid-template-columns: 88px repeat(4, minmax(0, 1fr));
  padding: 8px;
}

.production-weekday-label {
  align-self: center;
  font-size: 12px;
}

.production-schedule-range {
  border: 1px solid #dbe4f1;
  border-radius: 0;
  margin: 12px 0;
  padding: 12px;
}

@media (max-width: 900px) {
  .production-weekday-row {
    grid-template-columns: 1fr 1fr;
  }

  .production-weekday-label {
    grid-column: 1 / -1;
  }
}

.production-bom-add-parts {
  border: 1px solid #dbe4f1;
  border-radius: 0;
  margin: 12px 0;
  padding: 12px;
}

.production-bom-add-parts-title {
  font-size: 0.9875rem;
  margin: 0 0 10px;
}

.production-bom-add-parts-grid {
  margin-bottom: 8px;
}

.production-bom-parts-table {
  margin: 12px 0;
}

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

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

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

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

.production-form-grid input,
.production-form-grid select,
.production-form-grid textarea {
  border: 1px solid #dbe4f1;
  border-radius: 0;
  font: inherit;
  padding: 8px 10px;
}

.production-field-inline {
  display: flex;
  gap: 6px;
  align-items: stretch;
}

.production-field-inline select {
  flex: 1;
  min-width: 0;
}

.production-inline-add-btn {
  flex: 0 0 auto;
  min-width: 40px;
  padding: 8px 12px;
  font-size: 15px;
  line-height: 1;
}

.production-checkbox-label {
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
  font-weight: 600;
}

.production-checkbox-label input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.muted {
  color: #64748b;
  font-size: 12px;
  margin: 0 0 12px;
}

.production-data-legend {
  margin-top: -4px;
}

.production-catalog-bar {
  background: #ffffff;
  border: 1px solid #dbe4f1;
  border-radius: 0;
  box-shadow: 0 4px 14px rgba(93, 131, 217, 0.08);
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 4px;
  padding: 10px 12px;
}

.production-catalog-bar a {
  background: #f8fafc;
  border: 1px solid #dbe4f1;
  border-radius: 0;
  color: #172554;
  flex: 1 1 130px;
  font-size: 13px;
  font-weight: 700;
  padding: 12px 16px;
  text-align: center;
  text-decoration: none;
}

.production-catalog-bar a:hover,
.production-catalog-bar a.active {
  background: #1e3a5f;
  border-color: #1e3a5f;
  color: #ffffff;
}

.production-field-readonly {
  background: #f1f5f9;
  color: #475569;
  cursor: not-allowed;
}

.production-mo-catalog-hint {
  margin: 0 0 12px;
}

.production-product-groups {
  margin-top: 14px;
}

.production-product-groups-list-title {
  font-size: 16px;
  margin: 18px 0 10px;
}

.production-product-group-picker-fieldset {
  border: 1px solid #dbe4f1;
  border-radius: 0;
  margin: 12px 0;
  padding: 12px 14px 14px;
}

.production-product-group-picker-fieldset legend {
  font-size: 12px;
  font-weight: 700;
  padding: 0 6px;
}

.production-product-group-picker {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  max-height: 240px;
  overflow-y: auto;
}

.production-product-picker-item {
  align-items: flex-start;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0;
  cursor: pointer;
  display: flex;
  font-size: 12px;
  gap: 8px;
  padding: 8px 10px;
}

.production-product-picker-qty {
  margin-left: auto;
}

.production-product-picker-qty input {
  width: 84px;
  padding: 6px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 0;
  font: inherit;
}

.production-product-picker-item input {
  margin-top: 2px;
}

button.secondary-button {
  background: #ffffff;
  border: 1px solid #1e3a5f;
  color: #1e3a5f;
}

button.secondary-button:hover {
  background: #eff6ff;
}

.production-page-layout {
  align-items: stretch;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(170px, 220px) minmax(0, 1fr);
}

.production-page-submenu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  position: static;
  top: auto;
}

.production-page-submenu a {
  background: #ffffff;
  border: 1px solid #dbe4f1;
  border-radius: 0;
  color: #172554;
  display: block;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  padding: 9px 11px;
  text-decoration: none;
}

.production-page-submenu a:hover,
.production-page-submenu a.active {
  background: #1e3a5f;
  border-color: #1e3a5f;
  color: #ffffff;
}

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

.production-submenu-section--hidden {
  display: none;
}

/* Workflow-split sections use display:flex; hidden must win over that rule. */
.production-submenu-section.production-submenu-section--hidden,
.finance-submenu-section.tf-fin-workflow-split.production-submenu-section--hidden {
  display: none !important;
}

.production-page-panels > .production-submenu-section.production-submenu-section--active {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.production-submenu-section.production-submenu-section--active.finance-submenu-section.tf-fin-workflow-split {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.production-gantt-toolbar {
  align-items: flex-end;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 12px;
}

.production-gantt-toolbar-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.production-gantt-toolbar-label {
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.production-gantt-toolbar-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.production-gantt-range-inputs {
  align-items: flex-end;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.production-gantt-range-inputs label {
  display: flex;
  flex-direction: column;
  font-size: 11px;
  gap: 4px;
}

.production-gantt-range-inputs input[type="date"] {
  min-width: 10.5rem;
}

.production-gantt-scale-btn.active,
.production-gantt-view-btn.active {
  background: #1e3a5f;
  border-color: #1e3a5f;
  color: #ffffff;
}

.production-gantt-legend {
  margin-bottom: 10px;
}

.production-gantt-wrap {
  margin-top: 4px;
  overflow-x: auto;
}

.production-gantt-wrap--hourly .production-gantt-table th,
.production-gantt-wrap--hourly .production-gantt-table td {
  min-width: 72px;
}

.production-gantt-wrap--daily .production-gantt-table th,
.production-gantt-wrap--daily .production-gantt-table td {
  min-width: 88px;
}

.production-gantt-wrap--monthly .production-gantt-table th,
.production-gantt-wrap--monthly .production-gantt-table td {
  min-width: 96px;
}

.production-calendar {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0;
  padding: 12px;
}

.production-calendar-month {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 10px;
}

.production-calendar-grid {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.production-calendar-weekday {
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.production-calendar-cell {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0;
  min-height: 88px;
  padding: 6px;
}

.production-calendar-cell--empty {
  background: #f1f5f9;
  border-style: dashed;
}

.production-calendar-day {
  color: #0f172a;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
}

.production-calendar-events {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.production-calendar-event {
  background: linear-gradient(90deg, #1e3a5f, #64748b);
  border-radius: 0;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  overflow: hidden;
  padding: 3px 6px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.production-calendar-event--interactive,
.production-gantt-bar--interactive {
  cursor: pointer;
}

.production-gantt-bar--draggable {
  cursor: grab;
  touch-action: none;
}

.production-gantt-bar--dragging {
  cursor: grabbing;
  opacity: 0.92;
  z-index: 4;
}

.production-gantt-bar--saving {
  opacity: 0.65;
  pointer-events: none;
}

.production-gantt-mount--dragging {
  user-select: none;
}

.production-gantt-schedule-message {
  margin: 0 0 10px;
}

.production-gantt-schedule-message--error {
  color: #b91c1c;
}

.production-calendar-event--interactive:hover,
.production-calendar-event--interactive:focus-visible,
.production-gantt-bar--interactive:hover,
.production-gantt-bar--interactive:focus-visible {
  filter: brightness(1.1);
  outline: 2px solid rgba(255, 255, 255, 0.65);
  outline-offset: 1px;
}

.production-gantt-bar--draggable:hover,
.production-gantt-bar--draggable:focus-visible {
  box-shadow: 0 0 0 2px rgba(30, 58, 95, 0.35);
}

.production-mo-item-list-title,
.production-mo-detail-table-title {
  font-size: 0.9875rem;
  margin: 20px 0 6px;
}

.production-mo-item-list-wrap {
  margin-bottom: 8px;
}

.production-po-cart-btn {
  align-items: center;
  background: #ffffff;
  border: 1px solid #b8cae6;
  border-radius: 0;
  color: #1e3a5f;
  cursor: pointer;
  display: inline-flex;
  height: 30px;
  justify-content: center;
  margin-right: 6px;
  padding: 0;
  vertical-align: middle;
  width: 30px;
}

.production-po-cart-btn:hover,
.production-po-cart-btn:focus-visible {
  background: #e8f1fc;
  border-color: #1e3a5f;
  outline: none;
}

.production-po-cart-col {
  text-align: center;
  width: 44px;
}

.production-po-cart-col .production-po-cart-icon {
  display: block;
  margin: 0 auto;
  opacity: 0.85;
}

.production-table-actions {
  white-space: nowrap;
}

.visually-hidden {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.production-gantt-mpp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 11rem;
}

.production-gantt-mpp-btn {
  font-size: 11px;
  padding: 4px 8px;
}

.production-gantt-mpp-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.production-mpp-list-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 14rem;
}

.production-mpp-finish-btn {
  font-size: 11px;
  padding: 4px 10px;
}

.production-mpp-finish-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.production-calendar-mpp-actions {
  margin-top: 4px;
}

.production-gantt-table .production-gantt-track {
  min-width: 320px;
  padding: 0;
  position: relative;
  height: 42px;
  vertical-align: middle;
}

.production-gantt-bar {
  background: linear-gradient(90deg, #1e3a5f, #64748b);
  border-radius: 0;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  height: 28px;
  line-height: 28px;
  overflow: hidden;
  padding: 0 8px;
  position: absolute;
  text-overflow: ellipsis;
  top: 7px;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .production-page-layout {
    grid-template-columns: 1fr;
  }

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

  .production-page-submenu a {
    flex: 1 1 auto;
  }
}

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

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

.footer {
  margin-top: 16px;
  color: #64748b;
  font-size: 12px;
}

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

.hidden {
  display: none !important;
}

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

.shell > .header.app-header--with-shortcuts .crm-header-shortcuts {
  align-items: center;
  display: inline-flex;
  flex-shrink: 0;
  flex-wrap: nowrap;
  gap: 6px;
  justify-content: flex-end;
  max-width: min(100%, 520px);
}

.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 {
  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: 1 1 auto;
  font-size: 11px;
  font-weight: 700;
  margin: 0;
  max-width: min(280px, 36vw);
  min-width: 0;
  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 {
  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-image: url("tensorERP-logo-removebg-preview.png?v=td22");
  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:hover {
  background-color: rgba(255, 255, 255, 0.28);
}

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

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

.shell > .header .production-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: 40px;
  max-width: 120px;
  object-fit: contain;
  padding: 4px;
  width: auto;
}

.shell > .header .production-banner-titles {
  align-items: baseline;
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 2px 10px;
  min-width: 0;
}

.shell > .header .production-banner-titles .subtitle {
  flex: 1 1 12rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  width: 46px;
  height: 42px;
  padding: 0;
  border-radius: 0;
  border: 1px solid #dbe4f1;
  background: #ffffff;
  cursor: pointer;
}

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

@media (max-width: 768px) {
  .shell {
    padding: 12px;
  }

  .production-app-sidebar.is-open {
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
  }

  .shell > .header.app-header--with-shortcuts {
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
  }

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

  .shell > .header .production-banner-brand-row {
    flex-wrap: nowrap;
  }

  .shell > .header .production-banner-titles {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .shell > .header .production-banner-titles .subtitle {
    flex: 1 1 auto;
    max-width: 100%;
    white-space: nowrap;
  }

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

  .shell > .header.app-header--with-shortcuts .tensor-banner-session {
    display: none;
  }
}

@media (max-width: 640px) {
  .shell > .header {
    padding: 10px 12px;
  }

  .shell > .header .app-header-brand,
  .shell > .header .production-banner-brand-row,
  .shell > .header .production-banner-titles,
  .shell > .header h1,
  .shell > .header .subtitle,
  .shell > .header p {
    min-width: 0;
  }

  .shell > .header .production-banner-titles .subtitle {
    display: none;
  }

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

  .shell > .header.app-header--with-shortcuts .tensor-banner-logout {
    max-width: none;
    padding: 6px 10px;
    white-space: nowrap;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --erp-bg: #0B1120;
    --erp-sidebar: #111827;
    --erp-surface: #1F2937;
    --erp-border: #374151;
    --erp-text: #E5E7EB;
    --erp-muted: #9CA3AF;
    --module-primary: #334155;
    --module-hover: #475569;
    --module-soft: rgba(51, 65, 85, 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;
  }

  .subtitle,
  .footer,
  .kpi-label,
  .muted,
  .production-gantt-toolbar-label,
  .production-stk-list-count {
    color: var(--erp-muted) !important;
  }

  h1,
  h2,
  h3,
  .kpi-value,
  .kpi-note,
  td,
  .production-form-grid label,
  .production-stk-list-title,
  .production-product-groups-list-title,
  .production-mo-item-list-title,
  .production-mo-detail-table-title,
  .production-co-estimate-panel h3,
  .production-co-stock-panel h3 {
    color: var(--erp-text) !important;
  }

  th {
    color: var(--erp-muted) !important;
  }

  .shell > .header .subtitle {
    color: rgba(255, 255, 255, 0.92) !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);
  }

  .production-app-sidebar,
  .production-sidebar-toggle,
  .card,
  .production-page-submenu a {
    background: var(--erp-surface) !important;
    border-color: var(--erp-border) !important;
    color: var(--erp-text) !important;
  }

  .production-page-submenu a:hover,
  .production-page-submenu a.active {
    background: var(--module-primary) !important;
    border-color: var(--module-primary) !important;
    color: var(--erp-text) !important;
  }

  .production-gantt-bar {
    background: linear-gradient(90deg, var(--module-primary), var(--module-hover)) !important;
  }

  .production-field-readonly {
    background: var(--erp-sidebar) !important;
    color: var(--erp-muted) !important;
  }

  .production-sidebar-link,
  .production-sidebar-sublink {
    color: var(--erp-muted) !important;
  }

  .production-sidebar-link:hover,
  .production-sidebar-sublink:hover {
    background: var(--erp-sidebar) !important;
  }

  .production-sidebar-link.active,
  .production-sidebar-sublink.active {
    background: var(--module-primary) !important;
    color: var(--erp-text) !important;
  }

  .production-sidebar-group.is-active .production-sidebar-group-head {
    background: var(--module-soft) !important;
    color: var(--erp-text) !important;
  }

  .production-sidebar-planning-block {
    background: linear-gradient(
      165deg,
      color-mix(in srgb, var(--module-primary) 22%, var(--erp-sidebar)) 0%,
      color-mix(in srgb, var(--module-primary) 14%, var(--erp-bg)) 100%
    ) !important;
    border-color: var(--erp-border) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
  }

  .production-sidebar-planning-link {
    background: color-mix(in srgb, var(--erp-surface) 88%, var(--module-primary)) !important;
    border-color: var(--erp-border) !important;
  }

  .production-sidebar-planning-link:hover,
  .production-sidebar-planning-link:focus-visible {
    background: var(--erp-sidebar) !important;
  }

  .production-sidebar-planning-link.active {
    background: var(--module-primary) !important;
    border-color: var(--module-primary) !important;
    color: var(--erp-text) !important;
  }

  .production-product-picker-item {
    background: var(--erp-sidebar) !important;
    border-color: var(--erp-border) !important;
  }

  .production-product-group-picker-fieldset {
    border-color: var(--erp-border) !important;
  }

  button.secondary-button {
    background: transparent !important;
    color: var(--erp-text) !important;
  }

  button {
    background: var(--module-primary) !important;
    border-color: var(--module-primary) !important;
    color: var(--erp-text) !important;
  }

  button:hover {
    background: var(--module-hover) !important;
    border-color: var(--module-hover) !important;
  }

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

.production-co-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin: 16px 0 8px;
}

.production-co-toolbar label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  min-width: 120px;
}

.production-co-lines-table input[type="number"],
.production-co-lines-table input.production-co-money-input {
  width: 100%;
  min-width: 72px;
  padding: 6px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 0;
}

.production-co-money-cell {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.production-co-estimate-panel {
  margin-top: 16px;
  padding: 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0;
}

.production-co-estimate-panel h3 {
  margin: 0 0 12px;
  font-size: 0.9375rem;
}

.production-co-estimate-table th[scope="row"] {
  text-align: left;
  font-weight: 600;
}

.production-co-estimate-table tbody tr.production-co-estimate-total-row th,
.production-co-estimate-table tbody tr.production-co-estimate-total-row td {
  font-weight: 700;
  border-top: 2px solid #cbd5e1;
}

.production-co-estimate-breakdown-row > td {
  padding: 0 0 12px;
  border-bottom: 1px solid #e2e8f0;
}

.production-co-estimate-breakdown {
  margin: 8px 0 4px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0;
}

.production-co-estimate-breakdown-title {
  margin: 0 0 8px;
  font-size: 0.7875rem;
}

.production-co-estimate-breakdown-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8375rem;
}

.production-co-estimate-breakdown-table th,
.production-co-estimate-breakdown-table td {
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid #f1f5f9;
}

.production-co-estimate-breakdown-table th {
  font-weight: 600;
  color: #475569;
}

.production-co-stock-panel {
  margin-top: 16px;
  padding: 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0;
}

.production-co-stock-panel h3 {
  margin: 0 0 8px;
  font-size: 0.9375rem;
}

.production-co-stock-table {
  font-size: 12px;
}

.production-co-stock-table th,
.production-co-stock-table td {
  white-space: nowrap;
}

.production-co-stock-table td:first-child {
  white-space: normal;
  min-width: 140px;
}

.production-co-stock-row--short td {
  background: #fff7ed;
}

/* Dark mode — overrides for rules defined after the first dark block */
@media (prefers-color-scheme: dark) {
  .card,
  .login-card,
  .production-cloud-form,
  .production-catalog-bar,
  .production-stk-form-panel,
  .production-co-estimate-panel,
  .production-co-estimate-panel.card,
  .production-co-stock-panel,
  .production-co-stock-panel.card,
  .production-co-estimate-breakdown,
  .production-product-picker-item,
  .production-po-cart-btn,
  button.secondary-button:hover {
    background: var(--erp-surface) !important;
    border-color: var(--erp-border) !important;
    color: var(--erp-text) !important;
  }

  .production-stk-form-panel__head {
    background: var(--erp-sidebar) !important;
    border-color: var(--erp-border) !important;
    color: var(--erp-text) !important;
  }

  .production-stk-search,
  .production-form-grid input,
  .production-form-grid select,
  .production-form-grid textarea,
  .production-product-picker-qty input,
  .production-co-lines-table input[type="number"],
  .production-co-lines-table input.production-co-money-input {
    background: var(--erp-sidebar) !important;
    border-color: var(--erp-border) !important;
    color: var(--erp-text) !important;
  }

  .production-catalog-bar a {
    background: var(--erp-sidebar) !important;
    border-color: var(--erp-border) !important;
    color: var(--erp-text) !important;
  }

  .production-catalog-bar a:hover,
  .production-catalog-bar a.active,
  .production-page-submenu a:hover,
  .production-page-submenu a.active {
    background: var(--module-primary) !important;
    border-color: var(--module-primary) !important;
    color: var(--erp-text) !important;
  }

  .production-co-estimate-breakdown-table th {
    color: var(--erp-muted) !important;
  }

  .production-co-estimate-breakdown-table td,
  .production-co-estimate-table th,
  .production-co-estimate-table td,
  .production-co-stock-table th,
  .production-co-stock-table td {
    border-color: var(--erp-border) !important;
    color: var(--erp-text) !important;
  }

  .production-co-estimate-table tbody tr.production-co-estimate-total-row th,
  .production-co-estimate-table tbody tr.production-co-estimate-total-row td {
    border-top-color: var(--erp-border) !important;
  }

  .production-co-estimate-breakdown-row > td {
    border-bottom-color: var(--erp-border) !important;
  }

  .production-co-estimate-breakdown-table th,
  .production-co-estimate-breakdown-table td {
    border-bottom-color: var(--erp-border) !important;
  }

  .production-co-stock-row--short td {
    background: color-mix(in srgb, #f59e0b 18%, var(--erp-surface)) !important;
    color: var(--erp-text) !important;
  }

  .production-po-cart-btn:hover,
  .production-po-cart-btn:focus-visible {
    background: var(--erp-sidebar) !important;
    border-color: var(--module-hover) !important;
    color: var(--erp-text) !important;
  }

  .link-button {
    color: #93c5fd !important;
  }

  .production-co-status-hint,
  .production-data-legend,
  .production-mo-catalog-hint {
    color: var(--erp-muted) !important;
  }

  .production-product-group-picker-fieldset legend {
    color: var(--erp-text) !important;
  }

  .production-sidebar-toggle span {
    background: var(--erp-text) !important;
  }

  .production-sidebar-link:hover,
  .production-sidebar-sublink:hover {
    background: var(--erp-sidebar) !important;
    color: var(--erp-text) !important;
    box-shadow: inset 0 0 0 1px var(--erp-border) !important;
  }

  .production-sidebar-group.is-active .production-sidebar-group-head {
    color: var(--erp-text) !important;
  }

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

  .production-gantt-schedule-message--error {
    color: #fca5a5 !important;
  }

  .production-app-sidebar.is-open .production-sidebar-link::after,
  .production-app-sidebar.is-open .production-sidebar-sublink::after {
    background: var(--erp-sidebar) !important;
    border: 1px solid var(--erp-border) !important;
    color: var(--erp-text) !important;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45) !important;
  }

  .production-calendar {
    background: var(--erp-surface) !important;
    border-color: var(--erp-border) !important;
  }

  .production-calendar-month,
  .production-calendar-day {
    color: var(--erp-text) !important;
  }

  .production-calendar-weekday {
    color: var(--erp-muted) !important;
  }

  .production-calendar-cell {
    background: var(--erp-sidebar) !important;
    border-color: var(--erp-border) !important;
  }

  .production-calendar-cell--empty {
    background: color-mix(in srgb, var(--erp-bg) 70%, var(--erp-sidebar)) !important;
    border-color: var(--erp-border) !important;
  }

  .production-calendar-event {
    background: linear-gradient(90deg, var(--module-primary), var(--module-hover)) !important;
    color: var(--erp-text) !important;
  }

  .nav-toggle {
    background: var(--erp-surface) !important;
    border-color: var(--erp-border) !important;
  }

  .nav-toggle span {
    background: var(--erp-text) !important;
  }

  .production-gantt-table th,
  .production-gantt-table td {
    background: transparent !important;
    color: var(--erp-text) !important;
    border-color: var(--erp-border) !important;
  }
}

/* === 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(.production-app-shell),
html:has(.production-app-shell) body {
  height: 100%;
  overflow: hidden;
}

.production-app-shell {
  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;
}

.production-app-shell > .header,
.production-app-shell > .footer {
  grid-column: 1 / -1;
}

.production-app-shell > .header {
  grid-row: 1;
}

.production-app-shell > .production-app-sidebar {
  align-self: stretch;
  grid-column: 1;
  grid-row: 2 / -1;
  min-height: 0;
  position: static;
  top: auto;
}

.production-app-shell > .production-shell-main {
  grid-column: 2;
  grid-row: 2;
  min-height: 0;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.production-shell-main:has(> .production-page-layout) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.production-shell-main:has(> .production-page-layout) .production-page-layout {
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.production-app-shell .production-page-layout,
.production-shell-main .production-page-layout {
  align-items: stretch;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.production-app-shell .production-page-panels,
.production-shell-main .production-page-panels {
  height: 100%;
  max-height: 100%;
  min-height: 0;
}

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

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

  .production-app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .production-app-shell > .production-shell-main {
    overflow: visible;
  }

  .production-app-sidebar,
  .production-page-submenu {
    border-right: 0;
    flex-direction: row;
    flex-wrap: wrap;
    height: auto;
    overflow: visible;
    width: 100%;
  }

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

  .production-page-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 customer master editor (matches tensorFinance Sales → Customer) */
:root {
  --tp-prod-primary: #1e3a5f;
  --tp-prod-surface: #ffffff;
  --tp-prod-border: #e2e8f0;
  --tp-prod-text: #0f172a;
  --tp-prod-muted: #64748b;
  --tf-fin-editor-panel-bg: color-mix(in srgb, var(--tp-prod-surface) 78%, var(--tp-prod-primary) 22%);
  --tf-fin-editor-panel-border: color-mix(in srgb, var(--tp-prod-border) 55%, var(--tp-prod-primary) 45%);
  --tf-fin-saved-panel-bg: color-mix(in srgb, var(--tp-prod-surface) 94%, var(--tp-prod-primary) 6%);
  --tf-fin-saved-panel-border: color-mix(in srgb, var(--tp-prod-border) 88%, var(--tp-prod-text) 12%);
  --tf-fin-collapsed-header-bg: color-mix(in srgb, var(--tp-prod-surface) 72%, var(--tp-prod-primary) 28%);
  --tf-fin-collapsed-header-border: color-mix(in srgb, var(--tp-prod-border) 60%, var(--tp-prod-primary) 40%);
}

.finance-submenu-section {
  margin-bottom: 0;
}

.finance-submenu-card-title {
  font-size: 0.8875rem;
  font-weight: 700;
  margin: 0 0 10px;
}

.finance-submenu-card-title--table {
  margin-top: 16px;
}

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

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

.form-grid label > span {
  color: var(--tp-prod-muted);
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
}

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

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

.plain-table th,
.plain-table td {
  border-bottom: 1px solid var(--tp-prod-border);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.plain-table thead th {
  background: #f8fafc;
  font-size: 0.8125rem;
  font-weight: 700;
}

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

.tf-fin-editor-panel-head .finance-submenu-card-title,
.tf-fin-editor-panel-head > h3 {
  flex: 1 1 12rem;
  margin: 0;
}

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

.tf-fin-editor-panel:not(.is-collapsed) .tf-fin-editor-panel-head {
  border-bottom: 1px solid var(--tp-prod-border);
  margin: -16px -16px 12px;
  padding: 0 0 10px;
}

.tf-fin-editor-panel.is-collapsed {
  background: var(--tf-fin-collapsed-header-bg);
  border-color: var(--tf-fin-collapsed-header-border);
  border-left: 3px solid var(--tp-prod-primary);
  padding: 0;
}

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

.tf-fin-editor-toggle-bridge {
  align-items: center;
  display: flex;
  justify-content: center;
  margin: -6px 0;
  padding: 0;
}

.tf-fin-editor-toggle-bridge [data-tf-fin-form-toggle] {
  align-items: center;
  display: inline-flex;
  gap: 0.35em;
  min-width: 9.5rem;
}

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

.tf-fin-editor-panel.is-collapsed + .tf-fin-editor-toggle-bridge [data-tf-fin-form-toggle].tf-fin-form-toggle-show,
.tf-fin-form-toggle-show {
  border-color: color-mix(in srgb, var(--tp-prod-primary) 55%, var(--tp-prod-border));
  color: var(--tp-prod-primary);
  font-weight: 600;
}

.tf-fin-editor-toggle-bridge [data-tf-fin-form-toggle]:not(.tf-fin-form-toggle-show) {
  border-color: color-mix(in srgb, var(--tp-prod-primary) 40%, var(--tp-prod-border));
  color: var(--tp-prod-primary);
  font-weight: 600;
}

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

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

.finance-submenu-section.tf-fin-workflow-split {
  background: transparent;
  border: none;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0;
}

.finance-submenu-section.tf-fin-workflow-split > .card {
  margin: 0;
}

.finance-submenu-section.tf-fin-workflow-split > .card:not(.tf-fin-editor-panel),
.finance-submenu-section.tf-fin-workflow-split > [data-tf-fin-saved-panel] {
  background: var(--tf-fin-saved-panel-bg);
  border-color: var(--tf-fin-saved-panel-border);
}

.finance-submenu-section.tf-fin-workflow-split > .tf-fin-editor-panel,
.finance-submenu-section.tf-fin-workflow-split > .tf-fin-editor-toggle-bridge {
  flex-shrink: 0;
}

.finance-submenu-section.tf-fin-workflow-split:has(.tf-fin-editor-panel:not(.is-collapsed))
  > [data-tf-fin-saved-panel].tf-fin-saved-panel--local-scroll {
  flex: none;
  min-height: auto;
  overflow: visible;
}

.finance-submenu-section.tf-fin-workflow-split > [data-tf-fin-saved-panel].tf-fin-saved-panel--local-scroll {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.tf-fin-saved-panel--local-scroll {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.tf-fin-saved-panel--local-scroll > h3,
.tf-fin-saved-panel--local-scroll > h4,
.tf-fin-saved-panel--local-scroll > .actions {
  flex-shrink: 0;
}

.tf-fin-saved-panel--local-scroll > .tf-fin-saved-list-scroll {
  flex: 1 1 auto;
  margin-top: 0;
  max-height: min(560px, calc(100vh - 280px));
  min-height: 12rem;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--tp-prod-border);
  background: var(--tp-prod-surface);
}

.tf-fin-saved-panel--local-scroll > .tf-fin-saved-list-scroll > .table-wrap {
  margin-top: 0;
}

.tf-fin-saved-panel--local-scroll > .tf-fin-saved-list-scroll .plain-table thead th {
  background: #f8fafc;
  box-shadow: 0 1px 0 var(--tp-prod-border);
  position: sticky;
  top: 0;
  z-index: 2;
}

.tf-fin-saved-panel--local-scroll > [id$="ListEmpty"] {
  flex-shrink: 0;
  margin-top: 10px;
}

.tf-coa-list-bar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 8px;
}

.tp-prod-sup-list-bar {
  flex-wrap: nowrap;
  margin-bottom: 12px;
}

.tp-prod-sup-list-bar .tp-prod-sup-search-input {
  flex: 1 1 auto;
  max-width: none;
  min-width: 0;
  width: auto;
}

.tp-prod-sup-list-empty {
  margin-top: 8px;
}

.tf-coa-search-input {
  flex: 1 1 180px;
  max-width: 100%;
  min-height: 32px;
  min-width: 0;
}

.form-grid .small,
p.small {
  font-size: 0.8125rem;
}

.tf-table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.error-text {
  color: #b91c1c;
}
