:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #dbe5f4;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
}

.payments-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

.payments-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #eef3f9;
  color: #334155;
  font-weight: 800;
  text-decoration: none;
}

.payments-nav a.active,
.payments-nav a:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.payments-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 260px;
  gap: 16px;
  align-items: start;
}

.payments-filter-panel form,
.payments-side-form,
.payments-form-grid,
.runtime-payment-form-grid {
  display: grid;
  gap: 12px;
}

.payments-side-form label,
.payments-form-grid label,
.runtime-payment-form-grid label {
  display: grid;
  gap: 6px;
  color: #475569;
  font-weight: 800;
}

.payments-side-form input,
.payments-side-form select,
.payments-form-grid input,
.payments-form-grid select,
.payments-form-grid textarea,
.runtime-payment-form-grid input,
.runtime-payment-form-grid select,
.runtime-payment-form-grid textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
}

.payments-form-grid,
.runtime-payment-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.payments-form-grid .wide,
.runtime-payment-form-grid .wide {
  grid-column: 1 / -1;
}

.inline-check {
  display: flex !important;
  grid-template-columns: none !important;
  flex-direction: row;
  align-items: center;
}

.inline-check input {
  width: auto !important;
  min-height: 0 !important;
}

.payments-balance-panel,
.payments-settings-grid > .panel,
.payments-edit-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 16px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.06);
}

.payments-balance-panel h2,
.payments-side-form h2 {
  margin: 0 0 12px;
}

.payments-balance-panel article {
  display: grid;
  gap: 4px;
  padding: 12px 0;
  border-top: 1px solid #e5edf7;
}

.payments-balance-panel article:first-of-type {
  border-top: 0;
}

.payments-balance-panel span {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.payments-balance-panel em {
  color: #0f172a;
  font-style: normal;
  font-weight: 900;
}

.payments-settings-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.onebox-nav {
  margin-top: 8px;
}

.onebox-test-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.onebox-json-panel,
.onebox-log-details td {
  background: #f8fbff;
}

.onebox-json-panel pre,
.onebox-log-details pre {
  max-height: 520px;
  overflow: auto;
  margin: 10px 0 0;
  padding: 14px;
  border: 1px solid #dbe5f4;
  border-radius: 8px;
  background: #0f172a;
  color: #dbeafe;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.onebox-error {
  display: block;
  margin-top: 4px;
  color: #dc2626;
  font-size: 12px;
  font-weight: 700;
}

.onebox-process-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.onebox-process-filters input,
.onebox-process-filters select {
  width: auto;
  min-width: 150px;
  max-width: 220px;
  flex: 0 1 180px;
}

.onebox-process-filters select[name="connection_id"],
.onebox-process-filters select[name="workflowid"],
.onebox-process-filters input[name="name"] {
  min-width: 240px;
  max-width: 320px;
  flex-basis: 280px;
}

.onebox-process-filters input[type="date"] {
  min-width: 150px;
  flex-basis: 160px;
}

.onebox-process-filters .btn {
  flex: 0 0 auto;
}

.onebox-process-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.page-back-link {
  display: inline-flex;
  margin-bottom: 12px;
  color: var(--primary);
  font-weight: 900;
  text-decoration: none;
}

.process-code {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.onebox-process-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
}

.onebox-process-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.onebox-section-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.onebox-section-title h2 {
  margin: 0 0 4px;
}

.onebox-section-title p {
  margin: 0;
  color: var(--muted);
}

.onebox-section-title > span {
  display: inline-flex;
  min-width: 34px;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef5ff;
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
}

.onebox-field-grid,
.onebox-custom-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.onebox-field-card,
.onebox-state-card {
  display: grid;
  gap: 6px;
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.onebox-field-card span,
.onebox-state-card span {
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.onebox-field-card strong,
.onebox-state-card strong {
  min-width: 0;
  color: #0f172a;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.onebox-field-card code {
  color: #64748b;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.onebox-process-side,
.onebox-mini-list {
  display: grid;
  gap: 10px;
}

.onebox-process-side h2 {
  margin: 0;
}

.onebox-state-card.current {
  border-color: rgba(37, 99, 235, 0.35);
  background: #eff6ff;
}

.stage-pill,
.stage-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 900;
}

.stage-history-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.onebox-status-pill {
  background: color-mix(in srgb, var(--status-color, #2563eb) 16%, white);
  color: var(--status-color, #2563eb);
}

.onebox-status-note {
  margin-top: 10px;
}

.onebox-status-params {
  margin: 0 0 10px;
  color: #475569;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.stage-arrow {
  color: #64748b;
  font-weight: 900;
}

.onebox-mini-list a,
.onebox-mini-list article {
  display: block;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  color: #0f172a;
  text-decoration: none;
}

.onebox-mini-list p {
  margin: 4px 0 0;
  color: #475569;
}

.onebox-products-table th:first-child,
.onebox-products-table td:first-child {
  width: 72px;
}

.onebox-product-thumb {
  display: inline-flex;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid #dbe7f5;
  border-radius: 8px;
  background: #f8fbff;
}

.onebox-product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.onebox-product-no-photo {
  display: inline-flex;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  border: 1px dashed #c7d7ee;
  border-radius: 8px;
  color: #94a3b8;
  font-weight: 900;
}

@media (max-width: 900px) {
  .onebox-test-grid {
    grid-template-columns: 1fr;
  }

  .onebox-process-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .onebox-process-grid,
  .onebox-field-grid,
  .onebox-custom-fields {
    grid-template-columns: 1fr;
  }
}

.payment-direction,
.payment-amount {
  font-weight: 900;
}

.payment-direction.income,
.payment-amount.income {
  color: #16a34a;
}

.payment-direction.expense,
.payment-amount.expense {
  color: #dc2626;
}

.payment-modal[hidden],
.runtime-payment-modal[hidden] {
  display: none;
}

.payment-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.35);
  padding: 24px;
}

.payments-modal-panel {
  width: min(920px, 96vw);
}

.payments-modal-panel footer,
.runtime-payment-modal footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}

.runtime-payments {
  position: relative;
}

.runtime-payments-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.runtime-payments-summary span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  color: #475569;
  font-weight: 800;
}

.runtime-payment-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.35);
  padding: 24px;
}

.runtime-payment-modal form {
  width: min(820px, 96vw);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 18px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
}

.runtime-payment-modal header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.runtime-payment-modal header button {
  border: 0;
  background: #eef2f7;
  border-radius: 8px;
  width: 34px;
  height: 34px;
  font-size: 20px;
  cursor: pointer;
}

@media (max-width: 1100px) {
  .payments-layout,
  .payments-settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .payments-form-grid,
  .runtime-payment-form-grid {
    grid-template-columns: 1fr;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.marketing-body {
  background: #ffffff;
}

.marketing-page {
  min-height: 100vh;
  background: #ffffff;
}

.marketing-container,
.marketing-nav,
.marketing-hero {
  width: min(1475px, calc(100% - 40px));
  margin: 0 auto;
}

.marketing-nav {
  display: flex;
  min-height: 162px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.marketing-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #111827;
  font-size: 28px;
  font-weight: 900;
}

.marketing-brand .brand-mark {
  width: 48px;
  height: 48px;
  margin: 0;
  border-radius: 9px;
  background: #111423;
  font-size: 15px;
}

.marketing-menu,
.marketing-actions,
.hero-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.marketing-menu {
  gap: 18px;
  color: #4b5563;
  font-size: 18px;
}

.marketing-menu a:hover {
  color: var(--primary);
}

.marketing-actions .btn {
  min-height: 47px;
  padding: 0 18px;
}

.marketing-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(430px, 1fr);
  gap: 64px;
  align-items: center;
  padding: 114px 0 120px;
}

.hero-copy {
  display: grid;
  gap: 24px;
}

.marketing-eyebrow {
  margin: 0;
  color: #344967;
  font-size: 26px;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
}

.hero-copy h1 {
  max-width: 720px;
  margin: 0;
  color: #0b1020;
  font-size: clamp(54px, 5.8vw, 88px);
  font-weight: 900;
  line-height: 1.02;
}

.hero-copy h1 span {
  color: var(--primary);
}

.hero-lead {
  max-width: 760px;
  margin: 0;
  color: #344967;
  font-size: 25px;
  line-height: 1.65;
}

.btn-lg {
  min-height: 60px;
  padding: 0 28px;
  font-size: 20px;
}

.btn-light {
  background: #ffffff;
  border-color: var(--line);
  color: #0f172a;
}

.hero-note {
  margin: 0;
  color: #8490a6;
  font-size: 17px;
}

.hero-preview {
  min-width: 0;
}

.browser-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 34px 90px rgba(15, 23, 42, 0.14);
}

.browser-top {
  display: flex;
  height: 58px;
  align-items: center;
  gap: 10px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
}

.browser-top span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #dfe3ea;
}

.dashboard-mockup {
  display: grid;
  min-height: 475px;
  grid-template-columns: 188px 1fr;
  background: #f7f9fc;
}

.dashboard-mockup aside {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px 24px;
  border-right: 1px solid var(--line);
  background: #ffffff;
}

.dashboard-mockup aside b {
  margin-bottom: 18px;
  color: #0f172a;
  font-size: 16px;
}

.dashboard-mockup aside span {
  display: flex;
  min-height: 38px;
  align-items: center;
  padding: 0 12px;
  border-radius: 8px;
  background: #eef1f6;
  color: #617086;
  font-size: 14px;
}

.dashboard-mockup aside span.active {
  background: var(--primary);
  color: #ffffff;
}

.mock-content {
  padding: 26px;
}

