:root {
  --bg-main: #060810;
  --bg-deep: #0b1020;
  --bg-grid: rgba(255, 114, 28, 0.08);
  --panel: rgba(8, 10, 20, 0.94);
  --panel-soft: rgba(14, 18, 31, 0.88);
  --panel-card: rgba(11, 14, 25, 0.92);
  --border: rgba(255, 118, 32, 0.18);
  --border-soft: rgba(107, 122, 153, 0.18);
  --text-main: #f7f3ea;
  --text-soft: #a5acc0;
  --text-dim: #707891;
  --accent: #ff6b1a;
  --accent-soft: rgba(255, 107, 26, 0.16);
  --accent-alt: #2ee6a6;
  --danger: #ff466c;
  --warn: #f4b300;
  --shadow-xl: 0 24px 80px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.42);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --font-ui: "Segoe UI", "Noto Sans", "DejaVu Sans", Arial, sans-serif;
}

/* Telegram bindings workspace */
.bindings-page {
  --bindings-panel: #111417;
  --bindings-panel-soft: #15191d;
  --bindings-border: rgba(255, 255, 255, 0.1);
  --bindings-text: #f2f4f5;
  --bindings-muted: #9ca5aa;
  --bindings-green: #67dc8c;
  --bindings-amber: #f2be5c;
  --bindings-red: #ff8188;
}

.bindings-shell {
  display: grid;
  gap: 18px;
}

.bindings-shell > * {
  flex-shrink: 0;
}

.bindings-page .workspace-frame {
  overflow-x: hidden;
  overflow-y: auto;
}

.bindings-page .bindings-shell {
  height: auto;
  min-height: 100%;
}

.bindings-page .bindings-header {
  align-items: flex-start;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--bindings-border);
}

.bindings-title {
  margin: 5px 0 6px;
  color: var(--bindings-text);
  font-size: clamp(1.65rem, 2.2vw, 2.35rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.binding-detail-app-id,
.binding-row-id,
.binding-app-id {
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.binding-detail-app-id {
  margin: 0;
  color: var(--bindings-muted);
  font-size: 0.82rem;
}

.bindings-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid var(--bindings-border);
  border-radius: 8px;
  background: var(--bindings-panel);
}

.bindings-summary-item {
  display: grid;
  min-height: 82px;
  align-content: center;
  gap: 5px;
  padding: 14px 16px;
  border-left: 1px solid var(--bindings-border);
}

.bindings-summary-item:first-child {
  border-left: 0;
}

.bindings-summary-item span {
  color: var(--bindings-muted);
  font-size: 0.76rem;
}

.bindings-summary-item strong {
  color: var(--bindings-text);
  font-size: 1.45rem;
  line-height: 1;
}

.bindings-summary-item.is-positive strong { color: var(--bindings-green); }
.bindings-summary-item.is-warning strong { color: var(--bindings-amber); }
.bindings-summary-item.is-danger strong { color: var(--bindings-red); }

.bindings-definition {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgba(242, 190, 92, 0.22);
  border-radius: 8px;
  background: rgba(242, 190, 92, 0.18);
}

.bindings-definition > div {
  display: grid;
  gap: 4px;
  padding: 13px 15px;
  background: #171819;
}

.bindings-definition strong {
  color: #f8d589;
  font-size: 0.78rem;
}

.bindings-definition span {
  color: #c6c9c8;
  font-size: 0.75rem;
  line-height: 1.45;
}

.bindings-page .bindings-filter-panel,
.binding-panel {
  margin: 0;
  padding: 18px;
  border: 1px solid var(--bindings-border);
  border-radius: 8px;
  background: var(--bindings-panel);
  box-shadow: none;
}

.bindings-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 15px;
}

.bindings-section-heading h2 {
  margin: 0;
  color: var(--bindings-text);
  font-size: 1rem;
  line-height: 1.3;
  letter-spacing: 0;
}

.bindings-section-heading p {
  margin: 4px 0 0;
  color: var(--bindings-muted);
  font-size: 0.76rem;
  line-height: 1.4;
}

.bindings-filter-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(180px, 1.1fr) minmax(180px, 0.8fr) minmax(180px, 0.8fr) auto;
  gap: 12px;
  align-items: end;
}

.bindings-field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.bindings-field > span {
  color: var(--bindings-muted);
  font-size: 0.7rem;
  font-weight: 700;
}

.bindings-page .input,
.bindings-page .select {
  min-height: 42px;
  border-radius: 6px;
}

.bindings-search-button {
  min-height: 42px;
  min-width: 92px;
}

.bindings-results {
  min-width: 0;
}

.bindings-list {
  display: grid;
  gap: 8px;
}

.binding-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.3fr) minmax(155px, 1.05fr) minmax(145px, 0.95fr) minmax(140px, 0.85fr) minmax(140px, 0.85fr) auto;
  gap: 16px;
  align-items: center;
  min-width: 0;
  padding: 14px 15px;
  border: 1px solid var(--bindings-border);
  border-radius: 8px;
  background: var(--bindings-panel);
}

.binding-row:hover {
  border-color: rgba(103, 220, 140, 0.36);
  background: var(--bindings-panel-soft);
}

.binding-row.has-access-alert {
  border-left: 3px solid var(--bindings-red);
}

.binding-row-identity,
.binding-row-telegram,
.binding-row-device,
.binding-row-activity,
.binding-row-access {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.binding-row-name,
.binding-row-device strong,
.binding-row-activity strong {
  overflow: hidden;
  color: var(--bindings-text);
  font-size: 0.83rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.binding-row-id,
.binding-row-secondary,
.binding-row-device span,
.binding-row-activity span {
  overflow: hidden;
  color: var(--bindings-muted);
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.binding-row-access {
  justify-items: start;
}

.binding-row-open {
  min-width: 92px;
}

.binding-row-open.is-disabled {
  cursor: not-allowed;
  opacity: 0.48;
  pointer-events: none;
}

.bindings-empty {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 36px 18px;
  border: 1px dashed var(--bindings-border);
  border-radius: 8px;
  color: var(--bindings-muted);
  text-align: center;
}

.bindings-empty strong { color: var(--bindings-text); }

.binding-status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--bindings-border);
  border-radius: 8px;
  background: var(--bindings-panel);
}

.binding-status-strip > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 62px;
  padding: 12px 15px;
  border-left: 1px solid var(--bindings-border);
}

.binding-status-strip > div:first-child { border-left: 0; }
.binding-status-strip > div > span { color: var(--bindings-muted); font-size: 0.75rem; }
.binding-status-strip > div > strong:not(.status-badge) { color: var(--bindings-text); font-size: 1rem; }

.binding-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(340px, 0.75fr);
  gap: 16px;
  align-items: start;
}

.binding-info-column,
.binding-actions-column {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.binding-data-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  border-top: 1px solid var(--bindings-border);
  border-left: 1px solid var(--bindings-border);
}

.binding-data-grid > div {
  min-width: 0;
  padding: 12px;
  border-right: 1px solid var(--bindings-border);
  border-bottom: 1px solid var(--bindings-border);
}

.binding-data-grid dt {
  margin-bottom: 5px;
  color: var(--bindings-muted);
  font-size: 0.68rem;
}

.binding-data-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--bindings-text);
  font-size: 0.8rem;
  line-height: 1.4;
}

.binding-access-list,
.binding-code-list,
.binding-history-list {
  display: grid;
  border-top: 1px solid var(--bindings-border);
}

.binding-access-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--bindings-border);
}

.binding-access-row > div {
  display: grid;
  gap: 5px;
}

.binding-access-row > div:last-child { justify-items: end; }
.binding-access-row strong { color: var(--bindings-text); font-size: 0.82rem; }
.binding-access-row span:not(.status-badge),
.binding-access-row small { color: var(--bindings-muted); font-size: 0.72rem; }

.binding-reason {
  padding: 10px 12px;
  border-bottom: 1px solid var(--bindings-border);
  background: rgba(255, 129, 136, 0.06);
  color: #d8d9d8;
  font-size: 0.74rem;
  line-height: 1.45;
}

.binding-code-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-left: 1px solid var(--bindings-border);
}

.binding-code-list > div {
  display: grid;
  gap: 7px;
  justify-items: start;
  padding: 14px;
  border-right: 1px solid var(--bindings-border);
  border-bottom: 1px solid var(--bindings-border);
}

.binding-code-list strong { color: var(--bindings-text); font-size: 0.8rem; }
.binding-code-list span:not(.status-badge) { color: var(--bindings-muted); font-size: 0.72rem; }

.binding-actions-panel {
  padding-bottom: 4px;
}

.binding-operation {
  display: grid;
  gap: 11px;
  padding: 15px 0;
  border-top: 1px solid var(--bindings-border);
}

.binding-operation > div {
  display: grid;
  gap: 4px;
}

.binding-operation strong { color: var(--bindings-text); font-size: 0.82rem; }
.binding-operation > div span { color: var(--bindings-muted); font-size: 0.72rem; line-height: 1.45; }
.binding-operation .btn { width: 100%; min-height: 40px; }

.binding-inline-check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: #d0d4d5;
  font-size: 0.74rem;
  line-height: 1.4;
}

.binding-inline-check input { margin-top: 2px; }
.binding-textarea { resize: vertical; }
.bindings-page .btn:disabled { opacity: 0.42; cursor: not-allowed; }

.binding-history-row {
  display: grid;
  grid-template-columns: 150px minmax(170px, 0.8fr) minmax(120px, 0.5fr) minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 12px 4px;
  border-bottom: 1px solid var(--bindings-border);
  color: var(--bindings-muted);
  font-size: 0.73rem;
}

.binding-history-row strong { color: var(--bindings-text); font-size: 0.77rem; }

@media (max-width: 1480px) {
  .bindings-summary { grid-template-columns: repeat(5, minmax(130px, 1fr)); overflow-x: auto; }
  .bindings-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bindings-search-button {
    grid-column: 1 / -1;
    width: 100%;
  }
  .binding-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .binding-row-open { width: 100%; }
  .binding-data-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1080px) {
  .bindings-definition { grid-template-columns: 1fr; }
  .binding-detail-layout { grid-template-columns: 1fr; }
  .binding-status-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .binding-status-strip > div:nth-child(3) { border-left: 0; border-top: 1px solid var(--bindings-border); }
  .binding-status-strip > div:nth-child(4) { border-top: 1px solid var(--bindings-border); }
  .binding-history-row { grid-template-columns: 140px minmax(0, 1fr); }
}

@media (max-width: 720px) {
  .bindings-page .bindings-header,
  .bindings-section-heading { flex-direction: column; }
  .bindings-summary { grid-template-columns: 1fr 1fr; overflow: visible; }
  .bindings-summary-item { border-top: 1px solid var(--bindings-border); }
  .bindings-summary-item:nth-child(odd) { border-left: 0; }
  .bindings-filter-grid,
  .binding-row,
  .binding-data-grid,
  .binding-code-list,
  .binding-status-strip { grid-template-columns: 1fr; }
  .binding-row-name,
  .binding-row-device strong,
  .binding-row-activity strong,
  .binding-row-id,
  .binding-row-secondary,
  .binding-row-device span,
  .binding-row-activity span { white-space: normal; }
  .binding-status-strip > div { border-top: 1px solid var(--bindings-border); border-left: 0; }
  .binding-status-strip > div:first-child { border-top: 0; }
  .binding-access-row { grid-template-columns: 1fr; }
  .binding-access-row > div:last-child { justify-items: start; }
  .binding-history-row { grid-template-columns: 1fr; gap: 5px; }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  color: var(--text-main);
  background:
    radial-gradient(circle at 10% 12%, rgba(255, 107, 26, 0.18), transparent 26rem),
    radial-gradient(circle at 88% 20%, rgba(255, 58, 108, 0.14), transparent 24rem),
    linear-gradient(180deg, #05070f 0%, #0a0d17 46%, #05070e 100%);
  background-attachment: fixed;
  font-family: var(--font-ui);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  z-index: 0;
  opacity: 0.22;
  background:
    linear-gradient(rgba(0, 232, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 232, 255, 0.06) 1px, transparent 1px);
  background-size: 56px 56px;
  transform: perspective(1200px) rotateX(68deg) scale(1.4) translateY(24%);
  transform-origin: center bottom;
  animation: cyber-grid-drift 16s linear infinite;
}

body::after {
  z-index: 0;
  opacity: 0.45;
  background:
    linear-gradient(
      180deg,
      transparent 0%,
      rgba(255, 255, 255, 0.02) 48%,
      rgba(0, 232, 255, 0.05) 50%,
      rgba(255, 255, 255, 0.02) 52%,
      transparent 100%
    );
  background-size: 100% 220px;
  mix-blend-mode: screen;
  animation: scanline-sweep 8s linear infinite;
}

body,
#container,
#content,
#content-main,
.main,
.content,
#main {
  background: transparent !important;
  color: var(--text-main);
  min-height: 100vh;
  width: 100%;
  font-family: var(--font-ui);
}

.workspace-page,
.workspace-page *,
.desktop-only-page,
.desktop-only-page * {
  font-family: var(--font-ui);
}

body.auth-flow #header,
body.auth-flow .breadcrumbs,
body.auth-flow #nav-sidebar,
body.auth-flow #toggle-nav-sidebar,
body.auth-flow #user-tools,
body.auth-flow .main > .sticky,
body.auth-flow .main .toggle-nav-sidebar {
  display: none !important;
}

body.auth-flow #content,
body.auth-flow #content-main,
body.auth-flow .main,
body.auth-flow #main {
  margin: 0 !important;
  padding: 0 !important;
  min-height: 100vh !important;
  height: 100vh !important;
}

body.modal-open {
  overflow: hidden;
}

body.is-dragging-promo-panel {
  user-select: none;
  cursor: grabbing;
}

body.is-dragging-promo-panel .promo-panel-drag-handle,
body.is-dragging-promo-panel .promo-panel-resize-handle {
  cursor: grabbing !important;
}

#header,
.breadcrumbs,
#content .messagelist,
#content .messagelist li,
#nav-sidebar,
#toggle-nav-sidebar {
  display: none !important;
}

.main.shifted > #content,
.main > #content {
  margin-left: 0 !important;
}

#content,
#content-main {
  min-height: 100vh;
  height: 100vh;
  padding: 0 !important;
  margin: 0 !important;
}

#content > h1 {
  display: none;
}

.workspace-page {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  width: 100vw;
  height: 100vh;
  padding: 24px;
  overflow: hidden;
}

body.workspace-compact .workspace-page,
body.workspace-compact .workspace-page-auth {
  position: fixed;
  inset: 0;
  display: block;
  padding: 8px;
  overflow: auto;
}

body.workspace-compact .workspace-frame {
  width: calc(100vw - 16px);
  max-width: calc(100vw - 16px);
  height: auto;
  min-height: calc(100vh - 16px);
  max-height: none;
  padding: 10px;
  border-radius: 18px;
}

body.workspace-compact .workspace-shell {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: auto;
  min-height: 0;
}

body.workspace-compact .workspace-header {
  align-items: center;
  gap: 8px;
}

body.workspace-compact .workspace-brand {
  max-width: none;
}

body.workspace-compact .workspace-kicker {
  font-size: 0.6rem;
  margin-bottom: 0;
}

body.workspace-compact .workspace-title {
  font-size: clamp(1.12rem, 1.55vw, 1.72rem);
  margin-bottom: 0;
  line-height: 0.92;
}

body.workspace-compact .workspace-terminal,
body.workspace-compact .workspace-stats {
  display: flex;
  align-items: stretch;
  gap: 6px;
  min-width: 0;
}

body.workspace-compact .workspace-terminal {
  padding: 2px 0 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 12px;
}

body.workspace-compact .workspace-terminal::before,
body.workspace-compact .workspace-terminal::after {
  display: none;
}

body.workspace-compact .workspace-terminal-header {
  display: none;
}

body.workspace-compact .workspace-terminal-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
  width: 100%;
}

body.workspace-compact .workspace-terminal-line,
body.workspace-compact .workspace-terminal-line-wide {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 5px 8px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(180deg, rgba(12, 16, 27, 0.94), rgba(10, 14, 24, 0.88));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.015);
}

body.workspace-compact .workspace-terminal-line-wide {
  grid-column: span 2;
}