.mock-header {
  width: 70%;
  height: 48px;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.mock-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.mock-cards div {
  height: 108px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.mock-table {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.mock-table span {
  height: 38px;
  border-radius: 8px;
  background: #eef1f6;
}

.modules-section,
.features-section,
.process-section,
.cta-section {
  padding: 84px 0;
}

.features-section {
  background: #f6f7fb;
}

.section-head {
  max-width: 760px;
  margin-bottom: 38px;
}

.section-head.center {
  margin-right: auto;
  margin-left: auto;
  text-align: center;
}

.section-head h2,
.process-card h2,
.cta-card h2 {
  margin: 0;
  color: #0f172a;
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1.1;
}

.section-head p,
.cta-card p {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

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

.module-card {
  display: flex;
  min-height: 190px;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.module-icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  font-size: 22px;
  font-weight: 900;
}

.module-color-0 { background: #6366f1; }
.module-color-1 { background: #22c55e; }
.module-color-2 { background: #f97316; }
.module-color-3 { background: #3b82f6; }

.module-card b {
  margin-top: 18px;
  font-size: 20px;
}

.module-card small {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.features-inner {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 70px;
  align-items: start;
}

.features-list {
  display: grid;
  gap: 16px;
}

.feature-item {
  display: flex;
  gap: 20px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.feature-item > span {
  display: grid;
  min-width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 8px;
  background: #eef2ff;
  color: var(--primary);
  font-weight: 900;
}

.feature-item h3 {
  margin: 0;
  font-size: 22px;
}

.feature-item p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.process-card {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 50px;
  align-items: center;
  padding: 52px;
  border-radius: 8px;
  background: #151827;
  color: #ffffff;
}

.process-card h2 {
  color: #ffffff;
}

.process-card p {
  margin: 20px 0 28px;
  color: #cbd5e1;
  font-size: 18px;
  line-height: 1.7;
}

.process-flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  gap: 12px;
  align-items: center;
}

.process-flow div {
  padding: 20px 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 800;
  text-align: center;
}

.process-flow span {
  color: #93c5fd;
  font-size: 24px;
}

.cta-card {
  padding: 64px 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  text-align: center;
}

.cta-card h2,
.cta-card p {
  max-width: 820px;
  margin-right: auto;
  margin-left: auto;
}

.cta-card div {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

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

.login-card {
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-card-wide {
  display: grid;
  width: min(920px, 100%);
  gap: 24px;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
}

.login-info {
  display: grid;
  align-content: center;
  gap: 14px;
  padding: 22px;
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(5, 150, 105, 0.12)),
    #f8fafc;
}

.login-form {
  align-content: center;
  margin-top: 0;
}

.login-form h2 {
  margin: 0;
  font-size: 22px;
}

.login-benefits {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.login-benefits span,
.eyebrow {
  display: inline-flex;
  width: fit-content;
  padding: 5px 9px;
  border-radius: 999px;
  color: #075985;
  background: #e0f2fe;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  margin-bottom: 14px;
  place-items: center;
  border-radius: 9px;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #059669);
  font-weight: 900;
}

.login-card h1,
.page-title h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
}

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

.form-stack {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

label {
  display: grid;
  gap: 7px;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  color: var(--text);
  background: #fff;
  font: inherit;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  outline: 3px solid rgba(37, 99, 235, 0.12);
}

.btn {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: #1e293b;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.btn.primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.btn.primary:hover {
  background: var(--primary-dark);
}

.alert {
  padding: 12px 14px;
  border: 1px solid #fecaca;
  border-radius: 7px;
  color: #991b1b;
  background: #fef2f2;
  font-size: 13px;
  font-weight: 700;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  min-height: 66px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
}

.topbar-brand .brand-mark {
  width: 34px;
  height: 34px;
  margin: 0;
}

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

.topbar-nav a,
.topbar-nav button {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #334155;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.topbar-nav a.active,
.topbar-nav a:hover,
.topbar-nav button:hover {
  border-color: var(--line);
  background: #f8fafc;
}

.user-name {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  padding: 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.logout-form {
  margin: 0;
}

.logout-button {
  border-color: #fecaca !important;
  color: #991b1b !important;
  background: #fff7f7 !important;
}

.logout-button:hover {
  background: #fee2e2 !important;
}

.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 24px 48px;
}

.page-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.desktop-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}

.desktop-hero h1 {
  margin: 8px 0 8px;
  font-size: 32px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 24px 0 12px;
}

.section-head h2,
.panel h2,
.profile-panel h2 {
  margin: 0 0 6px;
  font-size: 20px;
}

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

.desktop-grid.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.app-tile,
.panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.app-tile {
  display: grid;
  min-height: 148px;
  gap: 12px;
  padding: 18px;
}

.app-tile:hover {
  border-color: #b7cdfd;
  transform: translateY(-1px);
}

.admin-tile {
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.app-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--primary);
  font-weight: 900;
}

.app-tile h2 {
  margin: 0;
  font-size: 17px;
}

.app-tile p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.panel {
  padding: 18px;
}

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

.stat-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.stat-card strong {
  display: block;
  margin-top: 6px;
  font-size: 28px;
}

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

.table th,
.table td {
  padding: 12px 10px;
  border-bottom: 1px solid #edf2f7;
  text-align: left;
  font-size: 14px;
}

.table th {
  color: #64748b;
  font-size: 12px;
  text-transform: uppercase;
}

.badge {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  color: #065f46;
  background: #d1fae5;
  font-size: 12px;
  font-weight: 800;
}

.cabinet-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
}

.profile-panel {
  display: flex;
  align-items: center;
  gap: 18px;
}

.avatar-large {
  display: grid;
  width: 72px;
  height: 72px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #059669);
  font-size: 28px;
  font-weight: 900;
}

.role-list,
.quick-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.quick-list {
  flex-direction: column;
}

.quick-list a {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
  font-weight: 800;
}

.quick-list a:hover {
  border-color: #b7cdfd;
  background: #eff6ff;
}

.admin-panel {
  border-color: #bfdbfe;
  background: linear-gradient(180deg, #fff, #eff6ff);
}

@media (max-width: 980px) {
  .login-card-wide,
  .cabinet-grid,
  .desktop-grid,
  .stats-row {
    grid-template-columns: 1fr;
  }

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

.interfaces-page {
  min-height: calc(100vh - 82px);
  background: #f5f7fb;
  padding: 28px;
}

.interfaces-header,
.interfaces-toolbar,
.interfaces-sidebar,
.interface-preview-panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, .04);
}

.interfaces-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 24px 26px;
  margin-bottom: 18px;
}

.interfaces-header h1 {
  margin: 0 0 6px;
  color: #111827;
  font-size: 30px;
}

.interfaces-header p,
.interface-description,
.interface-muted {
  color: #6b7280;
}

.interfaces-toolbar {
  padding: 14px;
  margin-bottom: 18px;
}

.interfaces-toolbar form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}

.interfaces-toolbar label {
  display: grid;
  gap: 6px;
  min-width: 240px;
}

.interfaces-toolbar span,
.interface-passport span {
  color: #6b7280;
  font-size: 13px;
  font-weight: 800;
}

.interfaces-toolbar input,
.interfaces-toolbar select {
  height: 42px;
  border: 1px solid #d7deea;
  border-radius: 8px;
  padding: 0 12px;
}

.interfaces-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 20px;
}

.interfaces-sidebar {
  align-self: start;
  display: grid;
  gap: 18px;
  padding: 18px;
}

.interface-groups h2,
.interface-block-list h2 {
  margin: 0 0 12px;
  font-size: 16px;
}

.interface-group-item,
.interface-block-card {
  display: flex;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: #111827;
}

.interface-group-item {
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  margin-bottom: 8px;
}

.interface-group-item span {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-weight: 800;
}

.interface-group-item .svg-icon {
  width: 18px;
  height: 18px;
}

.interface-group-item strong {
  color: #6b7280;
}

.interface-group-item.active {
  color: #fff;
  background: #2563eb;
  border-color: #2563eb;
}

.interface-group-item.active strong {
  color: #dbeafe;
}

.interface-block-card {
  position: relative;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  margin-bottom: 10px;
}

.interface-block-card.active {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.interface-block-card strong {
  padding-right: 92px;
  font-size: 15px;
}

.interface-block-card small {
  color: #6b7280;
  line-height: 1.45;
}

.interface-block-card .interface-status-badge {
  position: absolute;
  top: 12px;
  right: 12px;
}

.interface-preview-panel {
  min-width: 0;
  padding: 22px;
}

.interface-preview-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.interface-preview-header p {
  margin: 0 0 4px;
  color: #6b7280;
  font-weight: 800;
}

.interface-preview-header h2 {
  margin: 0 0 10px;
  font-size: 26px;
}

.interface-passport {
  min-width: 230px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
}

.interface-passport strong {
  display: block;
  margin-top: 4px;
  word-break: break-word;
}

.interface-preview-box {
  border: 1px dashed #bfdbfe;
  border-radius: 8px;
  background: #f8fbff;
  padding: 18px;
  margin: 18px 0;
}

.interface-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 16px;
}

.interface-tab {
  border: 0;
  border-radius: 8px 8px 0 0;
  background: #eef2f7;
  padding: 11px 14px;
  font-weight: 900;
  cursor: pointer;
}

.interface-tab.active {
  background: #2563eb;
  color: #fff;
}

.interface-tab-content {
  display: none;
}

.interface-tab-content.active {
  display: block;
}

.interface-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 900;
}

.interface-status-ready {
  background: #dcfce7;
  color: #15803d;
}

.interface-status-planned {
  background: #fef3c7;
  color: #b45309;
}

.interface-status-needs_info {
  background: #e0f2fe;
  color: #0369a1;
}

.interface-status-disabled {
  background: #e5e7eb;
  color: #4b5563;
}

.interface-capability-list,
.interface-usage-list,
.interface-settings-demo {
  display: grid;
  gap: 12px;
}

.interface-capability-list article,
.interface-usage-list article,
.interface-settings-demo label {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.interface-capability-list code {
  display: inline-block;
  margin: 6px 0;
  color: #2563eb;
  font-weight: 800;
}

.interface-capability-list p,
.interface-usage-list p,
.interface-settings-demo small {
  margin: 0;
  color: #6b7280;
}

.interface-settings-demo label {
  display: grid;
  gap: 8px;
}

.interface-settings-demo input,
.interface-settings-demo textarea {
  min-height: 40px;
  border: 1px solid #d7deea;
  border-radius: 8px;
  padding: 8px 10px;
  color: #6b7280;
  background: #f8fafc;
}

.interface-empty {
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 30px;
  text-align: center;
}

.demo-block {
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.demo-block h3,
.demo-block h4 {
  margin: 0 0 12px;
}

.demo-header-block,
.demo-section-head,
.demo-actions,
.demo-kpi-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.demo-header-block,
.demo-section-head {
  justify-content: space-between;
}

.demo-header-block span,
.demo-header-block p {
  color: #6b7280;
}

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

.demo-form-block label {
  display: grid;
  gap: 6px;
}

.demo-form-block input,
.demo-block input {
  min-height: 40px;
  border: 1px solid #d7deea;
  border-radius: 8px;
  padding: 0 10px;
  background: #f8fafc;
}

.demo-actions {
  flex-wrap: wrap;
}

.demo-actions button,
.demo-section-head button,
.demo-block > button {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  padding: 9px 12px;
  font-weight: 900;
  cursor: pointer;
}

.demo-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.demo-kpi-row article {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
}

.demo-kpi-row span,
.demo-file-list span {
  color: #6b7280;
}

.demo-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
}

.demo-table th,
.demo-table td {
  border-bottom: 1px solid #e5e7eb;
  padding: 9px;
  text-align: left;
}

.demo-file-list {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.demo-file-list li {
  display: flex;
  justify-content: space-between;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 12px;
}

.demo-comments {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.demo-comments p {
  margin: 0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
}

.demo-timeline {
  display: grid;
  gap: 10px;
}

.demo-timeline article {
  border-left: 3px solid #2563eb;
  padding-left: 12px;
}

.demo-timeline strong,
.demo-timeline span {
  display: block;
}

.demo-timeline span {
  color: #6b7280;
}

.demo-placeholder-grid {
  display: grid;
  gap: 8px;
}

.demo-placeholder-grid span {
  display: block;
  height: 18px;
  border-radius: 999px;
  background: #e5e7eb;
}

.demo-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1000;
  max-width: 360px;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  padding: 14px 16px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, .22);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: .18s ease;
}

.demo-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.actions-page {
  min-height: calc(100vh - 82px);
  background: #f5f7fb;
  padding: 28px;
}

.actions-header,
.actions-toolbar,
.actions-sidebar,
.action-preview-panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, .04);
}

.actions-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 24px 26px;
  margin-bottom: 18px;
}

.actions-header h1 {
  margin: 0 0 6px;
  color: #111827;
  font-size: 30px;
}

.actions-header p,
.action-description,
.action-muted {
  color: #6b7280;
}

.actions-toolbar {
  padding: 14px;
  margin-bottom: 18px;
}

.actions-toolbar form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}

.actions-toolbar label {
  display: grid;
  gap: 6px;
  min-width: 220px;
}

.actions-toolbar span,
.action-passport span {
  color: #6b7280;
  font-size: 13px;
  font-weight: 800;
}

.actions-toolbar input,
.actions-toolbar select {
  height: 42px;
  border: 1px solid #d7deea;
  border-radius: 8px;
  padding: 0 12px;
}

.actions-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 20px;
}

.actions-library-page {
  display: grid;
  gap: 16px;
}

.actions-library-toolbar,
.actions-library-summary,
.actions-library-card,
.actions-library-empty {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .04);
}

.actions-library-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(180px, 240px) minmax(180px, 240px) 130px;
  gap: 12px;
  padding: 14px;
  align-items: end;
}

.actions-library-toolbar label {
  display: grid;
  gap: 7px;
}

.actions-library-toolbar span {
  color: #475569;
  font-size: 13px;
  font-weight: 900;
}

.actions-library-toolbar input,
.actions-library-toolbar select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #d8e0ec;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  padding: 9px 11px;
  font: inherit;
}

.actions-library-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  color: #64748b;
  font-weight: 800;
}

.actions-library-summary strong {
  color: #0f172a;
  font-size: 22px;
}

.actions-library-list {
  display: grid;
  gap: 12px;
}

.actions-library-card {
  overflow: hidden;
}

.actions-library-card-summary {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  cursor: pointer;
}

.actions-library-order {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: #eff6ff;
  color: #2563eb;
  font-weight: 900;
}

.actions-library-main {
  min-width: 0;
}