body.workspace-compact .workspace-terminal-key {
  font-size: 0.48rem;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

body.workspace-compact .workspace-terminal-value {
  font-size: 0.68rem;
  line-height: 1.08;
  font-weight: 700;
  color: #e8edf8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.workspace-compact .workspace-terminal-value.is-success {
  color: #9fffd7;
}

body.workspace-compact .workspace-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

body.workspace-compact .workspace-stat {
  min-height: 0;
  padding: 6px 8px;
  border-radius: 10px;
}

body.workspace-compact .workspace-stat-label {
  margin-bottom: 1px;
  font-size: 0.52rem;
}

body.workspace-compact .workspace-stat-value {
  font-size: 0.82rem;
}

body.workspace-compact .workspace-header-actions {
  gap: 4px;
  flex: 0 1 720px;
}

body.workspace-compact .action-link,
body.workspace-compact .btn {
  min-height: 30px;
  padding: 0 8px;
  border-radius: 9px;
  font-size: 0.76rem;
}

body.workspace-compact .workspace-toolbar,
body.workspace-compact .workspace-table-card {
  padding: 8px;
  border-radius: 14px;
}

body.workspace-compact .workspace-section-title {
  margin-bottom: 4px;
  font-size: 0.6rem;
}

body.workspace-compact .toolbar-grid {
  grid-template-columns: minmax(260px, 1.35fr) minmax(160px, 0.8fr) minmax(130px, 0.45fr) auto;
  gap: 6px;
}

body.workspace-compact .label {
  margin-bottom: 3px;
  font-size: 0.58rem;
}

body.workspace-compact .input,
body.workspace-compact .select {
  min-height: 30px;
  padding: 0 8px;
  border-radius: 9px;
  font-size: 0.84rem;
}

body.workspace-compact .toolbar-actions {
  gap: 4px;
}

body.workspace-compact .workspace-table-card {
  flex: 1 1 auto;
  min-height: 0;
}

body.workspace-compact .table-wrap {
  --sticky-actions-width: 148px;
  --sticky-status-width: 82px;
  --sticky-total-width: 70px;
  --sticky-price-width: 74px;
  --sticky-promo-label-width: 152px;
  --sticky-promo-price-width: 92px;
  --sticky-promo-limit-width: 92px;
  --sticky-promo-progress-width: 132px;
  --sticky-promo-toggle-width: 74px;
  --product-column-width: 154px;
  --stock-column-width: 84px;
  flex: 1 1 auto;
  min-height: 0;
  max-height: calc(100vh - 290px);
}

body.workspace-compact .warehouse-table {
  min-width: max(100%, calc(540px + (var(--warehouse-count, 3) * var(--stock-column-width))));
}

body.workspace-compact .warehouse-table thead th,
body.workspace-compact .warehouse-table tbody td {
  padding: 6px 7px;
}

body.workspace-compact .stock-input,
body.workspace-compact .price-input {
  min-height: 26px;
  width: min(58px, 100%) !important;
  max-width: 58px !important;
  padding: 0 4px;
  font-size: 0.8rem;
}

body.workspace-compact .total-badge,
body.workspace-compact .status-badge,
body.workspace-compact .row-status {
  min-width: 48px;
  padding: 3px 6px;
  font-size: 0.62rem;
}

body.workspace-compact .active-toggle {
  width: 54px !important;
  min-width: 54px;
  max-width: 54px;
  min-height: 28px;
}

body.workspace-compact .active-toggle-switch {
  width: 50px;
  height: 22px;
}

body.workspace-compact .active-toggle-switch::before {
  font-size: 0.46rem;
}

body.workspace-compact .active-toggle-switch::after {
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
}

body.workspace-compact .active-toggle-input:checked + .active-toggle-switch::after {
  transform: translateX(28px);
}

body.workspace-compact .row-actions {
  gap: 4px;
}

body.workspace-compact .row-actions .btn-danger-soft {
  min-height: 26px;
  padding: 0 6px;
  font-size: 0.62rem;
}

@media (max-width: 1600px) {
  body.workspace-compact .workspace-terminal-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  body.workspace-compact .workspace-terminal-line-wide {
    grid-column: span 4;
  }
}

.desktop-only-page {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: 16px;
  overflow: hidden;
}

.desktop-only-panel {
  width: min(620px, calc(100vw - 32px));
  max-height: calc(100svh - 32px);
  overflow: auto;
  padding: clamp(18px, 5vw, 28px);
  border: 1px solid var(--border);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(8, 10, 20, 0.98), rgba(10, 14, 24, 0.96));
  box-shadow: var(--shadow-xl);
}

.desktop-only-title {
  margin: 0 0 14px;
  font-size: clamp(2.2rem, 13vw, 3rem);
  line-height: 0.95;
  letter-spacing: 0;
  text-transform: uppercase;
}

.desktop-only-text {
  margin: 0;
  max-width: 52ch;
  color: var(--text-soft);
  font-size: 1rem;
  line-height: 1.7;
}

.desktop-only-status {
  display: inline-flex;
  margin-top: 20px;
  min-height: 40px;
  align-items: center;
  padding: 0 14px;
  border: 1px solid rgba(255, 70, 108, 0.36);
  border-radius: 8px;
  background: rgba(255, 70, 108, 0.1);
  color: #ffd2dc;
  font-weight: 800;
}

@media (max-width: 640px) {
  .desktop-only-page {
    align-items: center;
    justify-items: center;
    padding-top: max(16px, env(safe-area-inset-top));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }

  .desktop-only-panel {
    width: min(420px, calc(100vw - 24px));
  }

  .desktop-only-text {
    font-size: 0.95rem;
    line-height: 1.55;
  }

  .desktop-only-status {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
}

.workspace-page::before,
.workspace-page::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(80px);
  opacity: 0.34;
}

.workspace-page::before {
  width: 420px;
  height: 420px;
  top: 10%;
  left: 6%;
  background: radial-gradient(circle, rgba(255, 107, 26, 0.34), transparent 68%);
  animation: neon-orb-left 11s ease-in-out infinite alternate;
}

.workspace-page::after {
  width: 360px;
  height: 360px;
  right: 8%;
  bottom: 10%;
  background: radial-gradient(circle, rgba(0, 232, 255, 0.22), transparent 70%);
  animation: neon-orb-right 13s ease-in-out infinite alternate;
}

.workspace-frame {
  position: relative;
  width: min(1560px, calc(100vw - 48px));
  max-width: calc(100vw - 48px);
  height: calc(100vh - 32px);
  max-height: calc(100vh - 32px);
  padding: 18px;
  overflow: hidden;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(8, 10, 20, 0.97), rgba(8, 10, 18, 0.96));
  box-shadow: var(--shadow-xl);
}

.workspace-frame,
.workspace-shell,
.workspace-shell > * {
  min-width: 0;
}

.workspace-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: 36px 36px;
  opacity: 0.28;
}

.workspace-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow:
    inset 0 0 0 1px rgba(255, 107, 26, 0.06),
    inset 0 0 80px rgba(255, 107, 26, 0.05);
}

.workspace-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto auto auto auto auto auto minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  height: 100%;
}

.workspace-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
}

.workspace-brand {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 780px;
}

.workspace-kicker,
.workspace-section-title,
.workspace-stat-label,
.label,
.workspace-status-label {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
}

.workspace-kicker {
  margin-bottom: 6px;
  color: var(--accent);
}

.workspace-title {
  margin: 0 0 6px;
  font-size: clamp(1.95rem, 2.8vw, 3.25rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
  font-weight: 800;
  text-transform: uppercase;
  color: #fff7ed;
}

.workspace-subtitle {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.6;
  max-width: 760px;
  display: none;
}

.workspace-session {
  margin-top: 14px;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.workspace-session-user {
  color: #7feeff;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(0, 232, 255, 0.24);
}

.workspace-header-actions {
  display: flex;
  flex: 0 1 620px;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 0;
  max-width: 100%;
}

.inline-action-form {
  margin: 0;
  display: inline-flex;
}

.inline-action-form .action-link,
.inline-action-form .btn {
  appearance: none;
  cursor: pointer;
}

.action-link,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: rgba(17, 21, 36, 0.92);
  color: #eef2ff;
  font-weight: 700;
  text-decoration: none;
  transition: 0.18s ease;
}

.action-link:hover,
.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 107, 26, 0.4);
  box-shadow: 0 0 0 1px rgba(255, 107, 26, 0.12), 0 10px 24px rgba(0, 0, 0, 0.28);
}

.action-link-danger:hover {
  border-color: rgba(255, 70, 108, 0.44);
  color: #fff;
}

.btn-primary {
  border-color: rgba(255, 107, 26, 0.55);
  background: linear-gradient(180deg, rgba(255, 107, 26, 0.22), rgba(255, 107, 26, 0.14));
  color: #fff6ee;
  box-shadow: 0 0 26px rgba(255, 107, 26, 0.18);
}

.btn-ghost {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 12px;
}

.workspace-hero,
.workspace-toolbar,
.product-admin-panel,
.workspace-table-card,
.workspace-stat,
.workspace-permissions-card {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(10, 13, 24, 0.96), rgba(10, 14, 24, 0.9));
  box-shadow: var(--shadow-lg);
}

.workspace-hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-end;
  padding: 22px 24px;
  border-radius: var(--radius-lg);
}

.workspace-hero-tag {
  margin-bottom: 10px;
  color: var(--accent-alt);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.workspace-hero-title {
  margin: 0 0 8px;
  font-size: 2.2rem;
  line-height: 1;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

.workspace-hero-text {
  margin: 0;
  color: var(--text-soft);
  max-width: 760px;
}

.workspace-status-wrap {
  display: grid;
  gap: 8px;
  justify-items: end;
  min-width: 320px;
}

.workspace-status-label {
  color: var(--text-dim);
}

.workspace-status-static {
  color: var(--text-soft);
  font-weight: 700;
}

.workspace-toast-stack {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  width: min(360px, calc(100vw - 36px));
  pointer-events: none;
}

.workspace-toast {
  pointer-events: auto;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 14px 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 107, 26, 0.22);
  background: linear-gradient(180deg, rgba(10, 13, 24, 0.98), rgba(14, 16, 28, 0.96));
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 107, 26, 0.06);
  backdrop-filter: blur(18px);
  animation: toast-enter 0.2s ease;
}

.settings-modal[hidden] {
  display: none !important;
}

.settings-modal {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: grid;
  place-items: center;
  padding: 24px;
}

.settings-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background:
    radial-gradient(circle at 50% 20%, rgba(0, 232, 255, 0.08), transparent 24rem),
    rgba(2, 4, 10, 0.76);
  backdrop-filter: blur(10px);
  cursor: pointer;
}

.settings-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(980px, calc(100vw - 48px));
  max-height: min(78vh, 820px);
  overflow: auto;
  padding: 22px;
  border-radius: 24px;
  border: 1px solid rgba(0, 232, 255, 0.16);
  background: linear-gradient(180deg, rgba(8, 10, 20, 0.98), rgba(10, 14, 24, 0.96));
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.56),
    0 0 0 1px rgba(255, 107, 26, 0.06),
    inset 0 0 36px rgba(0, 232, 255, 0.03);
}

.settings-modal-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.settings-modal-title {
  margin: 8px 0 8px;
  font-size: 1.9rem;
  line-height: 1.05;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

.settings-modal-subtitle {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.6;
}

.settings-close {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(255, 107, 26, 0.22);
  background: rgba(16, 20, 34, 0.9);
  color: #fff3e7;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.settings-close:hover {
  border-color: rgba(255, 107, 26, 0.4);
  box-shadow: 0 0 20px rgba(255, 107, 26, 0.14);
}

.workspace-toast.is-leaving {
  opacity: 0;
  transform: translateX(18px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.workspace-toast.is-success {
  border-color: rgba(46, 230, 166, 0.28);
}

.workspace-toast.is-error {
  border-color: rgba(255, 70, 108, 0.28);
}

.workspace-toast.is-info {
  border-color: rgba(255, 107, 26, 0.3);
}

.workspace-toast-body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.workspace-toast-label {
  color: var(--text-dim);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
}

.workspace-toast-message {
  color: #fff7ef;
  font-weight: 700;
  line-height: 1.35;
  font-size: 0.92rem;
  word-break: break-word;
}

.workspace-toast-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.toast-close {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: #cfd5e6;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

.toast-close:hover {
  background: rgba(255, 255, 255, 0.08);
}

.btn-undo {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 0.82rem;
}

@keyframes toast-enter {
  from {
    opacity: 0;
    transform: translateY(-10px) translateX(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0) translateX(0);
  }
}

.workspace-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}

.workspace-stat {
  padding: 8px 12px;
  border-radius: 14px;
  min-height: 62px;
}

.workspace-stat-label {
  margin-bottom: 4px;
  color: var(--text-dim);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
}

.workspace-stat-value {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}

.workspace-toolbar,
.workspace-table-card,
.product-admin-panel,
.workspace-permissions-card {
  border-radius: var(--radius-lg);
  min-width: 0;
  padding: 14px;
}

.workspace-terminal,
.workspace-stat,
.toolbar-grid,
.toolbar-actions {
  min-width: 0;
}

.workspace-table-card {
  display: flex;
  flex-direction: column;
  grid-row: -2 / -1;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: 14px;
}

.permissions-table-wrap {
  border-radius: 14px;
  overflow: auto;
  border: 1px solid rgba(0, 232, 255, 0.14);
  background: rgba(7, 9, 16, 0.72);
}

.permissions-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
}

.permissions-table th,
.permissions-table td {
  padding: 12px 14px;
  text-align: left;
  border-top: 1px solid rgba(0, 232, 255, 0.08);
  white-space: nowrap;
}

.permissions-table thead th {
  color: #7feeff;
  background: rgba(8, 10, 18, 0.98);
  border-top: 0;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.72rem;
}

.permissions-table th:first-child,
.permissions-table td:first-child {
  min-width: 152px;
  padding-right: 20px;
}

.permissions-table th:nth-child(2),
.permissions-table td:nth-child(2) {
  min-width: 96px;
  padding-left: 16px;
  padding-right: 20px;
}

.permissions-table th:nth-child(n + 3),
.permissions-table td:nth-child(n + 3) {
  min-width: 72px;
  text-align: center;
}

.permissions-table tbody td {
  background: #0b111b !important;
  color: var(--text-main);
}

.permissions-table tbody tr:nth-child(even) td {
  background: #0d1420 !important;
}

.permissions-table tbody tr:hover td {
  background: #11202a !important;
}

.permissions-table tbody tr.is-current-user td {
  background: #102934 !important;
}

.permissions-table tbody tr.is-current-user:hover td {
  background: #14333f !important;
}

.perm-badge {
  display: inline-flex;
  min-width: 54px;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  color: #8e99b2;
  background: rgba(19, 23, 38, 0.82);
  font-size: 0.75rem;
  font-weight: 700;
}

button.perm-badge {
  cursor: pointer;
  transition: 0.16s ease;
}

button.perm-badge:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 107, 26, 0.28);
  box-shadow: 0 0 16px rgba(255, 107, 26, 0.12);
}

button.perm-badge:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

.perm-badge.is-on {
  color: #98ffd1;
  background: rgba(7, 46, 28, 0.72);
  border-color: rgba(33, 255, 110, 0.44);
  box-shadow: 0 0 12px rgba(33, 255, 110, 0.12);
}

.workspace-section-title {
  margin-bottom: 10px;
  color: var(--accent);
}

.toolbar-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1.4fr) minmax(170px, 0.7fr) minmax(170px, 0.7fr) auto;
  gap: 12px;
  align-items: end;
}

.toolbar-grid > div {
  min-width: 0;
}

.label {
  display: block;
  margin-bottom: 8px;
  color: #ffd4bb;
}

.input,
.select,
.stock-input,
.price-input {
  appearance: none;
  color-scheme: dark;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(7, 9, 16, 0.96) !important;
  background-color: rgba(7, 9, 16, 0.96) !important;
  color: #fff7ef !important;
  -webkit-text-fill-color: #fff7ef !important;
  outline: none;
  caret-color: #7feeff;
  transition: 0.16s ease;
}

input.input,
input.stock-input,
input.price-input,
input.product-name-input,
input.count-input,
select.select {
  background: rgba(7, 9, 16, 0.96) !important;
  background-color: rgba(7, 9, 16, 0.96) !important;
  color: #fff7ef !important;
  -webkit-text-fill-color: #fff7ef !important;
}

input.input::-webkit-outer-spin-button,
input.input::-webkit-inner-spin-button,
input.stock-input::-webkit-outer-spin-button,
input.stock-input::-webkit-inner-spin-button,
input.price-input::-webkit-outer-spin-button,
input.price-input::-webkit-inner-spin-button,
input.count-input::-webkit-outer-spin-button,
input.count-input::-webkit-inner-spin-button {
  opacity: 1;
  filter: invert(0.9);
}

.input::placeholder,
.stock-input::placeholder,
.price-input::placeholder {
  color: rgba(255, 247, 239, 0.45);
}

.select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #ffb27e 50%),
    linear-gradient(135deg, #ffb27e 50%, transparent 50%);
  background-position:
    calc(100% - 20px) calc(50% - 3px),
    calc(100% - 14px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 40px;
}

.input:focus,
.select:focus,
.stock-input:focus,
.price-input:focus {
  border-color: rgba(255, 107, 26, 0.55);
  box-shadow: 0 0 0 0.2rem rgba(255, 107, 26, 0.12);
}

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

.product-admin-panel {
  position: relative;
  z-index: 3;
}

.product-modal-dialog {
  width: min(760px, calc(100vw - 48px));
}

.product-create-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(130px, 180px);
  gap: 14px;
  align-items: end;
}

.product-form-field {
  display: grid;
  gap: 8px;
}

.product-form-field-wide {
  grid-column: auto;
}

.product-name-input {
  min-width: 0;
}

.count-input {
  text-align: center;
}

.product-active-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: rgba(17, 21, 36, 0.92);
  color: var(--text-main);
  font-weight: 800;
}

.product-active-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-alt);
}

.product-form-actions {
  display: flex;
  justify-content: flex-end;
}

.btn-danger-soft {
  border-color: rgba(255, 70, 108, 0.3);
  color: #ffd2dc;
}

.btn-danger-soft:hover {
  border-color: rgba(255, 70, 108, 0.56);
  color: #fff;
}

.workspace-note {
  margin-top: 8px;
  color: var(--text-soft);
  font-size: 0.84rem;
}

.workspace-note-compact {
  margin-bottom: 10px;
  color: #89d8ff;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
}

.workspace-access-note {
  margin-top: 8px;
  color: #7feeff;
  font-size: 0.86rem;
  letter-spacing: 0.04em;
}

.table-wrap {
  --sticky-actions-width: 148px;
  --sticky-status-width: clamp(88px, 7vw, 110px);
  --sticky-total-width: clamp(76px, 6vw, 96px);
  --sticky-price-width: clamp(82px, 6vw, 96px);
  --sticky-promo-label-width: 170px;
  --sticky-promo-price-width: 100px;
  --sticky-promo-limit-width: 100px;
  --sticky-promo-progress-width: 160px;
  --sticky-promo-toggle-width: 86px;
  --product-column-width: clamp(168px, 18vw, 240px);
  --stock-column-width: clamp(86px, 7vw, 112px);
  flex: 1 1 auto;
  width: 100%;
  max-width: 100%;
  height: 100%;
  min-height: 0;
  overflow: auto;
  position: relative;
  border-radius: 16px;
  border: 1px solid rgba(0, 232, 255, 0.22);
  background:
    linear-gradient(180deg, rgba(5, 8, 16, 0.96), rgba(6, 10, 18, 0.94));
  box-shadow:
    inset 0 0 0 1px rgba(0, 232, 255, 0.04),
    inset 0 0 36px rgba(0, 232, 255, 0.03);
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 232, 255, 0.45) rgba(6, 10, 18, 0.25);
}

.table-wrap.has-admin-actions {
  --sticky-actions-width: 148px;
}

.table-wrap.no-admin-actions {
  --sticky-actions-width: 0px;
  --sticky-promo-toggle-width: 0px;
}

.table-wrap.has-many-warehouses {
  box-shadow:
    inset 0 0 0 1px rgba(0, 232, 255, 0.04),
    inset 0 0 36px rgba(0, 232, 255, 0.03),
    0 0 0 1px rgba(255, 107, 26, 0.06);
}

.table-wrap::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.table-wrap::-webkit-scrollbar-track {
  background: rgba(6, 10, 18, 0.28);
  border-radius: 999px;
}

.table-wrap::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(0, 232, 255, 0.55), rgba(255, 107, 26, 0.35));
  border-radius: 999px;
  border: 2px solid rgba(6, 10, 18, 0.45);
}

.warehouse-table {
  width: max-content;
  min-width: max(100%, calc(610px + (var(--warehouse-count, 3) * var(--stock-column-width))));
  max-width: none;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  position: relative;
}

.table-wrap.has-single-warehouse .warehouse-table {
  width: 100%;
}

.col-name {
  width: var(--product-column-width);
}

.col-stock {
  width: var(--stock-column-width);
}

.col-promo-label {
  width: 170px;
}

.col-promo-price,
.col-promo-limit {
  width: 100px;
}

.col-promo-progress {
  width: 160px;
}

.col-promo-toggle {
  width: 86px;
}

.col-price {
  width: 96px;
}

.col-total {
  width: 96px;
}

.col-status {
  width: 110px;
}

.col-actions {
  width: 188px;
}

.table-wrap.has-single-warehouse .col-name {
  width: 28%;
}

.table-wrap.has-many-warehouses .col-name {
  width: clamp(160px, 16vw, 220px);
}

.table-wrap.has-many-warehouses .col-stock {
  width: clamp(82px, 6vw, 94px);
}

.warehouse-table thead th {
  position: sticky;
  top: 0;
  vertical-align: middle;
  z-index: 20;
  padding: 14px 12px;
  background: rgba(7, 10, 19, 0.99);
  color: #7feeff;
  border-bottom: 1px solid rgba(0, 232, 255, 0.42);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.73rem;
  text-align: left;
  text-shadow: 0 0 10px rgba(0, 232, 255, 0.25);
}

.warehouse-table thead th:first-child {
  left: 0;
  z-index: 24;
  box-shadow: 10px 0 20px rgba(5, 8, 16, 0.65);
  width: var(--product-column-width);
  min-width: var(--product-column-width);
  max-width: var(--product-column-width);
}

.th-actions {
  position: sticky;
  right: calc(var(--sticky-promo-label-width) + var(--sticky-promo-price-width) + var(--sticky-promo-limit-width) + var(--sticky-promo-progress-width) + var(--sticky-promo-toggle-width));
  z-index: 28;
  box-shadow: none;
  background: #0b111b;
  width: var(--sticky-actions-width);
  min-width: var(--sticky-actions-width);
  max-width: var(--sticky-actions-width);
  box-sizing: border-box;
  background-clip: padding-box;
  text-align: center;
}

.th-status,
.th-total,
.th-price {
  position: sticky;
  background: #0b111b;
  box-sizing: border-box;
  background-clip: padding-box;
  text-align: center;
}

.th-status {
  right: calc(var(--sticky-actions-width) + var(--sticky-promo-label-width) + var(--sticky-promo-price-width) + var(--sticky-promo-limit-width) + var(--sticky-promo-progress-width) + var(--sticky-promo-toggle-width));
  z-index: 27;
  width: var(--sticky-status-width);
  min-width: var(--sticky-status-width);
  max-width: var(--sticky-status-width);
}

.th-total {
  right: calc(var(--sticky-actions-width) + var(--sticky-status-width) + var(--sticky-promo-label-width) + var(--sticky-promo-price-width) + var(--sticky-promo-limit-width) + var(--sticky-promo-progress-width) + var(--sticky-promo-toggle-width));
  z-index: 26;
  width: var(--sticky-total-width);
  min-width: var(--sticky-total-width);
  max-width: var(--sticky-total-width);
}

.th-price {
  right: calc(var(--sticky-actions-width) + var(--sticky-status-width) + var(--sticky-total-width) + var(--sticky-promo-label-width) + var(--sticky-promo-price-width) + var(--sticky-promo-limit-width) + var(--sticky-promo-progress-width) + var(--sticky-promo-toggle-width));
  z-index: 25;
  box-shadow: -14px 0 22px rgba(5, 8, 16, 0.48);
  width: var(--sticky-price-width);
  min-width: var(--sticky-price-width);
  max-width: var(--sticky-price-width);
}

.warehouse-table tbody td {
  padding: 10px 12px;
  border-top: 1px solid rgba(0, 232, 255, 0.12);
  color: var(--text-main);
  background: #0b111b;
  vertical-align: middle;
}

.warehouse-table tbody tr:nth-child(even) td {
  background: #0d1420;
}

.warehouse-table tbody tr:hover td {
  background: #11202a;
}

td.product-cell {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.3;
  vertical-align: middle;
  color: #fff7ef;
  font-weight: 700;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.04);
  background: #0b111b;
  box-shadow: 10px 0 20px rgba(5, 8, 16, 0.58);
  width: var(--product-column-width);
}

.warehouse-table tbody tr:nth-child(even) td.product-cell {
  background: #0d1420;
}

.warehouse-table tbody tr:hover td.product-cell {
  background: #11202a;
}

.row-actions-cell {
  position: sticky;
  right: calc(var(--sticky-promo-label-width) + var(--sticky-promo-price-width) + var(--sticky-promo-limit-width) + var(--sticky-promo-progress-width) + var(--sticky-promo-toggle-width));
  z-index: 8;
  background: #0b111b;
  box-shadow: none;
  width: var(--sticky-actions-width);
  min-width: var(--sticky-actions-width);
  max-width: var(--sticky-actions-width);
  box-sizing: border-box;
  background-clip: padding-box;
  text-align: center;
}

.warehouse-table tbody tr:nth-child(even) .row-actions-cell {
  background: #0d1420;
}

.warehouse-table tbody tr:hover .row-actions-cell {
  background: #11202a;
}

.status-cell,
.total-cell,
.warehouse-price-cell {
  position: sticky;
  background: #0b111b;
  box-sizing: border-box;
  background-clip: padding-box;
}

.status-cell {
  right: calc(var(--sticky-actions-width) + var(--sticky-promo-label-width) + var(--sticky-promo-price-width) + var(--sticky-promo-limit-width) + var(--sticky-promo-progress-width) + var(--sticky-promo-toggle-width));
  z-index: 7;
  width: var(--sticky-status-width);
  min-width: var(--sticky-status-width);
  max-width: var(--sticky-status-width);
}

.total-cell {
  right: calc(var(--sticky-actions-width) + var(--sticky-status-width) + var(--sticky-promo-label-width) + var(--sticky-promo-price-width) + var(--sticky-promo-limit-width) + var(--sticky-promo-progress-width) + var(--sticky-promo-toggle-width));
  z-index: 6;
  width: var(--sticky-total-width);
  min-width: var(--sticky-total-width);
  max-width: var(--sticky-total-width);
}

.warehouse-price-cell {
  right: calc(var(--sticky-actions-width) + var(--sticky-status-width) + var(--sticky-total-width) + var(--sticky-promo-label-width) + var(--sticky-promo-price-width) + var(--sticky-promo-limit-width) + var(--sticky-promo-progress-width) + var(--sticky-promo-toggle-width));
  z-index: 5;
  box-shadow: -14px 0 22px rgba(5, 8, 16, 0.48);
  width: var(--sticky-price-width);
  min-width: var(--sticky-price-width);
  max-width: var(--sticky-price-width);
}

.status-cell,
.total-cell,
.promo-summary-cell {
  text-align: center;
}

.warehouse-table thead .th-price,
.warehouse-table thead .th-total,
.warehouse-table thead .th-status,
.warehouse-table thead .th-actions {
  text-align: center;
}

.warehouse-table tbody .total-cell,
.warehouse-table tbody .status-cell,
.warehouse-table tbody .row-actions-cell,
.warehouse-table tbody .promo-summary-cell {
  padding-left: 8px;
  padding-right: 8px;
}

.warehouse-table tbody tr:nth-child(even) .status-cell,
.warehouse-table tbody tr:nth-child(even) .total-cell,
.warehouse-table tbody tr:nth-child(even) .warehouse-price-cell {
  background: #0d1420;
}

.warehouse-table tbody tr:hover .status-cell,
.warehouse-table tbody tr:hover .total-cell,
.warehouse-table tbody tr:hover .warehouse-price-cell {
  background: #11202a;
}

.workspace-table-card .warehouse-table tbody tr:nth-child(even) .row-actions-cell {
  background: #0d1420;
}

.workspace-table-card .warehouse-table tbody tr:hover .row-actions-cell {
  background: #11202a;
}

.warehouse-th {
  display: block;
  text-align: center;
  width: 100%;
  white-space: nowrap;
}

.table-wrap.has-many-warehouses .warehouse-th {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
}

.stock-input,
.price-input {
  min-height: 30px;
  width: min(74px, 100%) !important;
  max-width: 74px !important;
  text-align: center;
  font-weight: 700;
  padding: 0 8px;
  border-color: rgba(0, 232, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.promo-input {
  width: min(118px, 100%) !important;
  max-width: 118px !important;
}

.promo-label-input {
  width: min(152px, 100%) !important;
  max-width: 152px !important;
  text-align: left;
}

.warehouse-value-cell,
.warehouse-price-cell {
  text-align: center;
}

.warehouse-table .is-warehouse-filter-hidden {
  display: none !important;
}

.table-wrap.has-filtered-warehouse .warehouse-table {
  width: 100%;
  min-width: 100%;
  max-width: 100%;
}

.table-wrap.has-filtered-warehouse.has-admin-actions .col-name {
  width: 32%;
}

.table-wrap.has-filtered-warehouse.has-admin-actions .col-stock {
  width: 12%;
}

.table-wrap.has-filtered-warehouse.has-admin-actions .col-price,
.table-wrap.has-filtered-warehouse.has-admin-actions .col-total {
  width: 8%;
}

.table-wrap.has-filtered-warehouse.has-admin-actions .col-status {
  width: 9%;
}

.table-wrap.has-filtered-warehouse.has-admin-actions .col-actions {
  width: 14%;
}

.table-wrap.has-filtered-warehouse.has-admin-actions .col-promo-summary {
  width: 17%;
}

.table-wrap.has-filtered-warehouse.no-admin-actions .col-name {
  width: 38%;
}

.table-wrap.has-filtered-warehouse.no-admin-actions .col-stock {
  width: 14%;
}

.table-wrap.has-filtered-warehouse.no-admin-actions .col-price,
.table-wrap.has-filtered-warehouse.no-admin-actions .col-total {
  width: 10%;
}

.table-wrap.has-filtered-warehouse.no-admin-actions .col-status {
  width: 12%;
}

.table-wrap.has-filtered-warehouse.no-admin-actions .col-promo-summary {
  width: 16%;
}

.table-wrap.has-filtered-warehouse .warehouse-table thead th:first-child,
.table-wrap.has-filtered-warehouse .warehouse-table tbody td.product-cell {
  width: auto;
  min-width: 0;
  max-width: none;
}

.table-wrap:not(.has-many-warehouses) .warehouse-table .th-price,
.table-wrap:not(.has-many-warehouses) .warehouse-table .th-total,
.table-wrap:not(.has-many-warehouses) .warehouse-table .th-status,
.table-wrap:not(.has-many-warehouses) .warehouse-table .th-actions,
.table-wrap:not(.has-many-warehouses) .warehouse-table .warehouse-price-cell,
.table-wrap:not(.has-many-warehouses) .warehouse-table .total-cell,
.table-wrap:not(.has-many-warehouses) .warehouse-table .status-cell,
.table-wrap:not(.has-many-warehouses) .warehouse-table .row-actions-cell {
  right: auto;
  width: auto;
  min-width: 0;
  max-width: none;
  box-shadow: none;
}

.table-wrap:not(.has-many-warehouses) .warehouse-table tbody .warehouse-price-cell,
.table-wrap:not(.has-many-warehouses) .warehouse-table tbody .total-cell,
.table-wrap:not(.has-many-warehouses) .warehouse-table tbody .status-cell,
.table-wrap:not(.has-many-warehouses) .warehouse-table tbody .row-actions-cell {
  position: static;
}

.promo-cell,
.promo-progress-cell,
.promo-live-cell {
  text-align: center;
}

.promo-live-cell {
  width: var(--sticky-promo-toggle-width);
  min-width: var(--sticky-promo-toggle-width);
  max-width: var(--sticky-promo-toggle-width);
}

.stock-input.is-dirty,
.price-input.is-dirty {
  border-color: rgba(255, 107, 26, 0.86);
  box-shadow:
    0 0 0 1px rgba(255, 107, 26, 0.1),
    0 0 18px rgba(255, 107, 26, 0.18);
}

.stock-input.is-readonly,
.stock-input:disabled,
.price-input.is-readonly,
.price-input:disabled {
  border-color: rgba(107, 122, 153, 0.18);
  background: rgba(10, 12, 20, 0.64);
  color: #7a849a;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.78;
}

.stock-input.is-low {
  border-color: rgba(255, 44, 80, 0.88);
  background: rgba(44, 6, 16, 0.94);
  color: #ffb9c8;
  box-shadow:
    0 0 0 1px rgba(255, 44, 80, 0.08),
    0 0 14px rgba(255, 44, 80, 0.28);
}

.stock-input.is-mid {
  border-color: rgba(255, 190, 0, 0.76);
  background: rgba(51, 31, 2, 0.92);
  color: #ffe08a;
  box-shadow:
    0 0 0 1px rgba(255, 190, 0, 0.06),
    0 0 14px rgba(255, 190, 0, 0.2);
}

.price-input {
  color: #f7f3ea;
  width: min(70px, 100%) !important;
  max-width: 70px !important;
  padding: 0 6px;
}

.input:-webkit-autofill,
.input:-webkit-autofill:hover,
.input:-webkit-autofill:focus,
.stock-input:-webkit-autofill,
.stock-input:-webkit-autofill:hover,
.stock-input:-webkit-autofill:focus,
.price-input:-webkit-autofill,
.price-input:-webkit-autofill:hover,
.price-input:-webkit-autofill:focus,
.select:-webkit-autofill,
.select:-webkit-autofill:hover,
.select:-webkit-autofill:focus {
  -webkit-text-fill-color: #fff7ef;
  box-shadow: 0 0 0 1000px rgba(7, 9, 16, 0.98) inset;
  transition: background-color 9999s ease-in-out 0s;
}

.active-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-height: 30px;
  width: 72px !important;
  min-width: 72px;
  max-width: 72px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-main);
  font-weight: 800;
  cursor: pointer;
}