.actions-library-main header {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.actions-library-main strong {
  overflow: hidden;
  color: #0f172a;
  font-size: 16px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.actions-library-main header span {
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.actions-library-main p {
  margin: 7px 0 10px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.4;
}

.actions-library-main footer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.actions-library-main footer em {
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  padding: 4px 8px;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.actions-library-expand {
  min-height: 34px;
  border: 1px solid #dbe3ef;
  border-radius: 7px;
  background: #fff;
  color: #172033;
  padding: 0 12px;
  font-weight: 900;
  cursor: pointer;
}

.actions-library-card.expanded {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.actions-library-details {
  display: grid;
  gap: 14px;
  border-top: 1px solid #eef2f7;
  padding: 14px;
}

.actions-library-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.actions-library-detail-grid article,
.actions-library-readonly-section {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}

.actions-library-detail-grid span {
  display: block;
  margin-bottom: 6px;
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.actions-library-detail-grid strong {
  color: #0f172a;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.actions-library-readonly-section h3 {
  margin: 0 0 10px;
  color: #0f172a;
  font-size: 15px;
}

.actions-library-readonly-section pre {
  overflow: auto;
  max-height: 280px;
  margin: 0;
  border-radius: 8px;
  background: #0f172a;
  color: #e2e8f0;
  padding: 12px;
  font-size: 12px;
  line-height: 1.45;
}

.actions-library-settings-table {
  display: grid;
  grid-template-columns: minmax(180px, 1.3fr) 130px minmax(140px, .8fr) minmax(180px, 1fr);
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.actions-library-settings-table > div {
  min-height: 42px;
  border-bottom: 1px solid #eef2f7;
  padding: 9px 10px;
  color: #334155;
  font-size: 13px;
}

.actions-library-settings-table > div:nth-last-child(-n + 4) {
  border-bottom: 0;
}

.actions-library-settings-table .head {
  display: contents;
}

.actions-library-settings-table .head span {
  border-bottom: 1px solid #dbe3ef;
  background: #f1f5f9;
  color: #475569;
  padding: 9px 10px;
  font-size: 12px;
  font-weight: 900;
}

.actions-library-settings-table strong {
  display: block;
  color: #0f172a;
  font-weight: 900;
}

.actions-library-settings-table code {
  color: #2563eb;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.actions-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
  padding: 4px 0 16px;
}

.actions-pagination button {
  min-width: 38px;
  min-height: 36px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
  color: #172033;
  font-weight: 900;
  cursor: pointer;
}

.actions-pagination button.active {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

.actions-pagination span {
  color: #64748b;
  font-weight: 900;
}

.actions-library-empty {
  display: grid;
  min-height: 180px;
  place-items: center;
  gap: 8px;
  color: #64748b;
  text-align: center;
}

.actions-library-empty strong {
  color: #0f172a;
  font-size: 18px;
}

.actions-sidebar {
  align-self: start;
  display: grid;
  gap: 18px;
  padding: 18px;
}

.action-groups h2,
.action-list h2 {
  margin: 0 0 12px;
  font-size: 16px;
}

.action-group-item,
.action-card {
  display: flex;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: #111827;
}

.action-group-item {
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  margin-bottom: 8px;
}

.action-group-item span {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-weight: 800;
}

.action-group-item .svg-icon {
  width: 18px;
  height: 18px;
}

.action-group-item strong {
  color: #6b7280;
}

.action-group-item.active {
  color: #fff;
  background: #2563eb;
  border-color: #2563eb;
}

.action-group-item.active strong {
  color: #dbeafe;
}

.action-card {
  position: relative;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  margin-bottom: 10px;
}

.action-card.active {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.action-card strong {
  padding-right: 92px;
  font-size: 15px;
}

.action-card small {
  color: #6b7280;
  line-height: 1.45;
}

.action-card .action-status-badge {
  position: absolute;
  top: 12px;
  right: 12px;
}

.action-preview-panel {
  min-width: 0;
  padding: 22px;
}

.action-preview-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.action-preview-header p {
  margin: 0 0 4px;
  color: #6b7280;
  font-weight: 800;
}

.action-preview-header h2 {
  margin: 0 0 10px;
  font-size: 26px;
}

.action-passport {
  min-width: 260px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
}

.action-passport strong {
  display: block;
  margin: 4px 0 10px;
  word-break: break-word;
}

.action-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.action-tag,
.action-tags em {
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  padding: 3px 9px;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

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

.action-meta-grid article {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}

.action-meta-grid span {
  display: block;
  color: #6b7280;
  font-weight: 800;
  margin-bottom: 4px;
}

.action-preview-box {
  border: 1px dashed #bfdbfe;
  border-radius: 8px;
  background: #f8fbff;
  padding: 18px;
  margin: 18px 0;
}

.action-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 16px;
}

.action-tab {
  border: 0;
  border-radius: 8px 8px 0 0;
  background: #eef2f7;
  padding: 11px 14px;
  font-weight: 900;
  cursor: pointer;
}

.action-tab.active {
  background: #2563eb;
  color: #fff;
}

.action-tab-content {
  display: none;
}

.action-tab-content.active {
  display: block;
}

.action-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 900;
}

.action-status-ready { background: #dcfce7; color: #15803d; }
.action-status-beta { background: #e0f2fe; color: #0369a1; }
.action-status-planned { background: #fef3c7; color: #b45309; }
.action-status-needs_info { background: #e0f2fe; color: #0369a1; }
.action-status-disabled { background: #e5e7eb; color: #4b5563; }
.action-status-deprecated { background: #fee2e2; color: #b91c1c; }

.action-capability-list,
.action-usage-list,
.action-settings-demo {
  display: grid;
  gap: 12px;
}

.action-capability-list article,
.action-usage-list article,
.action-settings-demo label {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.action-capability-list code {
  display: inline-block;
  margin: 6px 0;
  color: #2563eb;
  font-weight: 800;
}

.action-capability-list p,
.action-usage-list p,
.action-settings-demo small {
  margin: 0;
  color: #6b7280;
}

.action-settings-demo label {
  display: grid;
  gap: 8px;
}

.action-settings-demo input,
.action-settings-demo textarea,
.action-settings-demo select {
  min-height: 40px;
  border: 1px solid #d7deea;
  border-radius: 8px;
  padding: 8px 10px;
  color: #111827;
  background: #fff;
  font: inherit;
}

.action-json-preview {
  overflow: auto;
  max-height: 520px;
  border: 1px solid #d7deea;
  border-radius: 8px;
  background: #0f172a;
  color: #e2e8f0;
  padding: 16px;
  font-size: 13px;
  line-height: 1.55;
}

.action-text-panel {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  padding: 18px;
}

.action-text-panel h3 {
  margin: 0 0 10px;
  color: #111827;
  font-size: 20px;
}

.action-text-panel p {
  color: #6b7280;
  line-height: 1.55;
}

.action-text-panel dl {
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
}

.action-text-panel dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid #eef2f7;
  padding-top: 8px;
}

.action-text-panel dt {
  color: #6b7280;
  font-weight: 800;
}

.action-text-panel dd {
  margin: 0;
  font-weight: 900;
}

.action-empty {
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 30px;
  text-align: center;
}

.action-demo-block {
  display: grid;
  gap: 10px;
}

.action-demo-flow {
  display: flex;
  align-items: center;
  gap: 10px;
}

.action-demo-flow span {
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
  padding: 10px 12px;
  font-weight: 900;
}

.action-demo-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.action-demo-list div {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 10px;
}

.action-demo-list dt {
  color: #6b7280;
  font-weight: 800;
}

.action-demo-list dd {
  margin: 0;
  font-weight: 900;
}

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

  .actions-library-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .actions-library-settings-table {
    grid-template-columns: minmax(160px, 1.2fr) 110px minmax(120px, .8fr) minmax(160px, 1fr);
  }
}

@media (max-width: 760px) {
  .actions-library-toolbar,
  .actions-library-detail-grid,
  .actions-library-settings-table {
    grid-template-columns: 1fr;
  }

  .actions-library-card-summary {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .actions-library-expand {
    grid-column: 2;
    justify-self: start;
  }

  .actions-library-main header {
    align-items: flex-start;
    flex-direction: column;
  }

  .actions-library-main strong {
    white-space: normal;
  }

  .actions-library-settings-table .head {
    display: none;
  }

  .actions-library-settings-table > div,
  .actions-library-settings-table > div:nth-last-child(-n + 4) {
    border-bottom: 1px solid #eef2f7;
  }
}

@media (max-width: 1100px) {
  .actions-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .actions-page {
    padding: 16px;
  }

  .actions-header,
  .action-preview-header {
    flex-direction: column;
  }

  .actions-toolbar label,
  .action-passport,
  .action-meta-grid {
    min-width: 100%;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  .interfaces-layout {
    grid-template-columns: 1fr;
  }

  .interface-groups {
    overflow-x: auto;
  }
}

@media (max-width: 760px) {
  .interfaces-page {
    padding: 16px;
  }

  .interfaces-header,
  .interface-preview-header {
    flex-direction: column;
  }

  .interfaces-toolbar label,
  .interface-passport {
    min-width: 100%;
  }

  .demo-form-block,
  .demo-kpi-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .topbar,
  .page-title,
  .desktop-hero,
  .profile-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .desktop-grid,
  .stats-row {
    grid-template-columns: 1fr;
  }
}

.marketing-page .section-head {
  display: block;
  max-width: 760px;
  margin: 0 0 38px;
}

.marketing-page .section-head.center {
  margin-right: auto;
  margin-left: auto;
  text-align: center;
}

.marketing-page .section-head h2,
.marketing-page .process-card h2,
.marketing-page .cta-card h2 {
  margin: 0;
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1.1;
}

.marketing-page .section-head p,
.marketing-page .cta-card p {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.marketing-page .hero-actions {
  gap: 14px;
}

@media (max-width: 1100px) {
  .marketing-nav {
    min-height: 110px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding: 18px 0;
  }

  .marketing-hero,
  .features-inner,
  .process-card {
    grid-template-columns: 1fr;
  }

  .marketing-hero {
    padding-top: 70px;
  }

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

  .process-flow {
    grid-template-columns: 1fr;
  }

  .process-flow span {
    display: none;
  }
}

@media (max-width: 720px) {
  .marketing-container,
  .marketing-nav,
  .marketing-hero {
    width: min(100% - 28px, 1475px);
  }

  .marketing-menu {
    display: none;
  }

  .marketing-brand {
    font-size: 22px;
  }

  .marketing-hero {
    gap: 42px;
    padding: 48px 0 72px;
  }

  .marketing-eyebrow {
    font-size: 16px;
  }

  .hero-copy h1 {
    font-size: 42px;
  }

  .hero-lead {
    font-size: 18px;
  }

  .dashboard-mockup {
    grid-template-columns: 1fr;
  }

  .dashboard-mockup aside {
    display: none;
  }

  .mock-cards,
  .modules-grid {
    grid-template-columns: 1fr;
  }

  .process-card,
  .cta-card {
    padding: 28px 18px;
  }
}

.directories-page {
  display: grid;
  gap: 20px;
  padding: 28px;
  color: #111827;
}

.directories-header,
.directories-toolbar,
.directories-stats article,
.table-card,
.form-card,
.danger-zone {
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
}

.directories-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 26px;
}

.directories-header h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
}

.directories-header p,
.directories-table small,
.directory-fields-table small,
.directory-records-table small {
  display: block;
  margin-top: 6px;
  color: #64748b;
}

.directories-actions,
.action-menu,
.directories-toolbar form,
.check-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.directories-toolbar {
  padding: 14px;
}

.directories-toolbar input,
.directories-toolbar select,
.directory-form input,
.directory-form select,
.directory-form textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #d8e0ec;
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: #111827;
  font: inherit;
}

.directories-toolbar input {
  max-width: 360px;
}

.directory-form textarea {
  min-height: 90px;
  padding-top: 10px;
  resize: vertical;
}

.directories-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.directories-stats article {
  padding: 18px;
}

.directories-stats span,
.directory-form label span {
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

.directories-stats strong {
  display: block;
  margin-top: 8px;
  font-size: 26px;
}

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

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

.data-table th,
.data-table td {
  border-bottom: 1px solid #e5e7eb;
  padding: 13px 14px;
  text-align: left;
  vertical-align: top;
}

.data-table th {
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.data-table code {
  border-radius: 6px;
  background: #eef2ff;
  padding: 3px 7px;
  color: #1d4ed8;
  font-size: 12px;
}

.access-badge,
.status-badge,
.notice {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
}

.access-badge {
  background: #eff6ff;
  color: #1d4ed8;
}

.status-badge.on {
  background: #dcfce7;
  color: #15803d;
}

.status-badge.off {
  background: #fee2e2;
  color: #b91c1c;
}

.notice {
  justify-content: center;
  border-radius: 8px;
  padding: 12px 16px;
}

.notice.success {
  background: #ecfdf5;
  color: #047857;
}

.notice.error {
  background: #fef2f2;
  color: #b91c1c;
}

.form-card,
.danger-zone {
  padding: 22px;
}

.form-card h2,
.danger-zone h2 {
  margin: 0 0 16px;
  font-size: 18px;
}

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

.form-grid {
  display: grid;
  gap: 14px;
}

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

.form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.directory-form label {
  display: grid;
  gap: 7px;
}

.check-row label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}

.check-row input,
.directory-field-card input[type="checkbox"] {
  width: auto;
  min-height: auto;
}

.directory-field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.directory-field-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 14px;
  background: #f8fafc;
}

.directory-field-card small {
  color: #64748b;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, .38);
}

.modal[aria-hidden="false"] {
  display: grid;
}

.modal-panel {
  width: min(760px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(15, 23, 42, .25);
}

.modal-panel header,
.directory-form footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-panel header {
  border-bottom: 1px solid #e5e7eb;
  padding: 18px 20px;
}

.modal-panel header h2 {
  margin: 0;
  font-size: 20px;
}

.modal-panel header button {
  border: 0;
  background: transparent;
  font-size: 26px;
  font-weight: 900;
  cursor: pointer;
}

.modal-panel .directory-form {
  padding: 20px;
}

.inline-editor summary {
  width: max-content;
  cursor: pointer;
  list-style: none;
}

.inline-editor form {
  margin-top: 12px;
  min-width: 520px;
}

.btn.small {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.btn.danger {
  border-color: #fecaca;
  background: #dc2626;
  color: #fff;
}

.empty-cell {
  padding: 30px !important;
  color: #64748b;
  text-align: center !important;
}

@media (max-width: 980px) {
  .directories-header {
    align-items: stretch;
    flex-direction: column;
  }

  .directories-stats,
  .form-grid.two,
  .form-grid.three,
  .directory-field-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .directories-page {
    padding: 16px;
  }
}

.library-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.create-app-card {
  cursor: pointer;
  border-style: dashed !important;
  background: #f8fbff !important;
}

.library-source-badge.draft {
  background: #fff7ed;
  color: #c2410c;
}

.app-create-form {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.app-create-form label {
  display: grid;
  gap: 8px;
}

.app-create-form label span {
  color: #475569;
  font-size: 13px;
  font-weight: 900;
}

.app-create-form input,
.app-create-form select,
.app-create-form textarea,
.status-form input,
.status-form select,
.status-form textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #d8e0ec;
  border-radius: 8px;
  padding: 0 12px;
  font: inherit;
}

.app-create-form textarea,
.status-form textarea {
  min-height: 88px;
  padding-top: 10px;
  resize: vertical;
}

.app-create-form footer,
.status-form footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.app-builder-page {
  display: grid;
  gap: 16px;
  padding: 24px;
  color: #111827;
}

.builder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
  padding: 20px 24px;
}

.builder-back {
  display: inline-flex;
  margin-bottom: 8px;
  color: #2563eb;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.builder-header h1 {
  margin: 0;
  font-size: 26px;
}

.builder-header p {
  margin: 7px 0 0;
  color: #64748b;
}

.builder-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.builder-status {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  border-radius: 999px;
  padding: 0 12px;
  background: #fff7ed;
  color: #c2410c;
  font-size: 12px;
  font-weight: 900;
}

.builder-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.builder-tabs button {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  background: #eef2f7;
  color: #475569;
  font-weight: 900;
}

.builder-tabs button.active {
  background: #2563eb;
  color: #fff;
}

.builder-tabs button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.builder-tab-panel {
  display: none;
}

.builder-tab-panel.active {
  display: grid;
}

.stages-tab {
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
}

.canvas-side-panel,
.process-canvas-shell {
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
}

.canvas-side-panel {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 18px;
}

.canvas-side-panel h2 {
  margin: 0;
  font-size: 20px;
}

.canvas-side-panel p,
.canvas-hint,
.canvas-toolbar span {
  color: #64748b;
  font-size: 14px;
  line-height: 1.45;
}

.canvas-hint {
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  padding: 12px;
}

.canvas-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #e5e7eb;
  padding: 12px 16px;
}

.process-canvas {
  position: relative;
  height: 620px;
  overflow: auto;
  background-color: #fbfdff;
  background-image:
    linear-gradient(#e8eef7 1px, transparent 1px),
    linear-gradient(90deg, #e8eef7 1px, transparent 1px);
  background-size: 28px 28px;
}

.transitions-layer,
.statuses-layer {
  position: absolute;
  inset: 0;
  min-width: 1400px;
  min-height: 900px;
}

.transitions-layer {
  z-index: 1;
  pointer-events: auto;
}

.statuses-layer {
  z-index: 2;
  pointer-events: none;
}

.transition-path {
  fill: none;
  stroke: #2563eb;
  stroke-width: 2.5;
  pointer-events: none;
  transition: stroke-width .16s ease, filter .16s ease;
}

.transition-path.temporary {
  stroke-dasharray: 7 5;
  opacity: .75;
}

.transition-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 20;
  cursor: pointer;
  pointer-events: stroke;
}

.transition-line-group {
  pointer-events: auto;
}

.transition-line-group:hover .transition-line {
  stroke-width: 5;
  filter: drop-shadow(0 2px 6px rgba(37, 99, 235, .25));
}

.transition-delete-wrapper {
  visibility: hidden;
  opacity: 0;
  overflow: visible;
  pointer-events: auto;
  transition: opacity .12s ease, visibility .12s ease;
}

.transition-line-group:hover .transition-delete-wrapper {
  visibility: visible;
  opacity: 1;
}

.transition-delete-btn {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #fecaca;
  border-radius: 999px;
  background: #fff;
  color: #dc2626;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .18);
  cursor: pointer;
  pointer-events: auto;
}

.transition-delete-btn .svg-icon {
  width: 15px;
  height: 15px;
}

.transition-delete-btn:hover {
  background: #fef2f2;
  border-color: #f87171;
}

.status-node {
  position: absolute;
  width: 230px;
  min-height: 88px;
  display: grid;
  grid-template-columns: 7px 1fr;
  align-items: stretch;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .08);
  cursor: grab;
  pointer-events: auto;
  user-select: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}

.status-node:hover {
  z-index: 8;
  border-color: var(--status-color, #2563eb);
  box-shadow: 0 18px 42px rgba(37, 99, 235, .14);
}

.status-node.dragging {
  z-index: 5;
  cursor: grabbing;
  box-shadow: 0 20px 44px rgba(37, 99, 235, .18);
}

.status-node-bar {
  border-radius: 8px 0 0 8px;
  background: var(--status-color, #2563eb);
}

.status-node-body {
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 13px 10px 13px 14px;
}

.status-node-body strong {
  font-size: 16px;
}

.status-node-body span {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.status-node-menu {
  width: 34px;
  border: 0;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  font-weight: 900;
}

.status-connector {
  position: absolute;
  top: 50%;
  right: -10px;
  width: 20px;
  height: 20px;
  border: 3px solid #fff;
  border-radius: 999px;
  background: #2563eb;
  box-shadow: 0 4px 12px rgba(37, 99, 235, .35);
  cursor: crosshair;
}

.status-node:hover .status-connector {
  transform: scale(1.12);
}

.status-hover-actions {
  position: absolute;
  left: 12px;
  top: calc(100% + 6px);
  z-index: 50;
  display: flex;
  max-width: 310px;
  flex-wrap: wrap;
  gap: 6px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .12);
  padding: 8px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity .16s ease, transform .16s ease;
}

.status-hover-actions.open-above {
  top: auto;
  bottom: calc(100% + 6px);
  transform: translateY(4px);
}

.status-hover-actions::before {
  content: "";
  position: absolute;
  left: -8px;
  right: -8px;
  top: -14px;
  height: 14px;
}

.status-hover-actions.open-above::before {
  top: auto;
  bottom: -14px;
}

.status-node:hover .status-hover-actions,
.status-node.is-hovering .status-hover-actions,
.status-hover-actions:focus-within {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.status-hover-actions button {
  min-height: 30px;
  border: 1px solid #d8e0ec;
  border-radius: 6px;
  background: #f8fafc;
  color: #0f172a;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.status-hover-actions button:hover {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.status-menu {
  position: absolute;
  top: 38px;
  right: 8px;
  z-index: 7;
  display: grid;
  min-width: 170px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
  padding: 6px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, .16);
}

.status-menu button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  padding: 9px 10px;
  text-align: left;
  font-weight: 800;
  cursor: pointer;
}

.status-menu button:hover {
  background: #eff6ff;
  color: #1d4ed8;
}

.status-modal-panel {
  width: min(560px, 100%);
}

.status-form {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.status-form label {
  display: grid;
  gap: 8px;
}

.status-form label span {
  color: #475569;
  font-size: 13px;
  font-weight: 900;
}

.interfaces-tab {
  grid-template-columns: 280px minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
}

.erp-blocks-panel,
.interface-workspace,
.interface-settings-panel {
  min-width: 0;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .04);
}

.erp-blocks-panel,
.interface-settings-panel {
  position: sticky;
  top: 94px;
  display: grid;
  gap: 14px;
  padding: 16px;
}

.erp-blocks-panel h2,
.interface-settings-panel h2,
.interface-workspace h2 {
  margin: 0;
  color: #0f172a;
  font-size: 20px;
  font-weight: 900;
}

.erp-blocks-panel p,
.interface-settings-panel p,
.interface-workspace-head p,
.interface-mode-card p {
  margin: 6px 0 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.45;
}

.erp-blocks-list {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 230px);
  overflow: auto;
  padding-right: 4px;
}

.erp-block-search {
  min-height: 40px;
  border: 1px solid #cfd9ea;
  border-radius: 8px;
  padding: 0 12px;
  color: #172033;
  font-weight: 800;
}

.erp-block-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
  padding: 11px;
  color: #172033;
  text-align: left;
}

.erp-block-card:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}

.erp-block-card strong {
  display: block;
  font-size: 14px;
  font-weight: 900;
}

.erp-block-card small {
  display: block;
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
}

.erp-block-card .btn {
  margin-top: 9px;
  min-height: 30px;
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.erp-block-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 16px;
  font-weight: 900;
}

.erp-block-icon.small {
  width: 34px;
  height: 34px;
  font-size: 13px;
}

.interface-workspace {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.interface-workspace-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid #eef2f7;
  padding-bottom: 14px;
}

.device-switch {
  display: flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #f8fafc;
}

.device-switch button {
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  padding: 0 10px;
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.device-switch button.active {
  background: #2563eb;
  color: #fff;
}

.interface-mode-card {
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
  padding: 12px;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #172033;
  font-size: 14px;
  font-weight: 900;
}

.switch-row input {
  width: 18px;
  min-height: 18px;
  accent-color: #2563eb;
}

.switch-row.compact {
  justify-content: flex-start;
}

.status-interface-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.status-interface-chip,
.interface-empty-chip {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  border: 1px solid #dbe3ef;
  border-radius: 999px;
  background: #fff;
  padding: 0 11px;
  color: #172033;
  font-weight: 900;
}

.status-interface-chip strong {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  border-radius: 999px;
  background: #eef2ff;
  color: #1d4ed8;
  padding: 0 8px;
  font-size: 11px;
}

.status-interface-chip.active {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.status-interface-chip.disabled {
  cursor: not-allowed;
  background: #f8fafc;
  color: #94a3b8;
}

.status-interface-chip.disabled strong {
  background: #e5e7eb;
  color: #64748b;
}

.interface-canvas {
  overflow: hidden;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #f8fafc;
}

.interface-canvas-message {
  border-bottom: 1px solid #dbe3ef;
  background: #fff;
  padding: 10px 12px;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

.interface-blocks-canvas {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
  min-height: 520px;
  padding: 14px;
  align-content: start;
}

.interface-empty-state {
  grid-column: 1 / -1;
  display: grid;
  min-height: 220px;
  place-items: center;
  align-content: center;
  gap: 6px;
  border: 1px dashed #bfdbfe;
  border-radius: 8px;
  background: #ffffff;
  color: #64748b;
  text-align: center;
}

.interface-empty-state strong {
  color: #0f172a;
  font-size: 18px;
}

.interface-canvas-block {
  grid-column: span 12;
  display: grid;
  gap: 14px;
  min-height: 148px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
  cursor: pointer;
}

.interface-canvas-block.width-6 { grid-column: span 6; }
.interface-canvas-block.width-4 { grid-column: span 4; }
.interface-canvas-block.width-3 { grid-column: span 3; }

.interface-canvas-block.selected {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.interface-canvas-block.muted-block {
  opacity: .62;
}

.interface-canvas-block header {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.interface-canvas-block strong {
  display: block;
  color: #0f172a;
  font-size: 15px;
  font-weight: 900;
}

.interface-canvas-block small {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  color: #64748b;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.interface-canvas-block em {
  border-radius: 999px;
  background: #eef2ff;
  color: #1d4ed8;
  padding: 4px 8px;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.block-preview-lines {
  display: grid;
  gap: 8px;
}

.block-preview-lines span {
  height: 12px;
  border-radius: 999px;
  background: #e8eef7;
}

.block-preview-lines span:nth-child(2) {
  width: 82%;
}

.block-preview-lines span:nth-child(3) {
  width: 62%;
}

.interface-canvas-block footer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.interface-block-card-actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.interface-block-card-actions .btn.icon {
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border-radius: 7px;
}

.interface-block-card-actions .btn.danger {
  border-color: #fecaca;
  background: #fff1f2;
  color: #dc2626;
}

.interface-canvas-block footer span {
  border-radius: 999px;
  background: #fff7ed;
  color: #c2410c;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 900;
}

.interface-canvas-block footer .block-settings-btn {
  min-height: 28px;
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.block-preview-lines.fields-preview,
.block-preview-lines.table-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.block-preview-lines.fields-preview span,
.block-preview-lines.table-preview span {
  width: auto;
  height: auto;
  border: 1px solid #dbe3ef;
  border-radius: 999px;
  background: #f8fafc;
  padding: 5px 9px;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}

.interface-admin-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.interface-admin-links a {
  border-radius: 999px;
  background: #eef2ff;
  padding: 7px 10px;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.interface-settings-panel .settings-section {
  display: grid;
  gap: 12px;
  border-top: 1px solid #eef2f7;
  padding-top: 14px;
}

.interface-settings-panel h3 {
  margin: 0;
  color: #172033;
  font-size: 16px;
}

.interface-settings-panel label {
  display: grid;
  gap: 7px;
}

.interface-settings-panel label span {
  color: #475569;
  font-size: 13px;
  font-weight: 900;
}

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

.block-actions .danger {
  grid-column: 1 / -1;
  border-color: #fecaca;
  background: #fff1f2;
  color: #b42318;
}

.stage-actions-tab {
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.automation-tab {
  grid-template-columns: 280px minmax(0, 1fr) 340px;
  gap: 16px;
  align-items: start;
}

.automation-procedure-tab {
  grid-template-columns: 1fr;
}

.automation-procedure-toolbar,
.automation-procedure-list-card,
.automation-editor-card {
  border: 1px solid #d8e0ec;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 30px rgba(15, 23, 42, .04);
}

.automation-procedure-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 18px;
}

.automation-procedure-toolbar a,
.automation-editor-head a {
  color: #2563eb;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.automation-procedure-toolbar h2,
.automation-editor-head h2 {
  margin: 8px 0 4px;
  color: #0f172a;
}

.automation-procedure-toolbar p,
.automation-editor-head p,
.automation-action-column p {
  margin: 0;
  color: #64748b;
  font-size: 14px;
}

.automation-procedure-controls {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(180px, 240px) auto;
  gap: 10px;
  align-items: center;
}

.automation-procedure-controls input,
.automation-procedure-controls select,
.automation-editor-settings input,
.automation-action-fields input,
.automation-action-fields textarea {
  min-height: 42px;
  border: 1px solid #d8e0ec;
  border-radius: 8px;
  background: #fff;
  padding: 0 12px;
  font: inherit;
}

.automation-action-fields textarea {
  min-height: 88px;
  padding: 10px 12px;
  resize: vertical;
}

.automation-procedure-layout,
.automation-editor-card,
.automation-action-list,
.automation-action-fields,
.automation-create-form {
  display: grid;
  gap: 14px;
}

.automation-procedure-list-card {
  overflow: auto;
}

.automation-procedure-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.automation-procedure-table th,
.automation-procedure-table td {
  border-bottom: 1px solid #e5edf7;
  padding: 14px;
  text-align: left;
  vertical-align: middle;
}

.automation-procedure-table th {
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.automation-procedure-table td strong,
.automation-procedure-table td span {
  display: block;
}

.automation-procedure-table td span {
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
}

.automation-mark {
  color: #0f172a;
  font-size: 18px;
  font-weight: 900;
}

.automation-count-badges {
  display: inline-flex;
  gap: 6px;
}

.automation-count-badges b,
.automation-count-badges em {
  min-width: 28px;
  border-radius: 999px;
  padding: 4px 8px;
  text-align: center;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.automation-count-badges b {
  background: #dcfce7;
  color: #047857;
}

.automation-count-badges em {
  background: #fee2e2;
  color: #b91c1c;
}

.automation-editor-card {
  padding: 18px;
}

.automation-editor-head,
.automation-editor-actions,
.automation-action-column > header,
.automation-procedure-action header,
.automation-procedure-action footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.automation-editor-head {
  align-items: flex-start;
  border-bottom: 1px solid #e5edf7;
  padding-bottom: 16px;
}

.automation-editor-settings {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 140px repeat(2, minmax(190px, auto));
  gap: 12px;
  align-items: end;
}

.automation-editor-settings label,
.automation-action-fields label {
  display: grid;
  gap: 7px;
}

.automation-editor-settings label > span,
.automation-action-fields label > span {
  color: #475569;
  font-size: 12px;
  font-weight: 900;
}

.automation-action-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.automation-action-column {
  display: grid;
  gap: 12px;
  align-content: start;
  border: 1px solid #d8e0ec;
  border-radius: 8px;
  background: #f8fafc;
  padding: 14px;
}

.automation-action-column h3,
.automation-procedure-action strong {
  margin: 0;
  color: #0f172a;
}

.automation-procedure-action {
  display: grid;
  gap: 12px;
  border: 1px solid #d8e0ec;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.automation-procedure-action.disabled {
  opacity: .58;
  background: #f1f5f9;
}

.drag-handle {
  color: #94a3b8;
  cursor: grab;
  font-weight: 900;
}

.automation-plus {
  width: 58px;
  height: 58px;
  justify-self: center;
  border: 0;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 16px 30px rgba(37, 99, 235, .2);
}

.automation-create-panel {
  max-width: 520px;
}

.automation-sidebar,
.automation-workspace,
.automation-log-panel {
  min-width: 0;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .04);
}

.automation-sidebar,
.automation-log-panel {
  position: sticky;
  top: 94px;
  display: grid;
  gap: 14px;
  padding: 16px;
}

.automation-sidebar h2,
.automation-log-panel h2,
.automation-head h2 {
  margin: 0;
  color: #0f172a;
  font-size: 20px;
  font-weight: 900;
}

.automation-sidebar p,
.automation-log-panel p,
.automation-head p,
.automation-muted {
  margin: 6px 0 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.45;
}

.automation-sidebar label,
.automation-form label,
.automation-action-settings label {
  display: grid;
  gap: 7px;
}

.automation-sidebar label span,
.automation-form label > span,
.automation-action-settings label > span {
  color: #475569;
  font-size: 13px;
  font-weight: 900;
}

.automation-sidebar input,
.automation-sidebar select,
.automation-form input,
.automation-form select,
.automation-form textarea,
.automation-action-settings input,
.automation-action-settings textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid #cfd9ea;
  border-radius: 8px;
  padding: 0 10px;
}

.automation-form textarea,
.automation-action-settings textarea {
  padding: 10px;
}

.automation-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #eef2f7;
  padding: 16px 18px;
}

.automation-head-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.automation-head a {
  display: inline-flex;
  margin-bottom: 7px;
  color: #2563eb;
  font-size: 13px;
  font-weight: 900;
}

.automation-list {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.automation-rule-card {
  display: grid;
  gap: 12px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.automation-rule-card header,
.automation-rule-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.automation-rule-card header strong,
.automation-rule-card header span {
  display: block;
}

.automation-rule-card header strong {
  color: #0f172a;
  font-size: 16px;
  font-weight: 900;
}

.automation-rule-card header span,
.automation-rule-meta span {
  color: #64748b;
  font-size: 13px;
}

.automation-rule-card em {
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  padding: 7px 10px;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.automation-rule-card em.active {
  background: #ecfdf3;
  color: #027a48;
}

.automation-rule-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.automation-rule-meta span {
  border-radius: 8px;
  background: #f8fafc;
  padding: 9px 10px;
}

.automation-rule-card footer {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.automation-rule-card .danger {
  border-color: #fecaca;
  background: #fff1f2;
  color: #b42318;
}

.automation-card-actions {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 20px;
  color: #0f172a;
  font-size: 13px;
  font-weight: 800;
}

.automation-empty {
  display: grid;
  gap: 6px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 28px;
  color: #64748b;
  text-align: center;
}

.automation-empty.compact {
  padding: 16px;
}

.automation-empty strong {
  color: #0f172a;
  font-size: 18px;
}

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

.automation-log-item,
.automation-log-empty {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px;
  background: #f8fafc;
}

.automation-log-item.success {
  background: #ecfdf3;
  border-color: #bbf7d0;
}

.automation-log-item.error {
  background: #fff1f2;
  border-color: #fecaca;
}

.automation-log-item.skipped {
  background: #fffbeb;
  border-color: #fde68a;
}

.automation-log-item strong,
.automation-log-item span,
.automation-log-item p {
  display: block;
}

.automation-log-item strong {
  color: #0f172a;
  font-size: 13px;
  font-weight: 900;
}

.automation-log-item span,
.automation-log-item p,
.automation-log-empty {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 12px;
}

.automation-modal-panel {
  width: min(1180px, 100%);
}

.automation-form-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  padding: 18px;
}

.automation-form-column,
.automation-action-settings {
  display: grid;
  gap: 12px;
}

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

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

.automation-check-list {
  display: grid;
  gap: 6px;
  max-height: 150px;
  overflow: auto;
  border: 1px solid #eef2f7;
  border-radius: 8px;
  padding: 8px;
}

.automation-action-settings {
  border-top: 1px solid #eef2f7;
  padding-top: 12px;
}

.automation-action-settings h3 {
  margin: 0;
  color: #0f172a;
  font-size: 15px;
  font-weight: 900;
}

.automation-action-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
}

.automation-action-chain {
  display: grid;
  gap: 10px;
}

.automation-chain-item {
  display: grid;
  gap: 12px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}

.automation-chain-item header,
.automation-chain-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.automation-chain-item header strong {
  color: #0f172a;
  font-size: 14px;
  font-weight: 900;
}

.automation-chain-item header div {
  display: flex;
  gap: 6px;
}

.automation-chain-controls {
  align-items: end;
}

.automation-chain-controls label:first-child {
  flex: 1;
}

.automation-action-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.automation-action-fields .automation-muted {
  grid-column: 1 / -1;
}

.btn.icon {
  min-width: 38px;
  padding-inline: 10px;
}

.automation-form footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid #eef2f7;
  padding: 14px 18px;
}

.access-page {
  display: grid;
  gap: 18px;
  padding: 28px;
}

.access-header,
.access-toolbar,
.access-side-card,
.access-panel {
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .04);
}

.access-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 26px;
}

.access-header h1,
.access-side-card h2,
.access-panel h2 {
  margin: 0;
  color: #0f172a;
  font-weight: 900;
}

.access-header p {
  margin: 6px 0 0;
  color: #64748b;
}

.access-toolbar {
  padding: 14px;
}

.access-toolbar form,
.access-layout,
.access-form,
.access-main,
.access-group-list {
  display: grid;
  gap: 12px;
}

.access-toolbar form {
  grid-template-columns: minmax(220px, 1fr) auto auto;
}

.access-layout {
  grid-template-columns: 320px minmax(0, 1fr);
  align-items: start;
}

.access-side-card,
.access-panel {
  padding: 16px;
}

.access-form label,
.builder-access-rule label {
  display: grid;
  gap: 7px;
}

.access-form label > span,
.builder-access-rule label > span {
  color: #475569;
  font-size: 13px;
  font-weight: 900;
}

.access-form input,
.access-form select,
.access-form textarea,
.access-toolbar input,
.builder-access-rule select {
  width: 100%;
  min-height: 40px;
  border: 1px solid #cfd9ea;
  border-radius: 8px;
  padding: 0 10px;
}

.access-form textarea {
  padding: 10px;
}

.access-check-grid,
.builder-access-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.access-check-list {
  display: grid;
  gap: 6px;
  max-height: 160px;
  overflow: auto;
  border: 1px solid #eef2f7;
  border-radius: 8px;
  padding: 8px;
}

.access-check-list.tall {
  max-height: 320px;
}

.access-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.access-tags span {
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 900;
}

.access-group-list a {
  display: grid;
  gap: 4px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px;
  color: #0f172a;
}

.access-group-list a.active {
  border-color: #2563eb;
  background: #eff6ff;
}

.access-group-list span,
.data-table small {
  display: block;
  color: #64748b;
  font-size: 12px;
}

.access-matrix-table input {
  width: 18px;
  height: 18px;
}

.access-builder-tab {
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.access-builder-side,
.access-builder-panel {
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .04);
}

.access-builder-side {
  position: sticky;
  top: 94px;
  display: grid;
  gap: 14px;
  padding: 16px;
}

.access-builder-side h2,
.access-builder-panel h2 {
  margin: 0;
  color: #0f172a;
  font-size: 20px;
  font-weight: 900;
}

.access-builder-side p {
  margin: 6px 0 0;
  color: #64748b;
  font-size: 13px;
}

.access-builder-side nav,
.access-builder-main {
  display: grid;
  gap: 12px;
}

.access-builder-side a {
  border-radius: 8px;
  background: #f1f5f9;
  color: #0f172a;
  padding: 10px 12px;
  font-weight: 900;
}

.access-builder-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.access-builder-side label,
.constructor-access-row label {
  display: grid;
  gap: 7px;
}

.access-builder-side label span,
.constructor-access-row label > span {
  color: #475569;
  font-size: 13px;
  font-weight: 900;
}

.access-builder-side select,
.constructor-access-row select {
  width: 100%;
  min-height: 40px;
  border: 1px solid #cfd9ea;
  border-radius: 8px;
  padding: 0 10px;
}

.access-builder-actions {
  display: grid;
  gap: 8px;
}

.access-manage-link {
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  color: #2563eb;
  padding: 10px 12px;
  font-weight: 900;
  text-align: center;
}

.access-builder-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.access-builder-head h2,
.access-builder-head p {
  margin: 0;
}

.access-builder-head p {
  margin-top: 6px;
  color: #64748b;
  font-size: 13px;
}

.access-builder-head span {
  align-self: flex-start;
  border-radius: 999px;
  background: #eef2ff;
  color: #2563eb;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 900;
}

.access-rule-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.access-rule-tabs button {
  border: 0;
  border-radius: 8px;
  background: #f1f5f9;
  color: #0f172a;
  padding: 10px 12px;
  font-weight: 900;
}

.access-rule-tabs button.active {
  background: #2563eb;
  color: #fff;
}

.constructor-access-row {
  display: grid;
  gap: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}

.constructor-access-row header,
.constructor-access-row footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.constructor-access-row header strong,
.constructor-access-row header span {
  display: block;
}

.constructor-access-row header strong {
  color: #0f172a;
  font-size: 15px;
  font-weight: 900;
}

.constructor-access-row header span {
  margin-top: 3px;
  color: #64748b;
  font-size: 12px;
}

.constructor-access-subjects {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.access-stage-details {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px;
}

.access-stage-details summary {
  cursor: pointer;
  color: #0f172a;
  font-weight: 900;
}

.builder-access-rule {
  display: grid;
  gap: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}

.builder-access-rule header,
.builder-access-rule footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.builder-access-rule header strong,
.builder-access-rule header span {
  display: block;
}

.builder-access-rule header span {
  margin-top: 3px;
  color: #64748b;
  font-size: 12px;
}

.interface-block-settings-panel {
  width: min(1240px, 100%);
}

.interface-block-settings-panel header p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 13px;
}

.block-settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid #eef2f7;
  padding: 12px 18px;
}

.block-settings-tabs button {
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  background: #eef2f7;
  padding: 0 14px;
  color: #334155;
  font-weight: 900;
  cursor: pointer;
}

.block-settings-tabs button.active {
  background: #2563eb;
  color: #fff;
}

.block-settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  min-height: 420px;
}

.block-settings-main {
  min-width: 0;
}

.block-settings-side {
  border-left: 1px solid #eef2f7;
  background: #f8fafc;
}

.block-settings-side-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.block-settings-side-panel[hidden],
.block-settings-main[hidden] {
  display: none;
}

.block-settings-side-panel h3 {
  margin: 0;
  color: #0f172a;
  font-size: 16px;
  font-weight: 900;
}

.block-settings-side-panel label,
.block-new-field-form label {
  display: grid;
  gap: 6px;
  color: #475569;
  font-size: 12px;
  font-weight: 900;
}

.block-settings-side-panel input,
.block-settings-side-panel select,
.block-new-field-form input,
.block-new-field-form select {
  min-height: 38px;
  border: 1px solid #cfd9ea;
  border-radius: 8px;
  background: #fff;
  padding: 0 10px;
  color: #172033;
  font-weight: 800;
}

.block-settings-side-panel input[type="color"] {
  padding: 4px;
}

.block-settings-side-panel pre {
  max-height: 280px;
  overflow: auto;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  white-space: pre-wrap;
}

.block-settings-tools,
.block-settings-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #eef2f7;
  padding: 14px 18px;
}

.block-settings-footer {
  border-top: 1px solid #eef2f7;
  border-bottom: 0;
  justify-content: flex-end;
}

.block-settings-tools input {
  width: min(420px, 100%);
  min-height: 42px;
  border: 1px solid #cfd9ea;
  border-radius: 8px;
  padding: 0 12px;
}

.block-settings-tools span {
  color: #475569;
  font-size: 13px;
  font-weight: 900;
}

.block-new-field-form {
  display: grid;
  gap: 12px;
  border-bottom: 1px solid #eef2f7;
  background: #f8fafc;
  padding: 14px 18px;
}

.block-new-field-form[hidden] {
  display: none;
}

.block-new-field-form footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.block-new-field-form footer span {
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

.block-settings-fields {
  display: grid;
  gap: 8px;
  max-height: min(58vh, 620px);
  overflow: auto;
  padding: 14px 18px;
}

.block-settings-field {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 76px minmax(160px, 1fr) minmax(160px, 1fr) 72px 82px;
  gap: 8px;
  align-items: center;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px;
}

.block-settings-field input[type="text"],
.block-settings-field input[type="number"] {
  min-width: 0;
  min-height: 36px;
  border: 1px solid #dbe3ef;
  border-radius: 7px;
  padding: 0 9px;
}

.field-main-toggle,
.mini-check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #172033;
  font-size: 13px;
  font-weight: 900;
}

.mini-check {
  justify-content: center;
  color: #475569;
}

.field-main-toggle input,
.mini-check input {
  width: 16px;
  height: 16px;
  accent-color: #2563eb;
}

@media (max-width: 1100px) {
  .block-settings-layout {
    grid-template-columns: 1fr;
  }

  .block-settings-side {
    border-top: 1px solid #eef2f7;
    border-left: 0;
  }

  .block-settings-field {
    grid-template-columns: 1fr 72px;
  }
}

.custom-fields-page {
  display: grid;
  gap: 20px;
  padding: 28px;
}

.custom-fields-header,
.custom-field-form-panel,
.custom-fields-main,
.table-card {
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .04);
}

.custom-fields-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 26px;
}

.custom-fields-header h1 {
  margin: 8px 0 4px;
  color: #0f172a;
}

.custom-fields-header p {
  margin: 0;
  color: #64748b;
}

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

.custom-fields-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.custom-field-form-panel,
.custom-fields-main {
  padding: 18px;
}

.custom-field-form-panel h2 {
  margin: 0 0 14px;
  color: #0f172a;
}

.custom-field-form {
  display: grid;
  gap: 12px;
}

.custom-field-form label {
  display: grid;
  gap: 7px;
}

.custom-field-form label span {
  color: #475569;
  font-size: 13px;
  font-weight: 900;
}

.custom-field-form input,
.custom-field-form select,
.custom-field-form textarea,
.custom-fields-filter input,
.custom-fields-filter select {
  width: 100%;
  min-height: 40px;
  border: 1px solid #cfd9ea;
  border-radius: 8px;
  padding: 0 10px;
}

.custom-field-form textarea {
  padding: 10px;
}

.custom-fields-filter {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 220px auto;
  gap: 10px;
  margin-bottom: 14px;
}

.custom-fields-table td:last-child {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.custom-fields-table strong,
.custom-fields-table small {
  display: block;
}

.custom-fields-table small {
  margin-top: 4px;
  color: #64748b;
}

.status-badge.green {
  background: #ecfdf3;
  color: #027a48;
}

.status-badge.gray {
  background: #f1f5f9;
  color: #475569;
}

.stage-actions-stages,
.stage-actions-workspace,
.stage-action-settings {
  min-width: 0;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .04);
}

.stage-actions-stages,
.stage-action-settings {
  position: sticky;
  top: 94px;
  display: grid;
  gap: 14px;
  padding: 16px;
}

.stage-actions-stages h2,
.stage-action-settings h2,
.stage-actions-head h2 {
  margin: 0;
  color: #0f172a;
  font-size: 20px;
  font-weight: 900;
}

.stage-actions-stages p,
.stage-action-settings p,
.stage-actions-head p,
.stage-action-muted {
  margin: 6px 0 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.45;
}

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

.stage-action-stage {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 44px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
  padding: 0 10px;
  color: #172033;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.stage-action-stage span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--status-color, #2563eb);
}

.stage-action-stage strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-action-stage em {
  min-width: 24px;
  border-radius: 999px;
  background: #eef2ff;
  color: #1d4ed8;
  padding: 3px 7px;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  text-align: center;
}

.stage-action-stage.active {
  border-color: #2563eb;
  background: #eff6ff;
}

.stage-actions-workspace {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.stage-actions-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  border-bottom: 1px solid #eef2f7;
  padding-bottom: 14px;
}

.stage-actions-head a {
  display: inline-flex;
  margin-bottom: 8px;
  color: #2563eb;
  font-size: 13px;
  font-weight: 900;
}

.stage-actions-head-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.stage-actions-list {
  display: grid;
  gap: 12px;
}

.stage-actions-empty {
  display: grid;
  min-height: 220px;
  place-items: center;
  align-content: center;
  gap: 6px;
  border: 1px dashed #bfdbfe;
  border-radius: 8px;
  background: #f8fbff;
  color: #64748b;
  text-align: center;
}

.stage-actions-empty strong {
  color: #0f172a;
  font-size: 18px;
}

.stage-action-card {
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  cursor: default;
}

.stage-action-card-summary {
  display: grid;
  grid-template-columns: 30px 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  cursor: pointer;
}

.stage-action-card.selected {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.stage-action-card.has-error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, .12);
}

.stage-action-card.disabled {
  opacity: .65;
}

.stage-action-order {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: #eff6ff;
  color: #2563eb;
  font-weight: 900;
}

.stage-action-drag {
  display: grid;
  width: 30px;
  height: 34px;
  place-items: center;
  border: 1px solid #dbe3ef;
  border-radius: 7px;
  background: #f8fafc;
  color: #475569;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
}

.stage-action-card-main {
  min-width: 0;
}

.stage-action-card-main header {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.stage-action-card-main strong {
  overflow: hidden;
  color: #0f172a;
  font-size: 16px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-action-card-main header span {
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.stage-action-card.disabled .stage-action-card-main header span {
  background: #e5e7eb;
  color: #475569;
}

.stage-action-card-main p {
  margin: 7px 0 10px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.4;
}

.stage-action-card-main footer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.stage-action-card-main footer em {
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  padding: 4px 8px;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.stage-action-card-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.stage-action-card-buttons button {
  min-height: 32px;
  border: 1px solid #dbe3ef;
  border-radius: 7px;
  background: #fff;
  padding: 0 10px;
  color: #172033;
  font-weight: 900;
  cursor: pointer;
}

.stage-action-card-buttons,
.stage-action-card-buttons button,
.stage-action-drag {
  cursor: default;
}

.stage-action-card-buttons button,
.stage-action-drag {
  cursor: pointer;
}

.stage-action-inline-settings {
  display: none;
  margin-top: 14px;
  border-top: 1px solid #eef2f7;
  padding-top: 14px;
}

.stage-action-card.selected .stage-action-inline-settings {
  display: grid;
  gap: 14px;
}

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

.stage-action-inline-grid .switch-row {
  align-self: end;
  min-height: 42px;
}

.stage-action-inline-settings .switch-row,
.stage-action-dynamic-settings .switch-row {
  display: flex;
  width: fit-content;
  min-height: 34px;
  grid-auto-flow: column;
  grid-template-columns: none;
  gap: 9px;
  align-items: center;
}

.stage-action-inline-settings .switch-row span,
.stage-action-dynamic-settings .switch-row span {
  color: #172033;
  font-size: 13px;
}

.stage-action-advanced {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px 12px;
}

.stage-action-advanced summary {
  color: #2563eb;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.stage-action-advanced pre {
  overflow: auto;
  max-height: 220px;
  margin: 10px 0 0;
  border-radius: 8px;
  background: #0f172a;
  color: #e2e8f0;
  padding: 12px;
  font-size: 12px;
  line-height: 1.45;
}

.stage-action-error {
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fef2f2;
  color: #991b1b;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 900;
}

.action-condition-rows,
.action-formula-rows {
  display: grid;
  gap: 8px;
}

.action-condition-row {
  display: grid;
  grid-template-columns: 150px minmax(150px, 1fr) 170px minmax(140px, 1fr) minmax(150px, 1fr) 34px;
  gap: 8px;
  align-items: center;
}

.action-formula-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 170px minmax(180px, 1fr) 140px 34px;
  gap: 8px;
  align-items: start;
}

.action-condition-row button,
.action-formula-row button {
  min-height: 42px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff1f2;
  color: #b42318;
  font-weight: 900;
  cursor: pointer;
}

.action-condition-options,
.action-formula-extras {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.action-variable-list {
  display: grid;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
  margin-top: 8px;
}

.action-variable-list button {
  border: 1px solid #dbe3ef;
  border-radius: 7px;
  background: #fff;
  color: #172033;
  padding: 7px 9px;
  text-align: left;
  cursor: pointer;
}

.add-stage-action-btn {
  justify-self: start;
}

.stage-action-settings-body {
  display: grid;
  gap: 12px;
}

.stage-action-settings label,
.stage-action-inline-settings label,
.stage-action-dynamic-settings label {
  display: grid;
  gap: 7px;
}

.stage-action-settings label span,
.stage-action-inline-settings label span,
.stage-action-dynamic-settings label span {
  color: #475569;
  font-size: 13px;
  font-weight: 900;
}

.stage-action-settings input,
.stage-action-settings select,
.stage-action-settings textarea,
.stage-action-inline-settings input,
.stage-action-inline-settings select,
.stage-action-inline-settings textarea,
.stage-action-dynamic-settings input,
.stage-action-dynamic-settings select,
.stage-action-dynamic-settings textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #d8e0ec;
  border-radius: 8px;
  padding: 9px 11px;
  background: #fff;
  color: #111827;
  font: inherit;
}

.stage-action-inline-settings label > input[type="checkbox"],
.stage-action-dynamic-settings label > input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  padding: 0;
  accent-color: #2563eb;
}

.stage-action-inline-settings .switch-row input[type="checkbox"],
.stage-action-dynamic-settings .switch-row input[type="checkbox"] {
  position: relative;
  width: 38px;
  min-width: 38px;
  height: 22px;
  min-height: 22px;
  margin: 0;
  appearance: none;
  border: 1px solid #cfd8e6;
  border-radius: 999px;
  background: #e5e7eb;
  padding: 0;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}

.stage-action-inline-settings .switch-row input[type="checkbox"]::after,
.stage-action-dynamic-settings .switch-row input[type="checkbox"]::after {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .18);
  content: "";
  transition: transform .15s ease;
}

.stage-action-inline-settings .switch-row input[type="checkbox"]:checked,
.stage-action-dynamic-settings .switch-row input[type="checkbox"]:checked {
  border-color: #22c55e;
  background: #22c55e;
}

.stage-action-inline-settings .switch-row input[type="checkbox"]:checked::after,
.stage-action-dynamic-settings .switch-row input[type="checkbox"]:checked::after {
  transform: translateX(16px);
}

.stage-action-dynamic-settings {
  display: grid;
  gap: 12px;
  border-top: 1px solid #eef2f7;
  padding-top: 12px;
}

.stage-action-dynamic-settings small {
  color: #64748b;
  font-size: 12px;
}

.action-library-modal[aria-hidden="true"] {
  display: none;
}

.action-library-panel {
  width: min(980px, calc(100% - 32px));
  max-height: calc(100vh - 48px);
  overflow: hidden;
}

.action-library-panel header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.action-library-panel header p {
  margin: 6px 0 0;
  color: #64748b;
}

.action-library-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid #eef2f7;
}

.action-library-list {
  display: grid;
  gap: 10px;
  max-height: 560px;
  overflow: auto;
  padding: 16px;
}

.action-library-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.action-library-item strong {
  color: #0f172a;
  font-size: 15px;
}

.action-library-item p {
  margin: 6px 0;
  color: #64748b;
  font-size: 13px;
}

.action-library-item span {
  color: #2563eb;
  font-size: 12px;
  font-weight: 900;
}

.action-library-item button {
  min-height: 36px;
  border: 1px solid #2563eb;
  border-radius: 8px;
  background: #2563eb;
  color: #fff;
  padding: 0 14px;
  font-weight: 900;
  cursor: pointer;
}

@media (max-width: 1100px) {
  .stages-tab,
  .interfaces-tab,
  .stage-actions-tab,
  .automation-tab,
  .access-builder-tab,
  .access-layout {
    grid-template-columns: 1fr;
  }

  .canvas-side-panel,
  .erp-blocks-panel,
  .interface-settings-panel,
  .stage-actions-stages,
  .stage-action-settings,
  .automation-sidebar,
  .automation-log-panel,
  .access-builder-side {
    position: static;
    order: 2;
  }

  .interface-workspace,
  .stage-actions-workspace,
  .automation-workspace {
    order: 1;
  }

  .access-toolbar form,
  .access-check-grid,
  .builder-access-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app-builder-page {
    padding: 16px;
  }

  .builder-header {
    align-items: stretch;
    flex-direction: column;
  }

  .interface-workspace-head {
    flex-direction: column;
  }

  .stage-actions-head,
  .automation-head,
  .stage-action-card-summary,
  .stage-action-inline-grid,
  .action-library-tools,
  .action-library-item {
    grid-template-columns: 1fr;
  }

  .automation-head,
  .automation-rule-card header,
  .automation-rule-card footer,
  .automation-form-main,
  .automation-switches,
  .automation-access-grid {
    align-items: stretch;
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .automation-rule-meta {
    grid-template-columns: 1fr;
  }

  .interface-canvas-block.width-6,
  .interface-canvas-block.width-4,
  .interface-canvas-block.width-3 {
    grid-column: span 12;
  }
}

.warehouse-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 14px;
  margin-bottom: 12px;
}

.warehouse-tabs a {
  white-space: nowrap;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
  padding: 10px 14px;
  font-weight: 800;
}

.warehouse-tabs a.active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 12px 28px rgba(37, 99, 235, .18);
}

.warehouse-journal-header,
.document-detail-header {
  align-items: flex-start;
}

.journal-header-actions,
.toolbar-actions,
.filter-actions,
.pagination-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.journal-header-actions {
  justify-content: flex-end;
}

.journal-total {
  width: 100%;
  text-align: right;
  color: var(--muted);
  font-weight: 800;
}

.warehouse-journal-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
}

.warehouse-filter-sidebar,
.warehouse-journal-panel,
.document-info-grid .panel,
.warehouse-document-page > .panel,
.empty-state-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, .04);
}

.warehouse-filter-sidebar,
.warehouse-document-page > .panel,
.empty-state-panel {
  padding: 20px;
}

.warehouse-filter-sidebar {
  align-self: start;
}

.warehouse-filter-sidebar form,
.warehouse-filter-sidebar label {
  display: grid;
  gap: 8px;
}

.warehouse-filter-sidebar form {
  gap: 14px;
}

.warehouse-filter-sidebar span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.warehouse-filter-sidebar input,
.warehouse-filter-sidebar select {
  width: 100%;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
}

.warehouse-journal-panel {
  min-width: 0;
  overflow: hidden;
}

.journal-table-toolbar,
.pagination-bar {
  justify-content: space-between;
  padding: 14px;
  border-bottom: 1px solid var(--border);
}

.pagination-bar {
  border-top: 1px solid var(--border);
  border-bottom: 0;
}

.journal-table-wrap {
  overflow: auto;
  max-height: calc(100vh - 330px);
}

.warehouse-journal-table {
  min-width: 1480px;
  font-size: 13px;
}

.warehouse-journal-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
}

.warehouse-journal-table tbody tr:hover {
  background: #f8fbff;
}

.journal-products {
  display: grid;
  gap: 4px;
  min-width: 220px;
}

.journal-products span,
.journal-products em {
  display: block;
}

.journal-products em {
  color: var(--primary);
  font-style: normal;
  font-weight: 800;
}

.document-badge-receipt { background: #dcfce7; color: #15803d; }
.document-badge-writeoff { background: #fee2e2; color: #b91c1c; }
.document-badge-transfer { background: #dbeafe; color: #1d4ed8; }
.document-badge-regrade { background: #f3e8ff; color: #7e22ce; }
.document-badge-inventory { background: #ffedd5; color: #c2410c; }

.document-summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.document-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 18px 0;
}

.warehouse-document-page > .panel,
.empty-state-panel {
  margin-top: 18px;
}

.warehouse-document-page h2,
.empty-state-panel h2 {
  margin: 0 0 14px;
  font-size: 18px;
}

.info-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.info-list div {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 12px;
}

.info-list dt {
  color: var(--muted);
  font-weight: 800;
}

.info-list dd {
  margin: 0;
  font-weight: 800;
}

.document-comment p,
.muted {
  color: var(--muted);
}

.document-timeline {
  display: grid;
  gap: 10px;
}

.document-timeline article {
  border-left: 3px solid var(--primary);
  padding: 8px 0 8px 12px;
}

.document-timeline strong,
.document-timeline span {
  display: block;
}

.document-timeline span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

@media (max-width: 980px) {
  .warehouse-journal-layout,
  .document-info-grid,
  .document-summary-grid {
    grid-template-columns: 1fr;
  }

  .journal-header-actions {
    justify-content: flex-start;
  }

  .journal-total {
    text-align: left;
  }
}

/* Workspace shell copied to PHP from the previous Ferpic ERP UI. */
.app-shell.no-sidebar {
  display: block;
  min-height: 100vh;
  background: #f5f7fb;
}

.main {
  min-width: 0;
}

.workspace-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  min-height: 80px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 27px;
  border-bottom: 1px solid #dbe3ef;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
}

.topbar-search {
  position: relative;
  width: min(585px, 42vw);
  margin: 0;
}

.topbar-search .ui-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  color: #667085;
  transform: translateY(-50%);
}

.topbar-search .search {
  width: 100%;
  min-height: 52px;
  border: 1px solid #cfd9ea;
  border-radius: 8px;
  padding: 0 14px 0 40px;
  background: #ffffff;
  color: #172033;
  font-size: 15px;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.workspace-topbar .btn,
.workspace-topbar .user-pill {
  min-height: 42px;
  border: 1px solid #cfd9ea;
  border-radius: 8px;
  background: #ffffff;
  color: #344054;
  box-shadow: none;
  font-size: 14px;
  font-weight: 700;
}

.workspace-topbar .btn {
  padding: 0 14px;
}

.workspace-topbar .btn.active,
.workspace-topbar .btn:hover,
.workspace-topbar .user-pill:hover {
  background: #f8fafc;
}

.icon-btn {
  width: 52px;
  padding: 0 !important;
}

.desktop-return-btn {
  gap: 8px;
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
}

.avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: #e5efff;
  color: #2563eb;
  font-size: 12px;
  font-weight: 900;
}

.logout-form {
  margin: 0;
}

.svg-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.desktop-workspace {
  min-height: calc(100vh - 80px);
  padding: 28px;
  background: #f5f7fb;
}

.desktop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 25px;
  padding: 24px 25px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.045);
}

.desktop-head h1 {
  margin: 0;
  color: #061329;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.15;
}

.desktop-head p {
  margin: 7px 0 0;
  color: #667085;
  font-size: 14px;
}

.desktop-app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(214px, 1fr));
  gap: 21px;
}

.desktop-app-card {
  position: relative;
  display: grid;
  min-height: 198px;
  align-content: center;
  justify-items: center;
  gap: 16px;
  overflow: hidden;
  padding: 22px;
  border: 1px solid #dce5f2;
  border-radius: 8px;
  background: #ffffff;
  color: #020b1f;
  text-align: center;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.045);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.desktop-app-card:hover {
  transform: translateY(-3px);
  border-color: #bfd0e7;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.1);
}

.desktop-app-icon,
.desktop-add-icon {
  display: grid;
  width: 77px;
  height: 77px;
  place-items: center;
  border-radius: 19px;
  background: #eef4ff;
  color: #2563eb;
}

.desktop-app-icon .svg-icon,
.desktop-add-icon .svg-icon {
  width: 34px;
  height: 34px;
}

.desktop-app-label {
  max-width: 100%;
  color: #020b1f;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.25;
}

.desktop-app-source {
  color: #020b1f;
  font-size: 11px;
  font-weight: 800;
}

.desktop-app-card.green,
.desktop-app-card.orange,
.desktop-app-card.teal,
.desktop-app-card.pink,
.desktop-app-card.blue {
  border-color: transparent;
}

.desktop-app-card.green { background: #22c55e; }
.desktop-app-card.orange { background: #f97316; }
.desktop-app-card.teal { background: #19b5a5; }
.desktop-app-card.pink { background: #e83e97; }
.desktop-app-card.blue { background: #3b82f6; color: #ffffff; }

.desktop-app-card.green .desktop-app-label,
.desktop-app-card.orange .desktop-app-label,
.desktop-app-card.teal .desktop-app-label,
.desktop-app-card.pink .desktop-app-label,
.desktop-app-card.blue .desktop-app-label,
.desktop-app-card.blue .desktop-app-source {
  color: #020b1f;
}

.desktop-app-card.green .desktop-app-icon,
.desktop-app-card.orange .desktop-app-icon,
.desktop-app-card.teal .desktop-app-icon,
.desktop-app-card.pink .desktop-app-icon,
.desktop-app-card.blue .desktop-app-icon {
  background: rgba(255, 255, 255, 0.86);
}

.desktop-app-card.green .desktop-app-icon { color: #059669; }
.desktop-app-card.orange .desktop-app-icon { color: #f97316; }
.desktop-app-card.teal .desktop-app-icon { color: #0d9488; }
.desktop-app-card.pink .desktop-app-icon { color: #db2777; }
.desktop-app-card.blue .desktop-app-icon { color: #2563eb; }

.desktop-app-card.white .desktop-app-icon {
  background: #f0e9ff;
  color: #6941c6;
}

.desktop-app-card.add-app {
  border: 1.5px dashed #b9c7dc;
  background: #fbfcff;
}

.desktop-add-icon {
  border-radius: 50%;
  background: #2563eb;
  color: #ffffff;
}

.desktop-add-hover {
  position: absolute;
  right: 12px;
  bottom: 12px;
  left: 12px;
  padding: 7px 9px;
  border-radius: 8px;
  background: #101828;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.desktop-app-card.add-app:hover .desktop-add-hover {
  opacity: 1;
  transform: translateY(0);
}

.apps-library-page {
  min-height: calc(100vh - 80px);
  padding: 28px;
  background: #f5f7fb;
}

.library-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 25px;
  padding: 27px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.045);
}

.library-page-head h1 {
  margin: 0;
  color: #061329;
  font-size: 28px;
  font-weight: 800;
}

.library-page-head p {
  margin: 8px 0 0;
  color: #667085;
  font-size: 16px;
}

.btn-dark {
  border-color: #101828 !important;
  background: #101828 !important;
  color: #ffffff !important;
}

.library-layout {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  gap: 24px;
}

.library-filter-panel,
.library-toolbar,
.library-app-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.045);
}

.library-filter-panel {
  align-self: start;
  padding: 20px;
}

.library-search {
  position: relative;
  margin-bottom: 22px;
}

.library-search .ui-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  color: #667085;
  transform: translateY(-50%);
}

.library-search input {
  width: 100%;
  min-height: 48px;
  border: 1px solid #d8e0ec;
  border-radius: 8px;
  padding: 0 12px 0 40px;
  background: #ffffff;
  color: #172033;
  font: inherit;
  font-size: 14px;
}

.library-filter-panel section + section {
  margin-top: 26px;
}

.library-filter-panel h3 {
  margin: 0 0 11px;
  color: #020b1f;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.library-filter-panel button {
  display: flex;
  width: 100%;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  background: transparent;
  color: #172033;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
}

.library-filter-panel button.active,
.library-filter-panel button:hover {
  background: #eff6ff;
  color: #2563eb;
}

.library-filter-panel span,
.library-toolbar > span {
  color: #667085;
  font-size: 12px;
  font-weight: 800;
}

.library-content {
  min-width: 0;
}

.library-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  padding: 13px;
}

.library-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.library-tabs button {
  min-height: 41px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  background: #f1f5f9;
  color: #172033;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
}

.library-tabs button.active {
  background: #2563eb;
  color: #ffffff;
}

.library-apps-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 16px;
}

.library-app-card {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) 208px;
  gap: 18px;
  align-items: center;
  min-height: 183px;
  padding: 20px;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.library-app-card:hover {
  transform: translateY(-2px);
  border-color: #bfdbfe;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

.library-app-card.inactive {
  background: #f8fafc;
  opacity: .72;
}

.library-app-card.inactive:hover {
  transform: none;
  border-color: #dbe3ef;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.library-app-icon {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border-radius: 15px;
  color: #ffffff;
}

.library-app-icon .svg-icon {
  width: 30px;
  height: 30px;
}

.library-app-icon.blue { background: #2563eb; }
.library-app-icon.green { background: #16a34a; }
.library-app-icon.orange { background: #f97316; }
.library-app-icon.teal { background: #0d9488; }
.library-app-icon.slate { background: #475569; }
.library-app-icon.violet { background: #7c3aed; }
.library-app-icon.sky { background: #0284c7; }
.library-app-icon.pink { background: #db2777; }
.library-app-icon.yellow { background: #d97706; }
.library-app-icon.emerald { background: #059669; }
.library-app-icon.indigo { background: #4f46e5; }
.library-app-icon.gray,
.library-app-icon.white { background: #64748b; }

.library-app-info h3 {
  margin: 0;
  color: #020b1f;
  font-size: 18px;
  font-weight: 900;
}

.library-app-info > div:first-child > span {
  display: inline-flex;
  margin-top: 6px;
  color: #536173;
  font-size: 13px;
  font-weight: 700;
}

.library-app-info p {
  margin: 9px 0 0;
  color: #536173;
  font-size: 14px;
  line-height: 1.45;
}

.library-app-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.library-source-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.library-source-badge.core {
  background: #eff6ff;
  color: #1d4ed8;
}

.library-source-badge.custom {
  background: #f5f3ff;
  color: #6d28d9;
}

.library-source-badge.inactive {
  background: #e5e7eb;
  color: #475569;
}

.library-app-actions {
  display: grid;
  gap: 10px;
}

.install-btn,
.details-btn {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 900;
}

.install-btn.installed {
  border: 1px solid #bbf7d0;
  background: #ecfdf3;
  color: #027a48;
}

.install-btn.inactive,
.details-btn.disabled {
  border: 1px solid #d1d5db;
  background: #f1f5f9;
  color: #64748b;
}

.details-btn.disabled {
  cursor: default;
}

.details-btn {
  border: 1px solid #d8e0ec;
  background: #ffffff;
  color: #172033;
}

.settings-link {
  white-space: nowrap;
}

@media (max-width: 1200px) {
  .library-apps-list {
    grid-template-columns: 1fr;
  }

  .desktop-app-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}

@media (max-width: 860px) {
  .workspace-topbar,
  .library-page-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-search {
    width: 100%;
  }

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

  .library-app-card {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .library-app-actions {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .desktop-workspace,
  .apps-library-page {
    padding: 16px;
  }

  .desktop-app-grid,
  .library-app-actions {
    grid-template-columns: 1fr;
  }

  .desktop-return-btn span,
  .user-pill span:not(.avatar) {
    display: none;
  }
}

.settings-page {
  min-height: calc(100vh - 81px);
  padding: 28px;
  background: #f5f7fb;
}

.settings-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
  padding: 26px;
}

.settings-kicker {
  display: inline-flex;
  margin-bottom: 8px;
  color: #2563eb;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.settings-hero h1 {
  margin: 0;
  color: #020b1f;
  font-size: 30px;
  font-weight: 900;
}

.settings-hero p,
.settings-panel-head p {
  margin: 8px 0 0;
  color: #667085;
  font-size: 15px;
  line-height: 1.5;
}

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

.settings-alert {
  margin-bottom: 16px;
  border: 1px solid #d8e0ec;
  border-radius: 8px;
  padding: 13px 16px;
  font-size: 14px;
  font-weight: 800;
}

.settings-alert.success {
  border-color: #bbf7d0;
  background: #ecfdf3;
  color: #027a48;
}

.settings-alert.error {
  border-color: #fecaca;
  background: #fff1f2;
  color: #b42318;
}

.settings-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.settings-summary-card {
  min-height: 104px;
  padding: 18px;
}

.settings-summary-card span {
  display: block;
  color: #667085;
  font-size: 13px;
  font-weight: 800;
}

.settings-summary-card strong {
  display: block;
  margin-top: 12px;
  overflow: hidden;
  color: #020b1f;
  font-size: 22px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-layout {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  gap: 24px;
}

.settings-tabs {
  align-self: start;
  padding: 14px;
}

.settings-tabs a {
  display: block;
  border-radius: 8px;
  padding: 13px 14px;
  color: #172033;
  text-decoration: none;
}

.settings-tabs a + a {
  margin-top: 4px;
}

.settings-tabs a.active,
.settings-tabs a:hover {
  background: #eff6ff;
  color: #2563eb;
}

.settings-tabs span {
  display: block;
  font-size: 14px;
  font-weight: 900;
}

.settings-tabs small {
  display: block;
  margin-top: 5px;
  color: #667085;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.settings-panel {
  min-width: 0;
  padding: 24px;
}

.settings-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.settings-panel-head h2 {
  margin: 0;
  color: #020b1f;
  font-size: 24px;
  font-weight: 900;
}

.settings-status {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  border-radius: 999px;
  padding: 0 12px;
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.settings-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.settings-field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

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

.settings-field > span {
  color: #172033;
  font-size: 13px;
  font-weight: 900;
}

.settings-field input,
.settings-field select,
.settings-field textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid #d8e0ec;
  border-radius: 8px;
  padding: 0 13px;
  background: #ffffff;
  color: #020b1f;
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.settings-field textarea {
  min-height: 112px;
  padding-top: 12px;
  resize: vertical;
}

.settings-field input[type="color"] {
  padding: 5px;
}

.settings-field input:focus,
.settings-field select:focus,
.settings-field textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.settings-field input[readonly] {
  background: #f8fafc;
  color: #667085;
}

.settings-field.checkbox {
  display: flex;
  min-height: 72px;
  align-items: center;
  gap: 12px;
  border: 1px solid #d8e0ec;
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
}

.settings-field.checkbox input {
  width: 18px;
  min-height: 18px;
  accent-color: #2563eb;
}

.settings-field.checkbox strong {
  color: #172033;
  font-size: 14px;
  font-weight: 900;
}

.settings-field small {
  color: #667085;
  font-size: 12px;
  font-weight: 700;
}

.settings-field em {
  color: #b42318;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.settings-field.invalid input,
.settings-field.invalid select,
.settings-field.invalid textarea {
  border-color: #fda29b;
}

.settings-placeholder {
  display: grid;
  min-height: 320px;
  place-items: center;
  border: 1px dashed #bfdbfe;
  border-radius: 8px;
  padding: 32px;
  text-align: center;
}

.settings-placeholder span {
  display: grid;
  width: 74px;
  height: 74px;
  place-items: center;
  border-radius: 18px;
  background: #eff6ff;
  color: #2563eb;
}

.settings-placeholder .svg-icon {
  width: 34px;
  height: 34px;
}

.settings-placeholder h3 {
  margin: 16px 0 0;
  color: #020b1f;
  font-size: 20px;
  font-weight: 900;
}

.settings-placeholder p {
  max-width: 520px;
  margin: 9px auto 0;
  color: #667085;
  line-height: 1.5;
}

@media (max-width: 1100px) {
  .settings-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

  .settings-tabs a + a {
    margin-top: 0;
  }
}

@media (max-width: 720px) {
  .settings-page {
    padding: 16px;
  }

  .settings-hero,
  .settings-panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .settings-hero-actions {
    justify-content: flex-start;
  }

  .settings-summary-grid,
  .settings-form-grid,
  .settings-tabs {
    grid-template-columns: 1fr;
  }
}

.erp-page {
  min-height: calc(100vh - 81px);
  padding: 28px;
  background: #f5f7fb;
}

.page-header,
.product-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 24px 26px;
  background: #ffffff;
}

.page-title {
  margin: 0;
  color: #111827;
  font-size: 30px;
  font-weight: 900;
}

.page-description {
  margin: 8px 0 0;
  color: #6b7280;
  font-size: 15px;
}

.page-actions,
.form-actions,
.placeholder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.summary-card,
.table-card,
.form-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.summary-card {
  min-height: 104px;
  padding: 18px;
}

.summary-card span {
  display: block;
  color: #6b7280;
  font-size: 13px;
  font-weight: 800;
}

.summary-card strong {
  display: block;
  margin-top: 12px;
  overflow: hidden;
  color: #111827;
  font-size: 22px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-panel {
  display: grid;
  grid-template-columns: 1.5fr repeat(4, minmax(150px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  background: #ffffff;
}

.filter-panel label,
.form-grid label,
.stock-edit-grid label,
.warehouse-form label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.filter-panel span,
.form-grid span,
.stock-edit-grid span,
.warehouse-form span {
  color: #111827;
  font-size: 13px;
  font-weight: 900;
}

.filter-panel input,
.filter-panel select,
.form-grid input,
.form-grid select,
.form-grid textarea,
.stock-edit-grid input,
.stock-table input,
.warehouse-form input,
.warehouse-form select,
.warehouse-form textarea,
.category-row-form input,
.category-row-form select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #d8e0ec;
  border-radius: 8px;
  padding: 0 12px;
  background: #ffffff;
  color: #111827;
  font: inherit;
  font-size: 14px;
  outline: none;
}

.form-grid textarea,
.warehouse-form textarea {
  min-height: 96px;
  padding-top: 11px;
  resize: vertical;
}

.table-card {
  overflow: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid #eef2f7;
  padding: 12px 14px;
  color: #172033;
  font-size: 14px;
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  background: #f8fafc;
  color: #536173;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.data-table tbody tr:nth-child(even) {
  background: #fbfdff;
}

.data-table tbody tr:hover {
  background: #eff6ff;
}

.table-main-link {
  color: #111827;
  font-weight: 900;
  text-decoration: none;
}

.table-main-link:hover {
  color: #2563eb;
}

.product-thumb,
.product-hero-image {
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: #eff6ff;
  color: #2563eb;
}

.product-thumb {
  width: 44px;
  height: 44px;
}

.product-thumb img,
.product-hero-image img,
.image-preview-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.status-badge {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.status-badge.active {
  background: #dcfce7;
  color: #166534;
}

.status-badge.draft {
  background: #fef3c7;
  color: #92400e;
}

.status-badge.archived {
  background: #f1f5f9;
  color: #475569;
}

.status-badge.out_of_stock {
  background: #fee2e2;
  color: #991b1b;
}

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

.row-actions a,
.row-actions button {
  border: 0;
  background: transparent;
  color: #2563eb;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.empty-state {
  padding: 24px;
  color: #6b7280;
  font-weight: 800;
  text-align: center;
}

.product-form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 22px;
  align-items: start;
}

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

.form-card {
  padding: 20px;
}

.form-card h2 {
  margin: 0 0 16px;
  color: #111827;
  font-size: 19px;
  font-weight: 900;
}

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

.form-grid .wide {
  grid-column: 1 / -1;
}

.form-grid em,
.warehouse-form em {
  color: #dc2626;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.check-line {
  display: flex !important;
  align-items: center;
  gap: 9px;
  color: #172033;
  font-size: 14px;
  font-weight: 800;
}

.check-line input {
  width: 18px;
  min-height: 18px;
  accent-color: #2563eb;
}

.product-form-sidebar {
  position: sticky;
  top: 96px;
}

.product-form-sidebar .form-card {
  display: grid;
  gap: 12px;
}

.stock-edit-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.product-card-header {
  justify-content: flex-start;
}

.product-card-header .page-actions {
  margin-left: auto;
}

.product-hero-image {
  flex: 0 0 104px;
  width: 104px;
  height: 104px;
}

.product-hero-image.small {
  flex: 0 0 84px;
  width: 84px;
  height: 84px;
}

.product-hero-image .svg-icon {
  width: 44px;
  height: 44px;
}

.product-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.details-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.details-list div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid #eef2f7;
  padding-bottom: 9px;
}

.details-list dt {
  color: #6b7280;
  font-weight: 800;
}

.details-list dd {
  margin: 0;
  color: #111827;
  font-weight: 900;
  text-align: right;
}

.detail-text {
  margin: 16px 0 0;
  color: #536173;
  line-height: 1.55;
}

.image-uploader {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 10px;
}

.image-preview-grid img {
  aspect-ratio: 1;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.product-photo-field {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.product-photo-field small {
  color: #6b7280;
  font-size: 12px;
  font-weight: 700;
}

.product-image-item {
  display: grid;
  gap: 8px;
  margin: 0;
}

.product-image-item button {
  width: 100%;
  min-height: 32px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff1f2;
  color: #b42318;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
}

.upload-preview {
  width: 74px;
  height: 74px;
  border-radius: 8px;
  object-fit: cover;
}

.stock-table input {
  min-width: 120px;
}

.category-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}

.category-tree ul {
  margin: 0;
  padding-left: 18px;
}

.category-tree li {
  margin: 8px 0;
  color: #111827;
}

.category-tree span {
  margin-left: 8px;
  color: #6b7280;
  font-size: 12px;
  font-weight: 800;
}

.category-row-form {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 110px 120px 110px;
  gap: 10px;
  align-items: center;
}

.warehouse-form {
  max-width: 980px;
}

.warehouse-form .form-actions {
  margin-top: 18px;
}

.warehouse-card {
  align-items: flex-start;
}

.placeholder-actions {
  margin-bottom: 18px;
}

.warehouse-actions-bar {
  position: sticky;
  top: 81px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  border: 1px solid #d8e0ec;
  border-radius: 8px;
  padding: 14px 16px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.warehouse-actions-bar > span {
  color: #536173;
  font-size: 14px;
  font-weight: 800;
}

.stock-checkbox {
  width: 18px;
  height: 18px;
  accent-color: #2563eb;
}

.operation-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.42);
}

.operation-modal[hidden] {
  display: none;
}

.operation-modal-large {
  display: grid;
  width: min(1100px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
}

.operation-modal-large header,
.operation-modal-large footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border-bottom: 1px solid #eef2f7;
}

.operation-modal-large footer {
  border-top: 1px solid #eef2f7;
  border-bottom: 0;
  justify-content: flex-end;
}

.operation-modal-large h2 {
  margin: 0;
  color: #111827;
  font-size: 22px;
  font-weight: 900;
}

.operation-modal-large p {
  margin: 6px 0 0;
  color: #6b7280;
}

.operation-modal-large header button {
  border: 0;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
}

.operation-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 20px;
}

.operation-form-grid .wide {
  grid-column: 1 / -1;
}

.operation-form-grid label {
  display: grid;
  gap: 8px;
}

.operation-form-grid span {
  color: #111827;
  font-size: 13px;
  font-weight: 900;
}

.operation-form-grid input,
.operation-form-grid select,
.operation-form-grid textarea,
.operation-items-table input {
  width: 100%;
  min-height: 42px;
  border: 1px solid #d8e0ec;
  border-radius: 8px;
  padding: 0 12px;
  font: inherit;
}

.operation-form-grid textarea {
  min-height: 86px;
  padding-top: 10px;
  resize: vertical;
}

.operation-items-table {
  margin: 0 20px 20px;
  width: calc(100% - 40px);
}

.qty-input {
  max-width: 160px;
}

.document-badge {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 900;
}

.difference-positive { color: #16a34a; }
.difference-negative { color: #dc2626; }

.runtime-app-page,
.runtime-process-page {
  padding: 28px;
  display: grid;
  gap: 22px;
}

.runtime-process-page {
  padding-bottom: 300px;
}

.runtime-page-head,
.runtime-process-actions,
.runtime-stage-actions,
.runtime-list-panel,
.runtime-block {
  border: 1px solid #d8e0ec;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.04);
}

.runtime-page-head {
  min-height: 108px;
  padding: 26px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.runtime-kicker {
  display: block;
  margin-bottom: 8px;
  color: #2563eb;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.runtime-page-head h1 {
  margin: 0;
  color: #020617;
  font-size: 28px;
  line-height: 1.2;
}

.runtime-page-head p,
.runtime-process-actions p {
  margin: 8px 0 0;
  color: #64748b;
}

.runtime-head-actions,
.runtime-transition-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.runtime-summary-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.runtime-summary-row article {
  min-height: 86px;
  padding: 18px;
  border: 1px solid #d8e0ec;
  border-radius: 8px;
  background: #fff;
}

.runtime-summary-row strong {
  display: block;
  color: #020617;
  font-size: 22px;
}

.runtime-summary-row span {
  display: block;
  margin-top: 6px;
  color: #64748b;
  font-size: 13px;
}

.runtime-list-panel {
  overflow: hidden;
}

.runtime-list-toolbar {
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #e5edf7;
}

.runtime-search {
  flex: 1;
  min-width: 260px;
  position: relative;
}

.runtime-search span {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
}

.runtime-search input,
.runtime-list-toolbar select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #d8e0ec;
  border-radius: 8px;
  padding: 0 12px;
  font: inherit;
}

.runtime-search input {
  padding-left: 42px;
}

.runtime-view-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 8px;
  background: #eef3fb;
}

.runtime-view-switch button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #475569;
}

.runtime-view-switch .active {
  background: #fff;
  color: #2563eb;
}

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

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

.runtime-table th,
.runtime-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #e5edf7;
  text-align: left;
  vertical-align: middle;
}

.runtime-table th {
  color: #475569;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  background: #f8fafc;
}

.runtime-table td {
  color: #0f172a;
}

.runtime-table td span {
  display: block;
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
}

.runtime-table a {
  color: #2563eb;
  font-weight: 900;
  text-decoration: none;
}

.onebox-processes-table-panel {
  min-width: 0;
  overflow: hidden;
}

.onebox-processes-table-panel .runtime-table-wrap {
  width: 100%;
  overflow-x: visible;
}

.onebox-process-table {
  width: 100%;
  table-layout: fixed;
}

.onebox-process-table th,
.onebox-process-table td {
  padding: 12px 10px;
  overflow-wrap: anywhere;
  vertical-align: middle;
}

.onebox-process-table th:nth-child(1),
.onebox-process-table td:nth-child(1) {
  width: 72px;
}

.onebox-process-table th:nth-child(2),
.onebox-process-table td:nth-child(2) {
  width: 18%;
}

.onebox-process-table th:nth-child(3),
.onebox-process-table td:nth-child(3),
.onebox-process-table th:nth-child(4),
.onebox-process-table td:nth-child(4) {
  width: 13%;
}

.onebox-process-table th:nth-child(5),
.onebox-process-table td:nth-child(5),
.onebox-process-table th:nth-child(6),
.onebox-process-table td:nth-child(6),
.onebox-process-table th:nth-child(7),
.onebox-process-table td:nth-child(7) {
  width: 10%;
}

.onebox-process-table th:nth-child(8),
.onebox-process-table td:nth-child(8) {
  width: 76px;
}

.onebox-process-table th:nth-child(9),
.onebox-process-table td:nth-child(9) {
  width: 70px;
  text-align: center;
}

.onebox-process-table th:nth-child(10),
.onebox-process-table td:nth-child(10) {
  width: 104px;
}

.onebox-process-table .btn {
  min-height: 34px;
  padding: 0 12px;
  white-space: nowrap;
}

.stage-pill {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border-radius: 999px;
  padding: 0 11px;
  color: var(--stage-color, #2563eb);
  background: color-mix(in srgb, var(--stage-color, #2563eb) 12%, white);
  font-size: 12px;
  font-weight: 900;
}

.stage-pill.large {
  min-height: 38px;
  padding: 0 16px;
  font-size: 14px;
}

.runtime-process-actions,
.runtime-stage-actions,
.runtime-stage-history-panel {
  padding: 18px;
}

.runtime-process-actions,
.runtime-stage-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.runtime-process-actions h2,
.runtime-stage-actions h2,
.runtime-stage-history-panel h2 {
  margin: 0;
  color: #020617;
  font-size: 18px;
}

.runtime-stage-history-panel {
  border: 1px solid #d8e0ec;
  border-radius: 8px;
  background: #fff;
}

.runtime-stage-history-panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.runtime-stage-history-panel > header span {
  min-width: 28px;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #eef3fb;
  color: #2563eb;
  font-size: 12px;
  font-weight: 900;
}

.runtime-transition-row .primary {
  background: var(--btn-color, #2563eb);
}

.runtime-transition-button {
  border-color: var(--btn-color, #2563eb);
  color: #fff;
}

.runtime-muted {
  color: #64748b;
  font-weight: 700;
}

.runtime-action-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.runtime-action-list article {
  min-width: 220px;
  padding: 12px;
  border: 1px solid #d8e0ec;
  border-radius: 8px;
  background: #f8fafc;
}

.runtime-action-list strong,
.runtime-action-list span {
  display: block;
}

.runtime-action-list span {
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
}

.runtime-block-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}

.runtime-col-12 { grid-column: span 12; }
.runtime-col-6 { grid-column: span 6; }
.runtime-col-4 { grid-column: span 4; }
.runtime-col-3 { grid-column: span 3; }

.runtime-block {
  min-height: 150px;
  padding: 18px;
}

.runtime-block > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.runtime-block h3 {
  margin: 0;
  color: #020617;
  font-size: 17px;
}

.runtime-block header span {
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.runtime-header-block strong {
  display: block;
  margin-bottom: 10px;
  color: #020617;
  font-size: 22px;
}

.runtime-header-block p,
.runtime-placeholder p {
  margin: 10px 0 0;
  color: #64748b;
}

.runtime-field-list {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.runtime-field-list div {
  padding: 12px;
  border: 1px solid #e5edf7;
  border-radius: 8px;
  background: #f8fafc;
}

.runtime-field-list dt {
  margin: 0 0 6px;
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.runtime-field-list dd {
  margin: 0;
  color: #020617;
  font-weight: 800;
}

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

.runtime-field-control {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #e5edf7;
  border-radius: 8px;
  background: #f8fafc;
}

.runtime-field-control span {
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.runtime-field-control input,
.runtime-field-control textarea,
.runtime-field-control select {
  width: 100%;
  min-height: 40px;
  border: 1px solid #d8e0ec;
  border-radius: 8px;
  background: #fff;
  padding: 0 11px;
  color: #020617;
  font: inherit;
  font-weight: 700;
}

.runtime-field-control textarea {
  padding-top: 10px;
  resize: vertical;
}

.runtime-field-control input[type="checkbox"] {
  width: 20px;
  min-height: 20px;
  justify-self: start;
}

.runtime-field-control strong {
  color: #020617;
  font-weight: 800;
}

.runtime-field-control em {
  min-height: 16px;
  color: #64748b;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.runtime-field-control em[data-state="saved"] {
  color: #059669;
}

.runtime-field-control em[data-state="error"] {
  color: #dc2626;
}

.runtime-field-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  grid-column: 1 / -1;
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid #e5edf7;
}

.runtime-field-actions [data-runtime-save-all-state] {
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

.runtime-field-actions [data-state="saved"] {
  color: #059669;
}

.runtime-field-actions [data-state="error"] {
  color: #dc2626;
}

.runtime-stage-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stage-step {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #d8e0ec;
  border-radius: 8px;
  padding: 0 12px;
  color: #475569;
  background: #fff;
  font-weight: 800;
}

.stage-step.active {
  border-color: var(--stage-color, #2563eb);
  color: var(--stage-color, #2563eb);
  background: color-mix(in srgb, var(--stage-color, #2563eb) 10%, white);
}

.runtime-history-line {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.runtime-history-step {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
}

.runtime-history-step span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 4px;
  background: #2563eb;
  color: #fff;
  padding: 2px 7px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
}

.runtime-history-step:nth-child(4n + 1) span {
  background: #fce7f3;
  color: #9d174d;
}

.runtime-history-step:nth-child(4n + 3) span {
  background: #15803d;
  color: #fff;
}

.runtime-history-step:nth-child(4n + 5) span {
  background: #6d28d9;
  color: #fff;
}

.runtime-history-step:nth-child(4n + 7) span {
  background: #0f766e;
  color: #fff;
}

.runtime-history-step.empty span {
  background: #f1f5f9;
  color: #64748b;
}

.runtime-history-arrow {
  display: inline-flex;
  align-items: center;
  color: #475569;
  font-size: 15px;
  font-weight: 900;
}

.runtime-placeholder {
  min-height: 94px;
  padding: 18px;
  border: 1px dashed #bfd0e7;
  border-radius: 8px;
  background: #f8fafc;
}

.runtime-placeholder strong {
  color: #0f172a;
}

.runtime-products-form {
  position: relative;
}

.runtime-product-search {
  position: relative;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 140px;
  gap: 12px;
  align-items: end;
  padding-bottom: 8px;
}

.runtime-product-search label {
  display: grid;
  gap: 7px;
}

.runtime-product-search label span {
  color: #475569;
  font-size: 12px;
  font-weight: 900;
}

.runtime-products-table tfoot td {
  position: relative;
  background: #f8fafc;
  vertical-align: middle;
}

.runtime-products-table tfoot tr {
  border-top: 2px solid #dbeafe;
}

.runtime-product-search input,
.runtime-product-add-row input {
  width: 100%;
  min-height: 38px;
  border: 1px solid #d8e0ec;
  border-radius: 8px;
  background: #fff;
  padding: 0 11px;
  font: inherit;
}

.runtime-product-search input:focus,
.runtime-product-add-row input:focus {
  border-color: #2563eb;
  outline: 3px solid rgba(37, 99, 235, .12);
}

.runtime-product-search-query {
  min-width: 0;
}

.runtime-product-name-cell {
  min-width: 280px;
}

.runtime-product-muted {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 800;
}

.runtime-products-table td strong,
.runtime-products-table td span {
  display: block;
}

.runtime-products-table td span {
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
}

.runtime-product-suggestions {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 20;
  display: none;
  width: min(620px, 100%);
  max-height: 310px;
  overflow: auto;
  border: 1px solid #d8e0ec;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(15, 23, 42, .16);
  padding: 6px;
}

.runtime-product-suggestions.open {
  display: grid;
  gap: 4px;
}

.runtime-product-suggestion {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 14px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  padding: 10px;
  text-align: left;
  cursor: pointer;
}

.runtime-product-suggestion:hover {
  background: #eff6ff;
}

.runtime-product-suggestion strong {
  color: #0f172a;
}

.runtime-product-suggestion span {
  color: #64748b;
  font-size: 12px;
}

.runtime-product-suggestion em {
  grid-row: 1 / span 2;
  grid-column: 2;
  align-self: center;
  color: #2563eb;
  font-style: normal;
  font-weight: 900;
}

.runtime-product-empty {
  padding: 10px;
  color: #64748b;
  font-weight: 800;
}

.runtime-product-empty.error {
  color: #dc2626;
}

.runtime-comments {
  display: grid;
  gap: 14px;
}

.runtime-comments-feed {
  display: grid;
  gap: 12px;
  max-height: 420px;
  overflow: auto;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #f8fafc;
  padding: 14px;
}

.runtime-comments-empty {
  border: 1px dashed #bfdbfe;
  border-radius: 8px;
  background: #fff;
  padding: 18px;
}

.runtime-comments-empty strong,
.runtime-comments-empty span {
  display: block;
}

.runtime-comments-empty span {
  margin-top: 8px;
  color: #64748b;
}

.runtime-comment {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.runtime-comment-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 900;
}

.runtime-comment-body {
  min-width: 0;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
}

.runtime-comment-body header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  color: #64748b;
  font-size: 12px;
}

.runtime-comment-body header strong {
  color: #0f172a;
  font-size: 13px;
}

.runtime-comment-body p {
  margin: 8px 0 0;
  color: #172033;
  line-height: 1.45;
}

.runtime-comment-files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.runtime-comment-file {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 220px;
  max-width: 340px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #f8fafc;
  padding: 8px;
  color: #172033;
  text-decoration: none;
}

.runtime-comment-file strong {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 7px;
  background: #e0f2fe;
  color: #0284c7;
  font-size: 11px;
}

.runtime-comment-file span,
.runtime-comment-file small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.runtime-comment-file small {
  color: #64748b;
}

.runtime-comment-file.image {
  grid-template-columns: 74px minmax(0, 1fr);
}

.runtime-comment-file.image img {
  width: 74px;
  height: 58px;
  border-radius: 7px;
  object-fit: cover;
}

.runtime-comment-form {
  display: grid;
  gap: 10px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.runtime-comment-form textarea {
  width: 100%;
  min-height: 84px;
  border: 1px solid #cfd9ea;
  border-radius: 8px;
  padding: 10px 12px;
  resize: vertical;
}

.runtime-comment-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.runtime-comment-file-btn {
  position: relative;
  overflow: hidden;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  padding: 10px 12px;
  color: #1d4ed8;
  font-weight: 900;
  cursor: pointer;
}

.runtime-comment-file-btn input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.runtime-comment-tools [data-runtime-comment-file-list],
.runtime-comment-state {
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

.runtime-files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.runtime-file-card {
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.runtime-file-card .runtime-comment-file {
  width: 100%;
  min-width: 0;
  max-width: none;
}

.runtime-file-card dl {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 4px 8px;
  margin: 10px 0 0;
  color: #64748b;
  font-size: 12px;
}

.runtime-file-card dt,
.runtime-file-card dd {
  margin: 0;
}

.runtime-file-card dt {
  font-weight: 900;
}

@media (max-width: 1180px) {
  .filter-panel,
  .summary-grid,
  .stock-edit-grid,
  .runtime-summary-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-form-layout,
  .detail-grid,
  .category-layout {
    grid-template-columns: 1fr;
  }

  .product-form-sidebar {
    position: static;
  }
}

@media (max-width: 720px) {
  .erp-page {
    padding: 16px;
  }

  .page-header,
  .product-card-header {
    align-items: stretch;
    flex-direction: column;
  }

  .product-card-header .page-actions {
    margin-left: 0;
  }

  .filter-panel,
  .summary-grid,
  .form-grid,
  .stock-edit-grid,
  .category-row-form,
  .runtime-summary-row,
  .runtime-field-form,
  .runtime-field-list {
    grid-template-columns: 1fr;
  }

  .runtime-app-page,
  .runtime-process-page {
    padding: 16px;
  }

  .runtime-process-page {
    padding-bottom: 260px;
  }

  .runtime-page-head,
  .runtime-process-actions,
  .runtime-stage-actions,
  .runtime-list-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .runtime-head-actions,
  .runtime-transition-row {
    justify-content: flex-start;
  }

  .runtime-block-grid {
    grid-template-columns: 1fr;
  }

  .runtime-product-search {
    grid-template-columns: 1fr;
  }

  .runtime-col-12,
  .runtime-col-6,
  .runtime-col-4,
  .runtime-col-3 {
    grid-column: span 1;
  }
}

.custom-field-extra {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #f8fbff;
}

.custom-field-extra[hidden] {
  display: none;
}

.custom-field-extra small {
  display: block;
  margin-top: 6px;
  color: #64748b;
  font-size: 12px;
}

.custom-field-extra select[multiple] {
  min-height: 110px;
}

.runtime-dictionary-field {
  position: relative;
}

.runtime-dictionary-suggestions {
  position: absolute;
  z-index: 40;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 240px;
  overflow: auto;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.16);
}

.runtime-dictionary-suggestions[hidden] {
  display: none;
}

.runtime-dictionary-suggestions button {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid #eef2f7;
  background: #fff;
  color: #0f172a;
  text-align: left;
  cursor: pointer;
}

.runtime-dictionary-suggestions button:hover {
  background: #eff6ff;
}

.runtime-product-add-inline {
  display: grid;
  grid-template-columns: minmax(90px, 140px) minmax(260px, 1fr) minmax(110px, 150px) minmax(110px, 150px);
  gap: 10px;
  align-items: start;
}

.runtime-products-table [data-runtime-product-field] {
  width: 100%;
  min-width: 96px;
}

.runtime-products-table .runtime-product-cell-field {
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  padding: 0 8px;
  color: #0f172a;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.runtime-products-table .runtime-product-cell-field:hover {
  border-color: #dbe3ef;
  background: #f8fafc;
}

.runtime-products-table .runtime-product-cell-field.is-editing,
.runtime-products-table .runtime-product-cell-field:focus {
  border-color: #93c5fd;
  background: #fff;
  outline: 3px solid rgba(37, 99, 235, .12);
  cursor: text;
}

.runtime-products-table .runtime-product-check {
  width: 18px;
  min-width: 18px;
  height: 18px;
  accent-color: #2563eb;
  cursor: pointer;
}

.runtime-products-table textarea[data-runtime-product-field] {
  min-width: 180px;
  resize: vertical;
}

.runtime-products-table [data-runtime-product-field]:disabled,
.runtime-product-locked {
  color: #64748b;
  background: #f1f5f9;
}

.runtime-product-locked {
  padding: 12px 14px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  font-weight: 700;
}

.required-fields-picker {
  grid-column: 1 / -1;
}

.required-fields-picker > input[type="search"] {
  margin-top: 8px;
}

.required-fields-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 10px 18px;
  max-height: 420px;
  margin-top: 10px;
  padding: 12px;
  overflow: auto;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #f8fafc;
}

.required-field-option {
  display: flex !important;
  min-height: 42px;
  padding: 6px 8px;
  gap: 8px;
  align-items: flex-start;
  border-radius: 6px;
  cursor: pointer;
}

.required-field-option:hover,
.required-field-option:has(input:checked) {
  background: #fff7d6;
}

.required-field-option input {
  width: auto !important;
  margin-top: 3px;
}

.required-field-option span {
  display: grid;
  gap: 2px;
}

.required-field-option strong {
  font-size: 13px;
  line-height: 1.25;
}

.required-field-option em {
  color: #475569;
  font-size: 12px;
  font-style: normal;
}

@media (max-width: 900px) {
  .runtime-product-add-inline {
    grid-template-columns: 1fr;
  }

  .required-fields-grid {
    grid-template-columns: 1fr;
  }
}