.active-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.active-toggle-switch {
  position: relative;
  flex: 0 0 auto;
  width: 68px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(255, 70, 108, 0.32);
  background:
    linear-gradient(180deg, rgba(72, 28, 42, 0.94), rgba(19, 13, 22, 0.98));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.02),
    inset 0 0 16px rgba(0, 0, 0, 0.34),
    0 0 14px rgba(255, 70, 108, 0.08);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.active-toggle-switch::before {
  content: "OFF";
  position: absolute;
  top: 50%;
  right: 8px;
  z-index: 1;
  transform: translateY(-50%);
  color: #ff9aae;
  font-size: 0.58rem;
  font-weight: 900;
  line-height: 1;
}

.active-toggle-switch::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff3f6, #a9707c);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.active-toggle-input:checked + .active-toggle-switch {
  border-color: rgba(46, 230, 166, 0.58);
  background:
    linear-gradient(180deg, rgba(28, 123, 91, 0.96), rgba(6, 38, 31, 0.98));
  box-shadow:
    inset 0 0 0 1px rgba(46, 230, 166, 0.12),
    0 0 20px rgba(46, 230, 166, 0.24);
}

.active-toggle-input:checked + .active-toggle-switch::before {
  content: "ON";
  right: auto;
  left: 9px;
  transform: translateY(-50%);
  color: #baffdd;
}

.active-toggle-input:checked + .active-toggle-switch::after {
  transform: translateX(38px);
  background: linear-gradient(180deg, #baffdd, #2ee6a6);
  box-shadow:
    0 3px 10px rgba(0, 0, 0, 0.35),
    0 0 12px rgba(46, 230, 166, 0.35);
}

.active-toggle:hover .active-toggle-switch {
  border-color: rgba(0, 232, 255, 0.34);
}

.active-toggle.is-readonly {
  color: #7a849a;
  cursor: not-allowed;
  opacity: 0.78;
}

.row-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: nowrap;
  width: 148px;
  min-width: 148px;
  margin: 0 auto;
}

.promo-toggle .active-toggle-switch::before {
  content: "SALE";
  font-size: 0.5rem;
}

.promo-toggle-input:checked + .active-toggle-switch::before {
  content: "LIVE";
}

.promo-progress-card {
  display: grid;
  gap: 6px;
  min-width: 120px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(0, 232, 255, 0.16);
  background: rgba(8, 12, 22, 0.76);
}

.promo-progress-card.is-active {
  border-color: rgba(255, 107, 26, 0.34);
  box-shadow: 0 0 18px rgba(255, 107, 26, 0.1);
}

.promo-progress-card.is-exhausted {
  border-color: rgba(255, 70, 108, 0.32);
  background: rgba(47, 10, 20, 0.72);
}

.promo-progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #dce5f7;
  font-size: 0.72rem;
  font-weight: 700;
}

.promo-progress-bar {
  position: relative;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.promo-progress-bar > span {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 1;
  display: block;
  height: 100%;
  min-width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(255, 107, 26, 0.88), rgba(255, 208, 116, 0.95));
  box-shadow: 0 0 12px rgba(255, 145, 64, 0.28);
  transition: width 180ms ease;
}

.promo-progress-card.is-exhausted .promo-progress-meta {
  color: #ffb8c5;
}

.promo-progress-card.is-exhausted .promo-progress-bar > span {
  background: linear-gradient(90deg, #d63f5f, #ff768f);
  box-shadow: 0 0 14px rgba(255, 70, 108, 0.34);
}

.promo-cycle-history {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.promo-cycle-history[hidden] {
  display: none;
}

.promo-cycle-history > div {
  display: grid;
  gap: 3px;
}

.promo-cycle-history span {
  color: rgba(229, 231, 235, 0.58);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.promo-cycle-history strong {
  color: #f4f4f5;
  font-size: 0.76rem;
  font-weight: 700;
}

.promo-cycle-history .is-exhausted strong {
  color: #ff9caf;
}

.promo-cycle-reset {
  width: 100%;
  margin-top: 10px;
  border-color: rgba(240, 168, 92, 0.42);
  color: #ffd8ad;
}

.promo-cycle-reset[hidden] {
  display: none;
}

.promo-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  color: #cfd5e6;
  background: rgba(54, 61, 78, 0.32);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.promo-pill.is-open {
  color: #ffe4b7;
  border-color: rgba(255, 107, 26, 0.3);
  background: rgba(89, 40, 8, 0.54);
  box-shadow: 0 0 14px rgba(255, 107, 26, 0.12);
}

.row-actions .btn-danger-soft {
  min-width: 68px;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 0.68rem;
  line-height: 1;
  font-weight: 700;
}

.total-badge,
.status-badge,
.row-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.total-badge.success,
.status-badge.success {
  color: #98ffd1;
  background: rgba(7, 46, 28, 0.72);
  border-color: rgba(33, 255, 110, 0.72);
  box-shadow: 0 0 14px rgba(33, 255, 110, 0.18);
}

.total-badge.zero,
.status-badge.zero {
  color: #d0d5e2;
  background: rgba(54, 61, 78, 0.66);
  border-color: rgba(148, 163, 184, 0.16);
}

.total-badge.neg,
.status-badge.neg {
  color: #ffc0cf;
  background: rgba(72, 10, 26, 0.78);
  border-color: rgba(255, 44, 80, 0.76);
  box-shadow: 0 0 14px rgba(255, 44, 80, 0.18);
}

.row-status {
  min-width: 118px;
  color: #cfe6ff;
  background: rgba(13, 18, 32, 0.86);
  border-color: rgba(0, 232, 255, 0.18);
}

.row-status.saved {
  color: #9fffd7;
  border-color: rgba(33, 255, 110, 0.44);
  background: rgba(7, 46, 28, 0.58);
  box-shadow: 0 0 14px rgba(33, 255, 110, 0.14);
}

.row-status.dirty {
  color: #ffd0ae;
  border-color: rgba(255, 107, 26, 0.52);
  background: rgba(80, 35, 9, 0.56);
  box-shadow: 0 0 14px rgba(255, 107, 26, 0.14);
}

.row-status.error {
  color: #ffc0cf;
  border-color: rgba(255, 44, 80, 0.44);
  background: rgba(72, 10, 26, 0.58);
  box-shadow: 0 0 14px rgba(255, 44, 80, 0.12);
}

.row-status.saving {
  color: #91f4ff;
  border-color: rgba(0, 232, 255, 0.38);
  background: rgba(8, 36, 54, 0.58);
  box-shadow: 0 0 14px rgba(0, 232, 255, 0.12);
}

.muted {
  color: var(--text-soft);
}

.warehouse-table tbody[aria-busy="true"] {
  cursor: progress;
}

.workspace-page-auth {
  padding: 24px;
}

.workspace-frame-auth {
  width: min(840px, calc(100vw - 48px));
  max-width: calc(100vw - 48px);
  height: auto;
  max-height: calc(100vh - 48px);
  padding: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-shell {
  width: 100%;
  display: grid;
  gap: 20px;
}

.auth-modal-shell {
  width: min(920px, calc(100vw - 48px));
  max-width: calc(100vw - 48px);
}

.auth-modal-dialog {
  position: relative;
  margin: 0 auto;
  padding: 24px;
  border-radius: 24px;
  border: 1px solid rgba(0, 232, 255, 0.16);
  background: linear-gradient(180deg, rgba(8, 10, 20, 0.98), rgba(10, 14, 24, 0.96));
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.56),
    0 0 0 1px rgba(255, 107, 26, 0.06),
    inset 0 0 36px rgba(0, 232, 255, 0.03);
  overflow: hidden;
}

.auth-modal-dialog::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: 34px 34px;
  opacity: 0.12;
}

.auth-modal-dialog::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow:
    inset 0 0 0 1px rgba(0, 232, 255, 0.04),
    inset 0 0 44px rgba(0, 232, 255, 0.04);
}

.auth-modal-header,
.auth-form-card-modal,
.auth-actions {
  position: relative;
  z-index: 1;
}

.auth-modal-dialog-compact {
  width: min(640px, calc(100vw - 48px));
}

.auth-shell-compact {
  max-width: 620px;
  margin: 0 auto;
  text-align: center;
}

.auth-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.auth-header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.auth-kicker {
  margin-bottom: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.auth-title {
  margin: 0 0 10px;
  font-size: clamp(2rem, 3vw, 2.6rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
  font-weight: 800;
  color: #f8fbff;
}

.auth-subtitle {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.6;
  font-size: 1rem;
}

.auth-alert {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid transparent;
  font-weight: 600;
}

.auth-alert-error {
  color: #ffcad5;
  background: rgba(76, 17, 36, 0.54);
  border-color: rgba(255, 70, 108, 0.28);
}

.auth-form-card {
  padding: 24px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(10, 13, 24, 0.96), rgba(10, 14, 24, 0.9));
}

.auth-form-card-modal {
  margin-top: 4px;
}

.auth-form-grid {
  display: grid;
  gap: 18px;
}

.auth-field {
  display: grid;
  gap: 8px;
}

.auth-label {
  color: #ffd4bb;
  font-weight: 700;
  font-size: 0.9rem;
}

.auth-form-card input[type="password"],
.auth-form-card input[type="text"],
.auth-form-card input[type="email"],
.auth-form-card select,
.auth-form-card textarea {
  width: 100%;
  min-height: 50px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  background: rgba(7, 9, 16, 0.94);
  color: #fff7ef;
  outline: none;
}

.auth-form-card input[type="password"]:focus,
.auth-form-card input[type="text"]:focus,
.auth-form-card input[type="email"]:focus,
.auth-form-card select:focus,
.auth-form-card textarea:focus {
  border-color: rgba(255, 107, 26, 0.55);
  box-shadow: 0 0 0 0.2rem rgba(255, 107, 26, 0.12);
}

.auth-checkbox-row {
  display: flex;
  align-items: center;
  min-height: 50px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  background: rgba(7, 9, 16, 0.94);
}

.auth-help,
.auth-form-card .help,
.auth-form-card .helptext {
  color: var(--text-soft);
  font-size: 0.88rem;
  line-height: 1.55;
}

.auth-help ul,
.auth-form-card .help ul,
.auth-form-card .helptext ul {
  margin: 8px 0 0 18px;
}

.auth-field-error,
.auth-form-card .errorlist,
.auth-form-card .errornote {
  color: #ffcad5;
  font-size: 0.9rem;
}

.auth-form-card .errorlist {
  margin: 0;
  padding-left: 18px;
}

.auth-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.auth-submit,
.auth-secondary {
  min-width: 180px;
  text-decoration: none;
}

@media (max-width: 1180px) {
  .workspace-header,
  .workspace-hero,
  .auth-header {
    display: grid;
    grid-template-columns: 1fr;
  }

  .workspace-header-actions,
  .auth-header-actions {
    justify-content: flex-start;
  }

  .workspace-status-wrap {
    justify-items: start;
    min-width: 0;
  }
}

@media (max-width: 1600px), (max-height: 980px) {
  .workspace-page,
  .workspace-page-auth {
    padding: 16px;
  }

  .workspace-frame {
    width: calc(100vw - 32px);
    max-width: calc(100vw - 32px);
    height: calc(100vh - 32px);
    max-height: calc(100vh - 32px);
    padding: 14px;
  }

  .workspace-shell {
    gap: 12px;
  }

  .workspace-title {
    font-size: clamp(1.6rem, 2.3vw, 2.6rem);
  }

  .workspace-terminal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace-terminal-line-wide {
    grid-column: 1 / -1;
  }

  .workspace-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
  }

  .workspace-stat {
    padding: 8px 10px;
  }

  .toolbar-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(150px, 0.7fr) minmax(150px, 0.7fr) auto;
    gap: 10px;
  }

  .table-wrap {
    --sticky-actions-width: 146px;
    --sticky-status-width: 92px;
    --sticky-total-width: 78px;
    --sticky-price-width: 84px;
    --product-column-width: 180px;
    --stock-column-width: 92px;
  }

  .warehouse-table thead th,
  .warehouse-table tbody td {
    padding: 9px 10px;
  }

  .stock-input,
  .price-input {
    min-height: 30px;
    width: min(68px, 100%) !important;
    max-width: 68px !important;
    padding: 0 6px;
  }
}

@media (min-width: 1181px) and (max-height: 940px) {
  .workspace-shell {
    gap: 10px;
  }

  .workspace-header {
    align-items: center;
  }

  .workspace-kicker {
    font-size: 0.68rem;
    margin-bottom: 4px;
  }

  .workspace-title {
    font-size: clamp(1.45rem, 2vw, 2.2rem);
    margin-bottom: 2px;
  }

  .workspace-terminal {
    padding: 4px 6px;
  }

  .workspace-terminal-header {
    margin-bottom: 2px;
  }

  .workspace-terminal-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2px 6px;
  }

  .workspace-terminal-key {
    font-size: 0.58rem;
  }

  .workspace-terminal-value {
    font-size: 0.72rem;
  }

  .workspace-stats {
    gap: 8px;
  }

  .workspace-stat {
    min-height: 54px;
    padding: 7px 10px;
  }

  .workspace-stat-label {
    font-size: 0.62rem;
    margin-bottom: 2px;
  }

  .workspace-stat-value {
    font-size: 0.96rem;
  }

  .workspace-toolbar,
  .workspace-table-card {
    padding: 12px;
  }

  .workspace-section-title {
    margin-bottom: 8px;
    font-size: 0.68rem;
  }

  .label {
    margin-bottom: 6px;
    font-size: 0.68rem;
  }

  .input,
  .select {
    min-height: 38px;
    padding: 0 10px;
  }

  .action-link,
  .btn {
    min-height: 36px;
    padding: 0 12px;
    font-size: 0.92rem;
  }

  .table-wrap {
    --sticky-actions-width: 136px;
    --sticky-status-width: 88px;
    --sticky-total-width: 74px;
    --sticky-price-width: 80px;
    --product-column-width: 168px;
    --stock-column-width: 88px;
  }

  .warehouse-table thead th,
  .warehouse-table tbody td {
    padding: 8px 9px;
  }

  .total-badge,
  .status-badge,
  .row-status {
    min-width: 58px;
    padding: 5px 8px;
    font-size: 0.72rem;
  }

  .active-toggle {
    width: 64px !important;
    min-width: 64px;
    max-width: 64px;
  }

  .active-toggle-switch {
    width: 60px;
    height: 28px;
  }

  .active-toggle-switch::after {
    width: 18px;
    height: 18px;
  }

  .active-toggle-input:checked + .active-toggle-switch::after {
    transform: translateX(32px);
  }

  .row-actions .btn-danger-soft {
    min-height: 32px;
    padding: 0 8px;
    font-size: 0.72rem;
  }
}

@media (min-width: 1181px) and (max-height: 900px) {
  .workspace-kicker::after {
    content: "";
    color: #7feeff;
    margin-left: 8px;
  }

  .workspace-page,
  .workspace-page-auth {
    padding: 10px;
  }

  .workspace-frame {
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
    height: calc(100vh - 20px);
    max-height: calc(100vh - 20px);
    padding: 12px;
    border-radius: 20px;
  }

  .workspace-shell {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .workspace-terminal,
  .workspace-stats {
    display: none;
  }

  .workspace-header {
    align-items: center;
    gap: 10px;
  }

  .workspace-brand {
    max-width: none;
  }

  .workspace-kicker {
    font-size: 0.64rem;
    margin-bottom: 2px;
  }

  .workspace-title {
    font-size: clamp(1.3rem, 1.8vw, 2rem);
    margin-bottom: 0;
  }

  .workspace-header-actions {
    gap: 6px;
    flex: 0 1 720px;
  }

  .action-link,
  .btn {
    min-height: 34px;
    padding: 0 10px;
    border-radius: 10px;
    font-size: 0.84rem;
  }

  .workspace-toolbar,
  .workspace-table-card {
    padding: 10px;
    border-radius: 16px;
  }

  .workspace-section-title {
    margin-bottom: 6px;
    font-size: 0.64rem;
  }

  .toolbar-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(130px, 0.7fr) minmax(130px, 0.7fr) auto;
    gap: 8px;
  }

  .label {
    margin-bottom: 4px;
    font-size: 0.64rem;
  }

  .input,
  .select {
    min-height: 34px;
    padding: 0 10px;
    border-radius: 10px;
  }

  .toolbar-actions {
    gap: 6px;
  }

  .workspace-table-card {
    flex: 1 1 auto;
    min-height: 0;
  }

  .table-wrap {
    --sticky-actions-width: 126px;
    --sticky-status-width: 82px;
    --sticky-total-width: 70px;
    --sticky-price-width: 74px;
    --product-column-width: 154px;
    --stock-column-width: 84px;
    flex: 1 1 auto;
    min-height: 0;
  }

  .warehouse-table {
    min-width: max(100%, calc(540px + (var(--warehouse-count, 3) * var(--stock-column-width))));
  }

  .warehouse-table thead th,
  .warehouse-table tbody td {
    padding: 7px 8px;
  }

  .stock-input,
  .price-input {
    min-height: 28px;
    width: min(62px, 100%) !important;
    max-width: 62px !important;
    padding: 0 5px;
    font-size: 0.86rem;
  }

  .total-badge,
  .status-badge,
  .row-status {
    min-width: 52px;
    padding: 4px 7px;
    font-size: 0.68rem;
  }

  .active-toggle {
    width: 58px !important;
    min-width: 58px;
    max-width: 58px;
    min-height: 30px;
  }

  .active-toggle-switch {
    width: 54px;
    height: 24px;
  }

  .active-toggle-switch::before {
    font-size: 0.5rem;
  }

  .active-toggle-switch::after {
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
  }

  .active-toggle-input:checked + .active-toggle-switch::after {
    transform: translateX(30px);
  }

  .row-actions {
    gap: 6px;
  }

  .row-actions .btn-danger-soft {
    min-height: 28px;
    padding: 0 7px;
    font-size: 0.68rem;
  }
}

@media (max-width: 980px) {
  .workspace-page,
  .workspace-page-auth {
    padding: 12px;
  }

  .workspace-frame {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    height: calc(100vh - 24px);
    max-height: calc(100vh - 24px);
    padding: 16px;
  }

  .workspace-frame-auth {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
    padding: 18px;
  }

  .workspace-stats {
    grid-template-columns: 1fr;
  }

  .workspace-toast-stack {
    top: 12px;
    right: 12px;
    width: calc(100vw - 24px);
  }

  .workspace-toast {
    grid-template-columns: 1fr;
  }

  .workspace-toast-actions {
    justify-content: flex-start;
  }

  .toolbar-grid {
    grid-template-columns: 1fr;
  }

  .auth-modal-shell,
  .auth-modal-dialog-compact {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
  }

  .auth-modal-dialog {
    padding: 18px;
  }

  td.product-cell {
    min-width: var(--product-column-width);
  }
}

@keyframes cyber-grid-drift {
  from {
    transform: perspective(1200px) rotateX(68deg) scale(1.4) translate3d(0, 24%, 0);
  }
  to {
    transform: perspective(1200px) rotateX(68deg) scale(1.46) translate3d(0, 28%, 0);
  }
}

@keyframes scanline-sweep {
  from {
    background-position: 0 -220px;
  }
  to {
    background-position: 0 220px;
  }
}

@keyframes neon-orb-left {
  from {
    transform: translate3d(-2%, -1%, 0) scale(1);
  }
  to {
    transform: translate3d(4%, 3%, 0) scale(1.14);
  }
}

@keyframes neon-orb-right {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(-4%, -3%, 0) scale(1.12);
  }
}

@media (prefers-reduced-motion: reduce) {
  body::before,
  body::after,
  .workspace-page::before,
  .workspace-page::after {
    animation: none !important;
  }
}

/* Cyberpunk intensifier */
.workspace-frame {
  box-shadow:
    var(--shadow-xl),
    0 0 0 1px rgba(255, 107, 26, 0.08),
    0 0 90px rgba(255, 107, 26, 0.08),
    0 0 140px rgba(0, 232, 255, 0.04);
}

.workspace-kicker,
.workspace-section-title {
  text-shadow: 0 0 10px rgba(255, 107, 26, 0.28);
}

.workspace-title {
  text-shadow:
    0 0 18px rgba(255, 107, 26, 0.08),
    0 0 36px rgba(255, 255, 255, 0.04);
}

.workspace-title {
  position: relative;
  display: inline-block;
  animation: title-glitch-base 8s steps(1, end) infinite;
}

.workspace-title::before,
.workspace-title::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
}

.workspace-title::before {
  color: rgba(0, 232, 255, 0.9);
  text-shadow: 0 0 12px rgba(0, 232, 255, 0.35);
  animation: title-glitch-cyan 8s steps(1, end) infinite;
}

.workspace-title::after {
  color: rgba(255, 70, 108, 0.82);
  text-shadow: 0 0 12px rgba(255, 70, 108, 0.28);
  animation: title-glitch-red 8s steps(1, end) infinite;
}

.workspace-hero,
.workspace-toolbar,
.workspace-table-card,
.workspace-stat,
.workspace-permissions-card {
  box-shadow:
    var(--shadow-lg),
    inset 0 0 0 1px rgba(255, 255, 255, 0.01),
    inset 0 0 32px rgba(0, 232, 255, 0.02);
}

.workspace-hero {
  box-shadow:
    var(--shadow-lg),
    inset 0 0 30px rgba(0, 232, 255, 0.03),
    0 0 40px rgba(255, 107, 26, 0.05);
}

.workspace-hero-tag {
  text-shadow: 0 0 14px rgba(46, 230, 166, 0.24);
}

.workspace-hero-title,
.workspace-stat-value,
.workspace-status-static {
  text-shadow: 0 0 14px rgba(255, 255, 255, 0.05);
}

.workspace-stat {
  position: relative;
  overflow: hidden;
}

.workspace-stat::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: linear-gradient(180deg, rgba(255, 107, 26, 0.92), rgba(0, 232, 255, 0.62));
  box-shadow: 0 0 18px rgba(255, 107, 26, 0.35);
}

.action-link,
.btn {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.action-link:hover,
.btn:hover {
  box-shadow:
    0 0 0 1px rgba(255, 107, 26, 0.12),
    0 10px 24px rgba(0, 0, 0, 0.28),
    0 0 28px rgba(255, 107, 26, 0.16);
}

.btn-primary {
  box-shadow:
    0 0 26px rgba(255, 107, 26, 0.18),
    inset 0 0 18px rgba(255, 107, 26, 0.06);
}

.input:focus,
.select:focus,
.stock-input:focus,
.price-input:focus {
  box-shadow:
    0 0 0 0.2rem rgba(255, 107, 26, 0.12),
    0 0 26px rgba(255, 107, 26, 0.12);
}

.workspace-toast {
  overflow: hidden;
}

.workspace-toast::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, rgba(255, 107, 26, 0.9), rgba(0, 232, 255, 0.7));
  box-shadow: 0 0 16px rgba(255, 107, 26, 0.35);
}

.workspace-toast.is-success {
  box-shadow:
    0 18px 60px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(46, 230, 166, 0.08),
    0 0 34px rgba(46, 230, 166, 0.12);
}

.workspace-toast.is-error {
  box-shadow:
    0 18px 60px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 70, 108, 0.08),
    0 0 34px rgba(255, 70, 108, 0.12);
}

.workspace-toast.is-info {
  box-shadow:
    0 18px 60px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 107, 26, 0.08),
    0 0 34px rgba(255, 107, 26, 0.12);
}

/* Stronger animated cyber background */
body::before {
  opacity: 0.38;
  background:
    linear-gradient(rgba(0, 232, 255, 0.11) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 232, 255, 0.09) 1px, transparent 1px);
  background-size: 48px 48px;
  animation-duration: 8s;
}

body::after {
  opacity: 0.62;
  background-size: 100% 160px;
  animation-duration: 4.5s;
}

.workspace-page::before {
  opacity: 0.48;
  filter: blur(92px);
  animation-duration: 6.5s;
}

.workspace-page::after {
  opacity: 0.4;
  filter: blur(96px);
  animation-duration: 7.5s;
}

#container::before,
#container::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

#container::before {
  opacity: 0.32;
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0 120px,
      rgba(0, 232, 255, 0.08) 120px 122px,
      transparent 122px 220px
    );
  mask-image: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.9) 22%, rgba(0, 0, 0, 0.9) 100%);
  animation: data-lines-drift 10s linear infinite;
}

#container::after {
  opacity: 0.28;
  background:
    radial-gradient(circle at 18% 30%, rgba(255, 107, 26, 0.24), transparent 24rem),
    radial-gradient(circle at 82% 70%, rgba(0, 232, 255, 0.18), transparent 22rem);
  animation: background-pulse 6s ease-in-out infinite alternate;
}

.workspace-frame {
  animation: frame-pulse 3.8s ease-in-out infinite alternate;
}

.workspace-page::before {
  opacity: 0.62;
  filter: blur(112px);
  animation-duration: 5.4s;
}

.workspace-page::after {
  opacity: 0.5;
  filter: blur(118px);
  animation-duration: 6s;
}

@keyframes data-lines-drift {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(48px);
  }
}

@keyframes background-pulse {
  from {
    opacity: 0.18;
    filter: saturate(100%);
  }
  to {
    opacity: 0.34;
    filter: saturate(132%);
  }
}

@keyframes frame-pulse {
  from {
    box-shadow:
      var(--shadow-xl),
      0 0 0 1px rgba(255, 107, 26, 0.08),
      0 0 90px rgba(255, 107, 26, 0.08),
      0 0 140px rgba(0, 232, 255, 0.04);
  }
  to {
    box-shadow:
      var(--shadow-xl),
      0 0 0 1px rgba(255, 107, 26, 0.14),
      0 0 130px rgba(255, 107, 26, 0.16),
      0 0 210px rgba(0, 232, 255, 0.09);
  }
}

@keyframes title-glitch-base {
  0%, 95%, 100% {
    transform: none;
    filter: none;
  }
  96% {
    transform: translateX(1px);
    filter: brightness(1.08);
  }
  97% {
    transform: translateX(-1px);
    filter: brightness(1.12);
  }
  98% {
    transform: translateY(1px);
    filter: none;
  }
}

@keyframes title-glitch-cyan {
  0%, 95%, 100% {
    opacity: 0;
    transform: translate(0);
    clip-path: inset(0 0 0 0);
  }
  96% {
    opacity: 0.7;
    transform: translate(3px, -1px);
    clip-path: inset(0 0 58% 0);
  }
  97% {
    opacity: 0.55;
    transform: translate(-4px, 1px);
    clip-path: inset(42% 0 16% 0);
  }
  98% {
    opacity: 0.3;
    transform: translate(2px, 0);
    clip-path: inset(76% 0 0 0);
  }
}

@keyframes title-glitch-red {
  0%, 95%, 100% {
    opacity: 0;
    transform: translate(0);
    clip-path: inset(0 0 0 0);
  }
  96% {
    opacity: 0.55;
    transform: translate(-3px, 1px);
    clip-path: inset(18% 0 44% 0);
  }
  97% {
    opacity: 0.7;
    transform: translate(4px, -1px);
    clip-path: inset(62% 0 6% 0);
  }
  98% {
    opacity: 0.28;
    transform: translate(-2px, 0);
    clip-path: inset(0 0 74% 0);
  }
}

@keyframes neon-orb-left {
  from {
    transform: translate3d(-5%, -2%, 0) scale(0.98);
  }
  to {
    transform: translate3d(8%, 6%, 0) scale(1.26);
  }
}

@keyframes neon-orb-right {
  from {
    transform: translate3d(2%, 1%, 0) scale(0.96);
  }
  to {
    transform: translate3d(-7%, -5%, 0) scale(1.22);
  }
}

@media (prefers-reduced-motion: reduce) {
  #container::before,
  #container::after,
  .workspace-frame,
  .workspace-title,
  .workspace-title::before,
  .workspace-title::after {
    animation: none !important;
  }
}

/* Login */
.login-page {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(460px, calc(100vw - 32px));
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(8, 10, 20, 0.98), rgba(10, 14, 24, 0.96));
  border: 1px solid rgba(255, 107, 26, 0.18);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.52),
    0 0 0 1px rgba(255, 107, 26, 0.06),
    0 0 72px rgba(0, 232, 255, 0.08);
}

.login-card-cyber {
  position: relative;
}

.login-card-cyber::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: 34px 34px;
  opacity: 0.16;
}

.login-card-cyber::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow:
    inset 0 0 0 1px rgba(0, 232, 255, 0.05),
    inset 0 0 36px rgba(0, 232, 255, 0.04);
}

.login-card-header {
  padding: 20px 22px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(255, 107, 26, 0.14);
  background: linear-gradient(180deg, rgba(10, 14, 24, 0.96), rgba(7, 10, 18, 0.88));
}

.login-card-header-cyber {
  position: relative;
  z-index: 1;
}

.login-header-copy {
  display: grid;
  gap: 6px;
}

.login-kicker {
  color: var(--accent);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 800;
  text-shadow: 0 0 10px rgba(255, 107, 26, 0.28);
}

.login-brand {
  margin: 0;
  color: #fff7ed;
  font-size: 1.7rem;
  line-height: 0.98;
  font-weight: 800;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  text-shadow:
    0 0 18px rgba(255, 107, 26, 0.08),
    0 0 32px rgba(255, 255, 255, 0.04);
}

.login-glow-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #2ee6a6;
  box-shadow:
    0 0 12px rgba(46, 230, 166, 0.8),
    0 0 24px rgba(46, 230, 166, 0.34);
  animation: terminal-led-pulse 1.8s ease-in-out infinite;
}

.login-card-body {
  padding: 22px;
}

.login-card-body-cyber {
  position: relative;
  z-index: 1;
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-card .auth-field {
  gap: 8px;
}

.login-card .auth-label {
  color: #ffd4bb;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-card input[type="text"],
.login-card input[type="password"] {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(0, 232, 255, 0.16);
  background: rgba(7, 9, 16, 0.94);
  color: #fff7ef;
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.login-card input[type="text"]:focus,
.login-card input[type="password"]:focus {
  border-color: rgba(255, 107, 26, 0.55);
  box-shadow:
    0 0 0 0.18rem rgba(255, 107, 26, 0.12),
    0 0 26px rgba(255, 107, 26, 0.12);
}

.login-actions {
  display: flex;
  justify-content: center;
  padding-top: 8px;
}

.login-submit {
  min-width: 140px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 14px;
}

.login-submit:hover {
  box-shadow:
    0 0 0 1px rgba(255, 107, 26, 0.12),
    0 10px 24px rgba(0, 0, 0, 0.28),
    0 0 28px rgba(255, 107, 26, 0.16);
}

.workspace-terminal {
  position: relative;
  overflow: hidden;
  padding: 6px 8px;
  border-radius: 12px;
  border: 1px solid rgba(0, 232, 255, 0.18);
  background:
    linear-gradient(180deg, rgba(6, 10, 18, 0.96), rgba(6, 12, 20, 0.92));
  box-shadow:
    var(--shadow-lg),
    inset 0 0 0 1px rgba(0, 232, 255, 0.03),
    inset 0 0 32px rgba(0, 232, 255, 0.04),
    0 0 30px rgba(0, 232, 255, 0.06);
}

.workspace-terminal::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(
      180deg,
      transparent 0%,
      rgba(0, 232, 255, 0.03) 48%,
      rgba(255, 255, 255, 0.04) 50%,
      rgba(0, 232, 255, 0.03) 52%,
      transparent 100%
    );
  background-size: 100% 160px;
  mix-blend-mode: screen;
  animation: terminal-scan 5.5s linear infinite;
}

.workspace-terminal::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0 72px,
      rgba(0, 232, 255, 0.05) 72px 73px,
      transparent 73px 144px
    );
  opacity: 0.22;
}

.workspace-terminal-header,
.workspace-terminal-grid {
  position: relative;
  z-index: 1;
}

.workspace-terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.workspace-terminal-title {
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 800;
  color: #7feeff;
  text-shadow: 0 0 12px rgba(0, 232, 255, 0.28);
}

.workspace-terminal-led {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #2ee6a6;
  box-shadow:
    0 0 10px rgba(46, 230, 166, 0.75),
    0 0 22px rgba(46, 230, 166, 0.35);
  animation: terminal-led-pulse 1.8s ease-in-out infinite;
}

.workspace-terminal-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px 6px;
}

.workspace-terminal-line {
  display: grid;
  gap: 1px;
  padding: 4px 6px;
  border-radius: 8px;
  border: 1px solid rgba(0, 232, 255, 0.08);
  background: rgba(6, 12, 20, 0.54);
}

.workspace-terminal-line-wide {
  grid-column: span 4;
}

.workspace-terminal-key {
  font-size: 0.54rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #6c7890;
}

.workspace-terminal-value {
  color: #ecf8ff;
  font-size: 0.72rem;
  font-weight: 700;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.04);
}

.workspace-toolbar {
  position: relative;
  z-index: 3;
}

.workspace-terminal-value.is-success {
  color: #9fffd7;
  text-shadow: 0 0 12px rgba(46, 230, 166, 0.24);
}

.workspace-session-timer {
  min-width: 3.5rem;
  font-variant-numeric: tabular-nums;
}

.workspace-session-timer.is-warning {
  color: #ffe36f !important;
}

.workspace-session-timer.is-danger {
  color: #ff8d95 !important;
}

@keyframes terminal-scan {
  from {
    background-position: 0 -160px;
  }
  to {
    background-position: 0 160px;
  }
}

@keyframes terminal-led-pulse {
  0%, 100% {
    opacity: 0.72;
    transform: scale(0.92);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

@media (max-width: 980px) {
  .workspace-terminal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace-terminal-line-wide {
    grid-column: 1 / -1;
  }

  .product-create-form {
    grid-template-columns: 1fr;
  }
}

.logs-shell {
  grid-template-rows: auto auto auto minmax(0, 1fr);
}

.workspace-messages {
  display: grid;
  gap: 10px;
}

.workspace-message {
  padding: 12px 14px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--text-main);
  font-weight: 700;
}

.workspace-message.success {
  border-color: rgba(46, 230, 166, 0.32);
  background: rgba(46, 230, 166, 0.12);
}

.workspace-message.error {
  border-color: rgba(255, 70, 108, 0.32);
  background: rgba(255, 70, 108, 0.12);
}

.logs-table-card {
  min-height: 0;
}

.inventory-log-table {
  width: 100%;
  min-width: 920px;
  border-collapse: separate;
  border-spacing: 0;
  color: #f4f4f5;
  background: transparent;
}

.inventory-log-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.11);
  background:
    linear-gradient(180deg, rgba(43, 44, 48, 0.98), rgba(31, 32, 35, 0.98));
  color: rgba(214, 217, 224, 0.72);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
}

.inventory-log-table tbody td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(19, 20, 23, 0.72);
  color: rgba(244, 244, 245, 0.88);
  vertical-align: middle;
}

.inventory-log-table tbody tr:nth-child(even) td {
  background: rgba(28, 29, 32, 0.74);
}

.inventory-log-table tbody tr:hover td {
  background: rgba(47, 48, 52, 0.78);
}

.inventory-log-table tbody td:first-child {
  color: rgba(214, 217, 224, 0.64);
}

.inventory-log-table .product-cell {
  background:
    linear-gradient(90deg, rgba(8, 10, 15, 0.96), rgba(14, 16, 22, 0.9)) !important;
  color: #f4f4f5;
  font-weight: 800;
}

.inventory-log-table tbody tr:hover .product-cell {
  background:
    linear-gradient(90deg, rgba(20, 21, 25, 0.98), rgba(29, 30, 34, 0.92)) !important;
}

.inventory-log-table .muted {
  color: rgba(214, 217, 224, 0.48);
}

.inventory-log-table .btn-ghost {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.045);
  color: rgba(244, 244, 245, 0.72);
}

.inventory-log-table .btn-ghost:hover:not(:disabled) {
  border-color: rgba(255, 177, 81, 0.3);
  background: rgba(255, 177, 81, 0.1);
  color: #fff;
}

.nowrap {
  white-space: nowrap;
}

.log-change-list {
  display: grid;
  gap: 8px;
  min-width: 220px;
}

.log-change {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 10px;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.log-change-label {
  color: var(--text-soft);
}

.log-change-values {
  color: var(--accent-alt);
  font-weight: 800;
  white-space: nowrap;
}

/* Promo side panel layout */
.workspace-matrix-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
  flex: 1 1 auto;
  align-items: start;
  position: relative;
  overflow: visible;
}

.workspace-matrix-layout.has-promo-side-panel {
  grid-template-columns: minmax(0, 1fr) 340px;
}

.workspace-matrix-layout .workspace-table-card {
  height: 100%;
  grid-row: auto;
  min-width: 0;
  align-self: stretch;
}

.promo-side-panel {
  --promo-panel-scale: 1;
  --promo-panel-inverse-scale: 1;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 0;
  padding: 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(10, 13, 24, 0.96), rgba(10, 14, 24, 0.9));
  box-shadow:
    var(--shadow-lg),
    inset 0 0 0 1px rgba(255, 255, 255, 0.01),
    inset 0 0 32px rgba(0, 232, 255, 0.02);
  overflow: hidden;
  position: sticky;
  top: 14px;
  align-self: start;
}

.promo-side-panel-content {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
  min-height: 100%;
}

.workspace-matrix-layout.is-promo-floating {
  display: block;
}

.workspace-matrix-layout.is-promo-floating .promo-side-panel {
  position: fixed;
  top: 14px;
  left: 14px;
  width: 360px;
  height: 560px;
  max-width: calc(100vw - 16px);
  max-height: calc(100vh - 16px);
  z-index: 40;
  cursor: default;
  transition: opacity 0.14s ease, box-shadow 0.14s ease, filter 0.14s ease;
}

.workspace-matrix-layout.is-promo-floating .promo-side-panel-content {
  width: calc(100% * var(--promo-panel-inverse-scale));
  min-height: calc(100% * var(--promo-panel-inverse-scale));
  transform: scale(var(--promo-panel-scale));
  transform-origin: top left;
}

.workspace-matrix-layout.is-promo-floating .promo-side-panel.is-panel-dragging {
  opacity: 0.9;
  filter: saturate(1.08);
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.48),
    0 0 0 1px rgba(0, 232, 255, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.workspace-matrix-layout.is-promo-floating .workspace-table-card {
  min-width: 0;
}

.telegram-bindings-toolbar {
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1.1fr) minmax(180px, 220px) minmax(180px, 220px) auto;
}

.telegram-bindings-wrap {
  overflow: auto;
}

.telegram-bindings-table {
  width: 100%;
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.telegram-bindings-table thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 14px 12px;
  background: rgba(7, 10, 19, 0.99);
  color: #7feeff;
  border-bottom: 1px solid rgba(0, 232, 255, 0.42);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  text-align: left;
  text-shadow: 0 0 10px rgba(0, 232, 255, 0.25);
}

.telegram-bindings-table thead th:first-child {
  border-top-left-radius: 14px;
}

.telegram-bindings-table thead th:last-child {
  border-top-right-radius: 14px;
}

.telegram-bindings-table th,
.telegram-bindings-table td {
  vertical-align: middle;
}

.telegram-bindings-table tbody td {
  padding: 12px;
  border-top: 1px solid rgba(0, 232, 255, 0.12);
  background: #0b111b;
  color: var(--text-main);
}

.telegram-bindings-table tbody tr:nth-child(even) td {
  background: #0d1420;
}

.telegram-bindings-table tbody tr:hover td {
  background: #11202a;
}

.telegram-bindings-table .product-cell {
  background: #0b111b;
  color: #fff7ef;
  font-weight: 700;
}

.telegram-bindings-table tbody tr:nth-child(even) .product-cell {
  background: #0d1420;
}

.telegram-bindings-table tbody tr:hover .product-cell {
  background: #11202a;
}

.telegram-bindings-table td:last-child,
.telegram-bindings-table th:last-child {
  text-align: center;
}

.telegram-bindings-table .btn {
  min-width: 84px;
}

.telegram-bindings-table .muted {
  text-align: center;
  color: var(--text-soft);
}

.binding-app-id {
  max-width: 360px;
  word-break: break-word;
}

.binding-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.95fr);
  gap: 18px;
}

.binding-detail-card,
.binding-actions-card {
  min-height: 100%;
}

.binding-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.binding-meta-item-wide {
  grid-column: 1 / -1;
}

.binding-meta-item,
.binding-code-card,
.binding-action-card {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(0, 232, 255, 0.14);
  background:
    linear-gradient(180deg, rgba(10, 14, 25, 0.96), rgba(9, 13, 22, 0.88));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.02),
    0 18px 42px rgba(0, 0, 0, 0.26);
}

.binding-meta-label,
.binding-code-title,
.binding-action-title {
  margin-bottom: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7cefff;
}

.binding-meta-value {
  font-size: 1rem;
  line-height: 1.45;
  color: var(--text-main);
}

.binding-code-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.binding-code-count + .binding-code-count {
  margin-top: 6px;
}

.binding-code-state {
  margin-top: 12px;
}

.binding-code-count {
  color: var(--text-main);
}

.binding-action-stack {
  display: grid;
  gap: 14px;
}

.binding-action-text {
  margin: 0 0 14px;
  color: var(--text-soft);
  line-height: 1.5;
}

.binding-inline-check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  color: var(--text-soft);
}

.binding-action-card .btn,
.binding-action-card .input,
.binding-action-card .binding-textarea {
  width: 100%;
}

.binding-action-card .label {
  display: inline-block;
  margin-bottom: 8px;
}

.binding-textarea {
  min-height: 92px;
  resize: vertical;
}

@media (max-width: 1520px) {
  .telegram-bindings-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .binding-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .binding-meta-grid,
  .binding-code-grid {
    grid-template-columns: 1fr;
  }
}

.promo-panel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.promo-panel-drag-handle {
  margin-bottom: 0;
  user-select: none;
  cursor: grab;
}

.promo-panel-drag-handle:active {
  cursor: grabbing;
}

.promo-panel-toolbar-reset {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(0, 232, 255, 0.16);
  background: rgba(10, 14, 24, 0.84);
  color: #c8d7ef;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: 0.18s ease;
}

.promo-panel-toolbar-reset:hover {
  border-color: rgba(255, 107, 26, 0.28);
  color: #fff4ea;
  box-shadow: 0 0 18px rgba(255, 107, 26, 0.1);
}

.promo-side-panel-head {
  display: grid;
  gap: 6px;
}

.promo-side-panel-title {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.1;
  color: #fff7ed;
}

.promo-side-panel-subtitle,
.promo-panel-hint,
.promo-empty-text {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.5;
  font-size: 0.88rem;
}

.promo-side-panel-body {
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.workspace-matrix-layout.is-promo-floating .promo-side-panel-body {
  overflow: hidden;
  padding-right: 0;
}

.promo-panel-resize-handle {
  justify-self: end;
  align-self: end;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  background:
    linear-gradient(135deg, transparent 0 40%, rgba(0, 232, 255, 0.32) 40% 48%, transparent 48% 56%, rgba(0, 232, 255, 0.52) 56% 64%, transparent 64% 72%, rgba(255, 107, 26, 0.68) 72% 80%, transparent 80%);
  cursor: nwse-resize;
  opacity: 0.82;
}

.promo-panel-resize-handle:hover {
  opacity: 1;
  filter: drop-shadow(0 0 8px rgba(0, 232, 255, 0.24));
}

.promo-empty-state,
.promo-panel-fields {
  display: grid;
  gap: 14px;
}

.promo-empty-state[hidden],
.promo-panel-fields[hidden] {
  display: none !important;
}

.promo-empty-state {
  place-content: start;
  padding: 18px;
  border-radius: 16px;
  border: 1px dashed rgba(0, 232, 255, 0.18);
  background: rgba(8, 12, 22, 0.5);
}

.promo-empty-title {
  color: #fff1de;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.promo-panel-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.promo-panel-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(0, 232, 255, 0.12);
  background: rgba(8, 12, 22, 0.72);
}

.promo-panel-stat-label {
  color: var(--text-dim);
  display: block;
  max-width: 88px;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.15;
  text-transform: uppercase;
}

.promo-panel-stat-value {
  color: #fff7ed;
  font-size: 0.96rem;
  font-weight: 800;
  line-height: 1;
  text-align: right;
  white-space: nowrap;
}

.promo-warehouse-stock {
  display: grid;
  gap: 7px;
}

.promo-warehouse-stock-title {
  color: var(--text-dim);
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.promo-warehouse-stock-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  background: rgba(8, 12, 22, 0.42);
}

.promo-warehouse-stock-item {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 9px 10px;
  border-right: 1px solid rgba(255, 255, 255, 0.07);
}

.promo-warehouse-stock-item:last-child {
  border-right: 0;
}

.promo-warehouse-stock-item span {
  overflow: hidden;
  color: var(--text-soft);
  font-size: 0.66rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.promo-warehouse-stock-item strong {
  color: #f5f5f5;
  font-size: 0.94rem;
  line-height: 1.1;
}

.promo-warehouse-stock-item.is-available strong {
  color: #7ee2a8;
}

.promo-warehouse-stock-item.is-low strong {
  color: #f4c96b;
}

.promo-warehouse-stock-item.is-empty strong {
  color: var(--text-dim);
}

.promo-warehouse-stock-item.is-negative strong {
  color: #ff8f8f;
}

.promo-warehouse-stock-empty {
  grid-column: 1 / -1;
  padding: 9px 10px;
  color: var(--text-dim);
  font-size: 0.7rem;
}

.promo-panel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.promo-panel-field {
  display: grid;
  gap: 6px;
}

.promo-panel-field-wide {
  grid-column: 1 / -1;
}

.promo-panel-field .promo-input {
  width: 100% !important;
  max-width: none !important;
  min-width: 0;
  box-sizing: border-box;
}

.promo-calculated-value {
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 0 12px;
  box-sizing: border-box;
  border: 1px solid rgba(0, 232, 255, 0.12);
  border-radius: 10px;
  background: rgba(8, 12, 22, 0.58);
  color: #fff7ed;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1;
}

.promo-panel-live-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(0, 232, 255, 0.14);
  border-radius: 16px;
  background: rgba(10, 15, 26, 0.78);
}

.promo-panel-live-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.promo-panel-live-title {
  color: #f3f7ff;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.promo-panel-live-caption {
  color: var(--text-soft);
  font-size: 0.72rem;
  line-height: 1.45;
}

.promo-panel-live-toggle {
  justify-content: flex-end;
  width: 64px;
  min-width: 64px;
  max-width: 64px;
}

.promo-panel-live-toggle .active-toggle-switch {
  width: 60px;
  height: 28px;
}

.promo-panel-live-toggle .active-toggle-switch::after {
  width: 18px;
  height: 18px;
}

.promo-panel-live-toggle .active-toggle-input:checked + .active-toggle-switch::after {
  transform: translateX(32px);
}

.promo-side-progress {
  display: grid;
  gap: 8px;
}

.promo-summary-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 0 8px;
  min-height: 30px;
  border-radius: 14px;
  border: 1px solid rgba(0, 232, 255, 0.14);
  background: rgba(8, 12, 22, 0.72);
  color: #eaf2ff;
  cursor: pointer;
  transition: 0.18s ease;
}

.promo-summary-button:hover {
  border-color: rgba(255, 107, 26, 0.34);
  box-shadow: 0 0 18px rgba(255, 107, 26, 0.1);
  transform: translateY(-1px);
}

.promo-summary-button.is-active {
  border-color: rgba(255, 107, 26, 0.32);
  background: rgba(39, 24, 12, 0.82);
}

.promo-summary-button.is-exhausted {
  border-color: rgba(255, 70, 108, 0.3);
  background: rgba(43, 13, 21, 0.82);
}

.promo-summary-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: #fff7ef;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.promo-summary-meta {
  color: var(--text-soft);
  font-size: 0.62rem;
  font-weight: 700;
  white-space: nowrap;
}

.promo-summary-cell {
  text-align: center;
}

.col-promo-summary {
  width: 64px;
}

.table-wrap,
body.workspace-compact .table-wrap {
  --sticky-promo-label-width: 0px;
  --sticky-promo-price-width: 0px;
  --sticky-promo-limit-width: 0px;
  --sticky-promo-progress-width: 0px;
  --sticky-promo-toggle-width: 0px;
}

.warehouse-table tbody tr.is-panel-selected td {
  background: rgba(17, 32, 42, 0.92) !important;
}

.warehouse-table tbody tr.is-panel-selected td:first-child {
  box-shadow: inset 3px 0 0 rgba(255, 107, 26, 0.88);
}

@media (max-width: 1380px) {
  .workspace-matrix-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .workspace-matrix-layout.is-promo-floating {
    display: grid;
  }

  .promo-side-panel {
    order: -1;
  }

  .workspace-matrix-layout.is-promo-floating .promo-side-panel {
    position: sticky;
    top: 14px;
    left: auto;
    width: auto;
    height: auto;
    max-width: none;
    max-height: none;
  }
}

@media (max-width: 980px) {
  .promo-panel-summary,
  .promo-panel-grid {
    grid-template-columns: 1fr;
  }

  .promo-panel-live-row {
    grid-template-columns: 1fr;
  }

  .promo-panel-live-toggle {
    justify-content: flex-start;
  }
}

/* Onion Orders visual alignment.
   This keeps the matrix mechanics intact, but makes the shell match the
   calmer Onion Orders control-center style. */
:root {
  --bg-main: #111214;
  --bg-deep: #141519;
  --bg-grid: rgba(255, 255, 255, 0.035);
  --panel: rgba(255, 255, 255, 0.035);
  --panel-soft: rgba(255, 255, 255, 0.045);
  --panel-card: rgba(255, 255, 255, 0.035);
  --border: rgba(255, 255, 255, 0.08);
  --border-soft: rgba(255, 255, 255, 0.1);
  --text-main: #f5f5f5;
  --text-soft: #a5a8b3;
  --text-dim: #767a84;
  --accent: #f0a85c;
  --accent-soft: rgba(240, 168, 92, 0.12);
  --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 18px 44px rgba(0, 0, 0, 0.18);
  --radius-xl: 22px;
  --radius-lg: 22px;
  --radius-md: 14px;
}

html,
body {
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.05), transparent 28%),
    linear-gradient(145deg, #0d0e10, #141519 55%, #101114);
  color: var(--text-main);
}

body::before,
body::after,
.workspace-frame::before {
  display: none;
}

.workspace-page {
  background: transparent;
}

.workspace-page::before {
  background:
    radial-gradient(circle at 14% 10%, rgba(255, 255, 255, 0.055), transparent 34%),
    radial-gradient(circle at 84% 18%, rgba(126, 226, 168, 0.055), transparent 28%);
  opacity: 1;
  animation: none;
}

.workspace-page::after {
  background:
    linear-gradient(120deg, transparent 0 42%, rgba(255, 255, 255, 0.025) 48%, transparent 56%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent 36%);
  opacity: 1;
  animation: none;
}

.workspace-frame {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: var(--shadow-xl);
}

.workspace-frame::after {
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.workspace-header,
.workspace-terminal,
.workspace-stat,
.workspace-toolbar,
.workspace-table-card,
.promo-side-panel-content,
.modal-card,
.permissions-panel {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.035);
  box-shadow: var(--shadow-lg);
}

.workspace-header {
  align-items: flex-start;
}

.workspace-kicker,
.workspace-section-title,
.toolbar-title,
.form-label,
.matrix-title,
.promo-panel-title,
.permissions-kicker {
  color: #f0a85c;
}

.workspace-title {
  color: #f5f5f5;
  letter-spacing: 0.055em;
  line-height: 0.96;
  text-shadow: none;
}

.workspace-title::before,
.workspace-title::after {
  display: none;
}

.workspace-subtitle,
.workspace-meta,
.workspace-label,
.field-hint,
.promo-panel-text,
.permissions-note,
.empty-state {
  color: var(--text-soft);
}

.action-link,
.btn,
.btn-secondary,
.btn-ghost,
.input,
.select,
.search-input,
.form-control,
.workspace-toolbar input,
.workspace-toolbar select {
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.055);
  color: #f5f5f5;
  box-shadow: none;
}

.action-link:hover,
.btn:hover,
.btn-secondary:hover,
.btn-ghost:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.085);
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-primary,
.workspace-toolbar .btn-primary {
  border-color: rgba(240, 168, 92, 0.38);
  background: rgba(240, 168, 92, 0.16);
  color: #fff7ef;
}

.workspace-stat {
  overflow: hidden;
}

.workspace-stat::before {
  opacity: 0.18;
}

.workspace-stat-value {
  color: #f5f5f5;
}

.table-wrap {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.018);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.table-wrap::-webkit-scrollbar-thumb,
.promo-side-panel-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
}

.table-wrap::-webkit-scrollbar-thumb:hover,
.promo-side-panel-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.32);
}

.warehouse-table thead th {
  background: rgba(27, 28, 32, 0.98);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #8feaf2;
}

.warehouse-table tbody td {
  background: rgba(17, 18, 22, 0.78);
  border-color: rgba(255, 255, 255, 0.09);
}

.warehouse-table tbody tr:nth-child(even) td {
  background: rgba(22, 23, 28, 0.78);
}

.warehouse-table tbody tr:hover td {
  background: rgba(36, 38, 44, 0.84);
}

.warehouse-table tbody td:first-child,
.warehouse-table thead th:first-child {
  background: rgba(24, 25, 30, 0.98);
}

.warehouse-table tbody tr.is-panel-selected td {
  background: rgba(42, 45, 50, 0.9) !important;
}

.warehouse-table tbody tr.is-panel-selected td:first-child {
  box-shadow: inset 3px 0 0 rgba(240, 168, 92, 0.9);
}

.cell-total .total-pill,
.status-pill,
.promo-summary-card,
.promo-panel-summary-card,
.promo-progress-card {
  box-shadow: none;
}

.promo-side-panel-content {
  backdrop-filter: blur(18px);
}

.promo-panel-progress-fill {
  background: linear-gradient(90deg, rgba(240, 168, 92, 0.8), rgba(126, 226, 168, 0.78));
}

/* Final matrix polish: remove legacy cyber fills that conflict with Onion UI. */
.workspace-table-card {
  background:
    radial-gradient(circle at 10% 0%, rgba(255, 255, 255, 0.035), transparent 28%),
    rgba(255, 255, 255, 0.03) !important;
}

.matrix-title {
  color: #f0a85c !important;
  text-shadow: none !important;
}

.table-wrap,
.table-wrap.has-many-warehouses {
  border-color: rgba(255, 255, 255, 0.1) !important;
  background: rgba(17, 18, 20, 0.84) !important;
  background-image: none !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035) !important;
  scrollbar-color: rgba(255, 255, 255, 0.28) rgba(255, 255, 255, 0.06) !important;
}

.warehouse-table {
  border-spacing: 0 !important;
  background: #15161a !important;
}

.warehouse-table thead th,
.warehouse-table thead .th-price,
.warehouse-table thead .th-total,
.warehouse-table thead .th-status,
.warehouse-table thead .th-actions,
.warehouse-table thead .th-promo-summary {
  background: #1b1c20 !important;
  background-image: none !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #9be8ee !important;
  text-shadow: none !important;
  box-shadow: none !important;
}

.warehouse-table tbody td,
.warehouse-table tbody td.product-cell,
.warehouse-table tbody .warehouse-price-cell,
.warehouse-table tbody .total-cell,
.warehouse-table tbody .status-cell,
.warehouse-table tbody .row-actions-cell,
.warehouse-table tbody .promo-summary-cell {
  background-color: #18191d !important;
  background-image: none !important;
  border-color: rgba(255, 255, 255, 0.09) !important;
  color: #f5f5f5 !important;
  text-shadow: none !important;
}

.warehouse-table tbody tr:nth-child(even) td,
.warehouse-table tbody tr:nth-child(even) td.product-cell,
.warehouse-table tbody tr:nth-child(even) .warehouse-price-cell,
.warehouse-table tbody tr:nth-child(even) .total-cell,
.warehouse-table tbody tr:nth-child(even) .status-cell,
.warehouse-table tbody tr:nth-child(even) .row-actions-cell,
.warehouse-table tbody tr:nth-child(even) .promo-summary-cell,
.workspace-table-card .warehouse-table tbody tr:nth-child(even) .row-actions-cell {
  background-color: #202126 !important;
  background-image: none !important;
}

.warehouse-table tbody tr:hover td,
.warehouse-table tbody tr:hover td.product-cell,
.warehouse-table tbody tr:hover .warehouse-price-cell,
.warehouse-table tbody tr:hover .total-cell,
.warehouse-table tbody tr:hover .status-cell,
.warehouse-table tbody tr:hover .row-actions-cell,
.warehouse-table tbody tr:hover .promo-summary-cell,
.workspace-table-card .warehouse-table tbody tr:hover .row-actions-cell {
  background-color: #292b31 !important;
  background-image: none !important;
}

.warehouse-table tbody tr.is-panel-selected td,
.warehouse-table tbody tr.is-panel-selected td.product-cell,
.warehouse-table tbody tr.is-panel-selected .warehouse-price-cell,
.warehouse-table tbody tr.is-panel-selected .total-cell,
.warehouse-table tbody tr.is-panel-selected .status-cell,
.warehouse-table tbody tr.is-panel-selected .row-actions-cell,
.warehouse-table tbody tr.is-panel-selected .promo-summary-cell {
  background-color: #2d3036 !important;
  background-image: none !important;
}

.warehouse-table tbody td.product-cell,
.row-actions-cell,
.status-cell,
.total-cell,
.warehouse-price-cell {
  box-shadow: none !important;
}

.warehouse-table tbody td.product-cell {
  font-weight: 800;
}

.stock-input,
.price-input,
.promo-input,
.promo-panel-input,
.workspace-toolbar input,
.workspace-toolbar select {
  background: rgba(10, 11, 14, 0.88) !important;
  border-color: rgba(255, 255, 255, 0.28) !important;
  color: #f5f5f5 !important;
}

.stock-input:focus,
.price-input:focus,
.promo-input:focus,
.promo-panel-input:focus,
.workspace-toolbar input:focus,
.workspace-toolbar select:focus {
  border-color: rgba(255, 255, 255, 0.58) !important;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08) !important;
}

.promo-summary-card,
.promo-panel-stat,
.promo-panel-live-row,
.promo-progress-card,
.promo-empty-state {
  background: rgba(255, 255, 255, 0.045) !important;
  border-color: rgba(255, 255, 255, 0.09) !important;
  box-shadow: none !important;
}

.promo-side-panel {
  border-color: rgba(255, 255, 255, 0.1) !important;
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 255, 255, 0.05), transparent 32%),
    rgba(19, 20, 24, 0.94) !important;
  box-shadow: 0 22px 62px rgba(0, 0, 0, 0.34) !important;
}

.promo-side-panel-content {
  background: transparent !important;
  box-shadow: none !important;
}

.promo-side-panel-title,
.promo-empty-title,
.promo-panel-live-title,
.promo-panel-stat-value {
  color: #f5f5f5 !important;
  text-shadow: none !important;
}

.promo-side-panel-subtitle,
.promo-panel-hint,
.promo-empty-text,
.promo-panel-live-caption,
.promo-panel-stat-label {
  color: #a5a8b3 !important;
}

.promo-panel-toolbar-reset,
.btn-danger,
.delete-button {
  border-color: rgba(255, 117, 117, 0.26) !important;
  background: rgba(255, 117, 117, 0.08) !important;
}

/* Onion parity pass: remove remaining blue/cyan accents and match the page floor. */
body,
html,
.workspace-page {
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.05), transparent 28%),
    linear-gradient(145deg, #0d0e10, #141519 55%, #101114) !important;
}

.workspace-frame,
.workspace-shell,
.workspace-header,
.workspace-terminal,
.workspace-stat,
.workspace-toolbar,
.workspace-table-card,
.promo-side-panel {
  background-color: rgba(255, 255, 255, 0.03) !important;
  background-image: none !important;
}

.workspace-page::before {
  background:
    radial-gradient(circle at 14% 8%, rgba(255, 255, 255, 0.055), transparent 30%),
    radial-gradient(circle at 86% 18%, rgba(255, 255, 255, 0.035), transparent 28%) !important;
}

.workspace-page::after {
  background: linear-gradient(145deg, transparent, rgba(255, 255, 255, 0.018), transparent) !important;
}

.workspace-header-actions .action-link,
.action-link {
  border-color: rgba(255, 255, 255, 0.1) !important;
  background: rgba(255, 255, 255, 0.055) !important;
  color: #d8dbe2 !important;
}

.workspace-header-actions .action-link:hover,
.action-link:hover {
  border-color: rgba(255, 255, 255, 0.2) !important;
  background: rgba(255, 255, 255, 0.09) !important;
  color: #ffffff !important;
}

.workspace-kicker,
.workspace-section-title,
.toolbar-title,
.matrix-title,
.promo-side-panel-title,
.promo-panel-title,
.form-label,
.permissions-kicker {
  color: #f0a85c !important;
  text-shadow: none !important;
}

.workspace-label,
.warehouse-table thead th,
.warehouse-table thead .th-price,
.warehouse-table thead .th-total,
.warehouse-table thead .th-status,
.warehouse-table thead .th-actions,
.warehouse-table thead .th-promo-summary,
.warehouse-th,
.promo-panel-stat-label,
.promo-panel-label,
.promo-summary-label,
.field-label {
  color: #b7bac3 !important;
  text-shadow: none !important;
}

.table-wrap,
.permissions-table-wrap {
  border-color: rgba(255, 255, 255, 0.08) !important;
}

.warehouse-table thead th,
.warehouse-table thead .th-price,
.warehouse-table thead .th-total,
.warehouse-table thead .th-status,
.warehouse-table thead .th-actions,
.warehouse-table thead .th-promo-summary {
  background-color: #1d1e22 !important;
}

.promo-summary-card,
.promo-summary-pill,
.promo-badge-preview,
.promo-panel-stat,
.promo-panel-live-row,
.promo-progress-card {
  border-color: rgba(255, 255, 255, 0.1) !important;
  background-color: rgba(255, 255, 255, 0.045) !important;
  background-image: none !important;
  color: #f5f5f5 !important;
}

.promo-summary-card::before,
.promo-progress-card::before,
.workspace-stat::before {
  opacity: 0 !important;
}

.promo-panel-resize-handle {
  background:
    linear-gradient(135deg, transparent 0 40%, rgba(255, 255, 255, 0.28) 40% 48%, transparent 48% 56%, rgba(255, 255, 255, 0.46) 56% 64%, transparent 64% 72%, rgba(240, 168, 92, 0.72) 72% 80%, transparent 80%) !important;
}

.promo-panel-resize-handle:hover {
  filter: drop-shadow(0 0 8px rgba(240, 168, 92, 0.2)) !important;
}

.table-wrap::-webkit-scrollbar-thumb,
.promo-side-panel-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22) !important;
  border-color: rgba(17, 18, 20, 0.7) !important;
}

.table-wrap::-webkit-scrollbar-track,
.promo-side-panel-content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04) !important;
}

.btn-primary,
.workspace-toolbar .btn-primary,
.promo-panel-toolbar-reset {
  border-color: rgba(240, 168, 92, 0.35) !important;
  background: rgba(240, 168, 92, 0.14) !important;
  color: #fff7ef !important;
}

/* Last blue leftovers: top audit cards and inline promo pills. */
.workspace-terminal,
.workspace-terminal-cell,
.workspace-terminal-item,
.workspace-terminal-card,
.workspace-terminal .terminal-cell,
.workspace-terminal .terminal-field,
.workspace-meta-card,
.workspace-access-card {
  border-color: rgba(255, 255, 255, 0.08) !important;
  background: rgba(255, 255, 255, 0.045) !important;
  background-image: none !important;
  box-shadow: none !important;
}

.workspace-terminal [class*="cell"],
.workspace-terminal [class*="field"],
.workspace-terminal [class*="item"],
.workspace-terminal [class*="card"] {
  border-color: rgba(255, 255, 255, 0.08) !important;
  background-color: rgba(10, 11, 14, 0.64) !important;
  background-image: none !important;
}

.workspace-terminal .workspace-label,
.workspace-terminal [class*="label"] {
  color: #8f939d !important;
}

.workspace-terminal strong,
.workspace-terminal b,
.workspace-terminal [class*="value"] {
  color: #f5f5f5 !important;
}

.workspace-terminal .is-online,
.workspace-terminal [class*="online"] {
  color: #8df0b0 !important;
}

.promo-summary-card,
.promo-summary-pill,
.promo-summary-badge,
.promo-badge-preview,
.promo-badge,
.warehouse-table .promo-summary-card,
.warehouse-table .promo-summary-pill,
.warehouse-table .promo-summary-badge,
.warehouse-table .promo-badge-preview {
  border-color: rgba(255, 255, 255, 0.1) !important;
  background: rgba(255, 255, 255, 0.045) !important;
  background-image: none !important;
  box-shadow: none !important;
}

.promo-summary-card .promo-summary-badge,
.promo-summary-pill,
.promo-badge-preview,
.promo-badge {
  color: #f5f5f5 !important;
}

.promo-summary-meta,
.promo-summary-card .promo-summary-meta,
.warehouse-table .promo-summary-meta {
  color: #a5a8b3 !important;
}

.promo-summary-cell .promo-summary-card {
  min-height: 26px;
}

/* Final Onion pass: remove the remaining cyan islands from audit and promo cells. */
.workspace-terminal-header,
.workspace-terminal-grid {
  background: transparent !important;
  background-image: none !important;
}

.workspace-terminal-line,
.workspace-terminal-line-wide {
  border-color: rgba(255, 255, 255, 0.08) !important;
  background: rgba(10, 11, 14, 0.62) !important;
  background-image: none !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035) !important;
}

.workspace-terminal-title,
.workspace-terminal-key {
  color: #8f939d !important;
  text-shadow: none !important;
}

.workspace-terminal-value {
  color: #f5f5f5 !important;
  text-shadow: none !important;
}

.workspace-terminal-value.is-success {
  color: #8df0b0 !important;
  text-shadow: 0 0 12px rgba(141, 240, 176, 0.18) !important;
}

.workspace-terminal-led {
  background: #8df0b0 !important;
  box-shadow: 0 0 16px rgba(141, 240, 176, 0.38) !important;
}

.warehouse-table thead .th-promo-summary,
.warehouse-table tbody .promo-summary-cell {
  border-left-color: rgba(255, 255, 255, 0.055) !important;
  background: rgba(255, 255, 255, 0.025) !important;
  background-image: none !important;
}

.promo-summary-cell .promo-summary-button,
.warehouse-table .promo-summary-button {
  border-color: rgba(255, 255, 255, 0.1) !important;
  background: rgba(12, 13, 16, 0.78) !important;
  background-image: none !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035) !important;
  color: #f5f5f5 !important;
}

.promo-summary-cell .promo-summary-button:hover,
.warehouse-table .promo-summary-button:hover {
  border-color: rgba(240, 168, 92, 0.38) !important;
  box-shadow: 0 0 18px rgba(240, 168, 92, 0.12) !important;
}

.promo-summary-cell .promo-summary-button.is-active,
.warehouse-table .promo-summary-button.is-active {
  border-color: rgba(240, 168, 92, 0.35) !important;
  background: rgba(240, 168, 92, 0.12) !important;
}

.promo-summary-cell .promo-summary-button.is-exhausted,
.warehouse-table .promo-summary-button.is-exhausted {
  border-color: rgba(255, 95, 95, 0.34) !important;
  background: rgba(255, 95, 95, 0.11) !important;
}

.promo-summary-cell .promo-summary-badge,
.warehouse-table .promo-summary-badge {
  border-color: rgba(255, 255, 255, 0.14) !important;
  background: rgba(255, 255, 255, 0.06) !important;
  color: #f5f5f5 !important;
}

.promo-summary-cell .promo-summary-meta,
.warehouse-table .promo-summary-meta {
  color: #a5a8b3 !important;
}

/* Promo column hard fill: prevents white gaps behind rounded promo controls. */
.warehouse-table col.col-promo-summary,
.warehouse-table .col-promo-summary {
  background-color: #18191d !important;
}

.warehouse-table tbody td.promo-summary-cell,
.warehouse-table tbody td:last-child.promo-summary-cell,
.warehouse-table tbody tr td.promo-summary-cell {
  background-color: #18191d !important;
  background: #18191d !important;
  background-image: none !important;
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.055) !important;
  background-clip: padding-box !important;
}

.warehouse-table tbody tr:nth-child(even) td.promo-summary-cell,
.warehouse-table tbody tr:nth-child(even) td:last-child.promo-summary-cell {
  background-color: #202126 !important;
  background: #202126 !important;
  background-image: none !important;
}

.warehouse-table tbody tr:hover td.promo-summary-cell,
.warehouse-table tbody tr:hover td:last-child.promo-summary-cell {
  background-color: #292b31 !important;
  background: #292b31 !important;
  background-image: none !important;
}

.warehouse-table tbody tr.is-panel-selected td.promo-summary-cell,
.warehouse-table tbody tr.is-panel-selected td:last-child.promo-summary-cell {
  background-color: #2d3036 !important;
  background: #2d3036 !important;
  background-image: none !important;
}

/* Softer promo column finish: keep the fill, remove the harsh patch seams. */
.warehouse-table thead .th-promo-summary,
.warehouse-table tbody td.promo-summary-cell,
.warehouse-table tbody td:last-child.promo-summary-cell,
.warehouse-table tbody tr td.promo-summary-cell {
  border-top-color: rgba(255, 255, 255, 0.035) !important;
  border-bottom-color: rgba(255, 255, 255, 0.035) !important;
  border-left-color: rgba(255, 255, 255, 0.045) !important;
  border-right-color: rgba(255, 255, 255, 0.035) !important;
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.025) !important;
}

.warehouse-table tbody td.promo-summary-cell {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.018), transparent 34%),
    #18191d !important;
}

.warehouse-table tbody tr:nth-child(even) td.promo-summary-cell {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.016), transparent 34%),
    #202126 !important;
}

.warehouse-table tbody tr:hover td.promo-summary-cell {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.024), transparent 34%),
    #292b31 !important;
}

.warehouse-table tbody tr.is-panel-selected td.promo-summary-cell {
  background:
    linear-gradient(90deg, rgba(240, 168, 92, 0.05), transparent 38%),
    #2d3036 !important;
}

/* Promo panel manual toggle in the header. */
.action-link-toggle {
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.action-link-toggle.is-active {
  border-color: rgba(240, 168, 92, 0.42) !important;
  background: rgba(240, 168, 92, 0.15) !important;
  color: #fff7ef !important;
}

.action-link-toggle:not(.is-active) {
  color: #a7adb8 !important;
}

.workspace-matrix-layout.has-promo-side-panel.is-promo-panel-hidden {
  grid-template-columns: minmax(0, 1fr) !important;
}

.promo-side-panel.is-promo-panel-hidden,
.workspace-matrix-layout.is-promo-panel-hidden .promo-side-panel {
  display: none !important;
}

/* Static Onion Orders background: no cyber drift, no scanline, no pulse. */
html,
body {
  background:
    radial-gradient(circle at 14% 6%, rgba(255, 255, 255, 0.045), transparent 30rem),
    radial-gradient(circle at 84% 10%, rgba(126, 226, 168, 0.035), transparent 28rem),
    linear-gradient(135deg, #111214 0%, #1c1d20 44%, #111214 100%) !important;
  background-attachment: fixed !important;
}

body::before,
body::after,
#container::before,
#container::after {
  animation: none !important;
  transform: none !important;
  mix-blend-mode: normal !important;
}

body::before {
  opacity: 0.22 !important;
  background:
    radial-gradient(circle at 16% 12%, rgba(255, 255, 255, 0.035), transparent 32rem),
    radial-gradient(circle at 82% 18%, rgba(255, 255, 255, 0.026), transparent 30rem) !important;
}

body::after {
  opacity: 0.22 !important;
  background:
    linear-gradient(120deg, transparent 0 42%, rgba(255, 255, 255, 0.018) 48%, transparent 56%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.014), transparent 34%) !important;
}

#container::before,
#container::after {
  opacity: 0 !important;
  background: none !important;
}

.workspace-page::before,
.workspace-page::after,
.workspace-frame {
  animation: none !important;
}

/* Onion-style toast notifications. */
.workspace-toast {
  border: 1px solid rgba(255, 255, 255, 0.09) !important;
  background:
    linear-gradient(180deg, rgba(37, 38, 42, 0.96), rgba(24, 25, 28, 0.96)) !important;
  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.46),
    inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
  backdrop-filter: blur(14px);
}

.workspace-toast::before {
  width: 3px !important;
  background: linear-gradient(180deg, rgba(255, 177, 81, 0.9), rgba(255, 107, 26, 0.72)) !important;
  box-shadow: 0 0 18px rgba(255, 107, 26, 0.18) !important;
}

.workspace-toast.is-success {
  border-color: rgba(46, 230, 166, 0.24) !important;
  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.46),
    0 0 0 1px rgba(46, 230, 166, 0.06),
    0 0 24px rgba(46, 230, 166, 0.08) !important;
}

.workspace-toast.is-success::before {
  background: linear-gradient(180deg, rgba(107, 255, 185, 0.9), rgba(46, 230, 166, 0.68)) !important;
  box-shadow: 0 0 18px rgba(46, 230, 166, 0.18) !important;
}

.workspace-toast.is-error {
  border-color: rgba(255, 91, 115, 0.3) !important;
  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.46),
    0 0 0 1px rgba(255, 91, 115, 0.08),
    0 0 24px rgba(255, 91, 115, 0.1) !important;
}

.workspace-toast.is-error::before {
  background: linear-gradient(180deg, rgba(255, 121, 139, 0.92), rgba(255, 70, 108, 0.72)) !important;
  box-shadow: 0 0 18px rgba(255, 70, 108, 0.2) !important;
}

.workspace-toast.is-info {
  border-color: rgba(255, 177, 81, 0.28) !important;
  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.46),
    0 0 0 1px rgba(255, 177, 81, 0.07),
    0 0 24px rgba(255, 107, 26, 0.08) !important;
}

.workspace-toast-label {
  color: rgba(214, 217, 224, 0.62) !important;
}

.workspace-toast-message {
  color: #f4f4f5 !important;
}

.toast-close,
.btn-undo {
  border-color: rgba(255, 255, 255, 0.1) !important;
  background: rgba(255, 255, 255, 0.045) !important;
  color: #f4f4f5 !important;
}

.toast-close:hover,
.btn-undo:hover {
  background: rgba(255, 255, 255, 0.085) !important;
  border-color: rgba(255, 177, 81, 0.24) !important;
}

/* Onion-style admin login. */
html {
  --cursor-glow-x: 50vw;
  --cursor-glow-y: 34vh;
}

body.login {
  min-height: 100vh;
  position: relative;
  background: #0c0e10 !important;
  background-attachment: fixed !important;
}

body.login::before,
body.login::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  animation: none !important;
  transform: none !important;
  mix-blend-mode: normal !important;
}

body.login::before {
  opacity: 0.74 !important;
  background-image: radial-gradient(circle, rgba(125, 125, 125, 0.13) 1px, transparent 1.35px) !important;
  background-size: 12px 12px !important;
}

body.login::after {
  opacity: 0.95 !important;
  background:
    radial-gradient(130px at var(--cursor-glow-x) var(--cursor-glow-y), rgba(255, 142, 43, 0.82), rgba(255, 126, 24, 0.28) 48%, rgba(125, 125, 125, 0.08) 78%, transparent 100%),
    radial-gradient(300px at var(--cursor-glow-x) var(--cursor-glow-y), rgba(255, 118, 18, 0.16), transparent 74%) !important;
  background-repeat: no-repeat !important;
  -webkit-mask-image: radial-gradient(circle, #000 1px, transparent 1.35px);
  mask-image: radial-gradient(circle, #000 1px, transparent 1.35px);
  -webkit-mask-size: 12px 12px;
  mask-size: 12px 12px;
}

body.login #container,
body.login #content,
body.login #content-main,
body.login .login-page {
  position: relative;
  z-index: 1;
  background: transparent !important;
}

.login-page {
  min-height: min(100vh, 920px);
  display: grid;
  place-items: center;
  padding: 32px 18px;
}

.login-card,
.login-card.login-card-cyber {
  width: min(460px, calc(100vw - 32px));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(38, 39, 43, 0.92), rgba(24, 25, 28, 0.96)) !important;
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.46),
    inset 0 1px 0 rgba(255, 255, 255, 0.055),
    0 0 0 1px rgba(255, 177, 81, 0.035) !important;
  animation: login-card-in 0.42s cubic-bezier(0.2, 0.78, 0.22, 1);
}

.login-card-header,
.login-card-header.login-card-header-cyber {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 22px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  background:
    radial-gradient(circle at 90% 12%, rgba(126, 226, 168, 0.08), transparent 12rem),
    linear-gradient(180deg, rgba(24, 25, 28, 0.78), rgba(18, 19, 22, 0.6)) !important;
}

.login-kicker {
  color: #ffb151 !important;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.login-brand {
  margin: 8px 0 0;
  color: #f4f4f5 !important;
  font-size: clamp(1.7rem, 5vw, 2.15rem);
  line-height: 0.94;
  letter-spacing: -0.065em;
  text-transform: uppercase;
}

.login-glow-dot {
  width: 11px;
  height: 11px;
  margin-top: 16px;
  border-radius: 999px;
  background: #71ffc0 !important;
  box-shadow:
    0 0 0 5px rgba(113, 255, 192, 0.08),
    0 0 24px rgba(113, 255, 192, 0.45) !important;
  animation: login-dot-breathe 2.8s ease-in-out infinite;
}

.login-card-body,
.login-card-body.login-card-body-cyber {
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(18, 19, 22, 0.5), rgba(17, 18, 20, 0.72)) !important;
}

.login-form {
  display: grid;
  gap: 18px;
}

.auth-field {
  display: grid;
  gap: 9px;
}

.auth-label {
  color: #ffd7bb !important;
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.login-card input[type="text"],
.login-card input[type="password"],
.login-card input[type="email"] {
  width: 100%;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.13) !important;
  border-radius: 16px;
  background: rgba(11, 12, 14, 0.72) !important;
  color: #f4f4f5 !important;
  font-size: 1rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.login-card input[type="text"]:focus,
.login-card input[type="password"]:focus,
.login-card input[type="email"]:focus {
  border-color: rgba(255, 177, 81, 0.55) !important;
  background: rgba(12, 13, 15, 0.92) !important;
  box-shadow:
    0 0 0 0.18rem rgba(255, 177, 81, 0.1),
    0 0 28px rgba(255, 107, 26, 0.12) !important;
  outline: none;
}

.login-actions {
  display: flex;
  justify-content: center;
  padding-top: 8px;
}

.login-submit,
.login-card .btn-primary.login-submit {
  min-width: 140px;
  min-height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(255, 177, 81, 0.34) !important;
  background:
    linear-gradient(180deg, rgba(255, 177, 81, 0.2), rgba(255, 107, 26, 0.16)) !important;
  color: #fff7ef !important;
  box-shadow:
    0 16px 42px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

.login-submit:hover,
.login-card .btn-primary.login-submit:hover {
  border-color: rgba(255, 198, 126, 0.52) !important;
  background:
    linear-gradient(180deg, rgba(255, 198, 126, 0.26), rgba(255, 107, 26, 0.2)) !important;
  transform: translateY(-1px);
}

.auth-alert {
  margin-bottom: 16px;
  border-radius: 16px !important;
  border-color: rgba(255, 91, 115, 0.28) !important;
  background: rgba(80, 20, 32, 0.38) !important;
  color: #ffe5e9 !important;
}

@keyframes login-card-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes login-dot-breathe {
  0%,
  100% {
    opacity: 0.78;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.16);
  }
}

/* Compact one-line header actions. */
.workspace-header-actions {
  flex: 1 1 auto !important;
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 5px !important;
  min-width: 0 !important;
  max-width: none !important;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.workspace-header-actions::-webkit-scrollbar {
  display: none;
}

.workspace-header-actions .inline-action-form {
  flex: 0 0 auto !important;
  display: inline-flex !important;
}

.workspace-header-actions .action-link {
  flex: 0 0 auto !important;
  min-height: 34px !important;
  padding: 0 10px !important;
  border-radius: 10px !important;
  font-size: 0.82rem !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

@media (max-width: 980px) {
  .workspace-header-actions {
    justify-content: flex-start !important;
  }
}

/* Glass promo panel without a visible frame. */
.promo-side-panel {
  position: sticky;
  border-color: transparent !important;
  background:
    linear-gradient(180deg, rgba(38, 39, 42, 0.68), rgba(25, 26, 29, 0.6)) !important;
  -webkit-backdrop-filter: blur(22px) saturate(1.12);
  backdrop-filter: blur(22px) saturate(1.12);
  box-shadow:
    0 26px 76px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.045) !important;
}

.workspace-matrix-layout.is-promo-floating .promo-side-panel {
  border-color: transparent !important;
  background:
    linear-gradient(180deg, rgba(38, 39, 42, 0.68), rgba(25, 26, 29, 0.6)) !important;
  -webkit-backdrop-filter: blur(22px) saturate(1.12);
  backdrop-filter: blur(22px) saturate(1.12);
}

.promo-side-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035), transparent 28%, transparent 72%, rgba(255, 255, 255, 0.025));
  opacity: 0.58;
}

.promo-side-panel > * {
  position: relative;
  z-index: 1;
}

/* Keep the glass panel seamless inside. */
.promo-side-panel-content,
.promo-panel-summary,
.promo-panel-grid,
.promo-side-progress {
  border: 0 !important;
  box-shadow: none !important;
}

.promo-panel-stat,
.promo-panel-live-row,
.promo-progress-card {
  border-color: transparent !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.028)) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.045),
    0 10px 24px rgba(0, 0, 0, 0.1) !important;
}

.promo-panel-stat::before,
.promo-panel-live-row::before,
.promo-progress-card::before {
  opacity: 0 !important;
}

.promo-panel-input {
  border-color: rgba(255, 255, 255, 0.16) !important;
  box-shadow: none !important;
}

/* Final login background layer: keep dots above admin body background, below the card. */
body.login {
  background: #0b0d0f !important;
}

body.login::before,
body.login::after {
  display: none !important;
}

body.login #container,
body.login #content,
body.login #content-main {
  overflow: visible !important;
  background: transparent !important;
}

body.login .login-page {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  overflow: hidden;
  background: #0b0d0f !important;
}

body.login .login-page::before,
body.login .login-page::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

body.login .login-page::before {
  opacity: 0.82;
  background-image: radial-gradient(circle, rgba(150, 150, 150, 0.17) 1px, transparent 1.35px);
  background-size: 12px 12px;
}

body.login .login-page::after {
  opacity: 0.95;
  background:
    radial-gradient(130px at var(--cursor-glow-x) var(--cursor-glow-y), rgba(255, 142, 43, 0.82), rgba(255, 126, 24, 0.28) 48%, rgba(125, 125, 125, 0.08) 78%, transparent 100%),
    radial-gradient(300px at var(--cursor-glow-x) var(--cursor-glow-y), rgba(255, 118, 18, 0.16), transparent 74%);
  -webkit-mask-image: radial-gradient(circle, #000 1px, transparent 1.35px);
  mask-image: radial-gradient(circle, #000 1px, transparent 1.35px);
  -webkit-mask-size: 12px 12px;
  mask-size: 12px 12px;
  background-repeat: no-repeat;
}

body.login .login-card {
  position: relative;
  z-index: 1;
}
