:root {
  --ink: #111827;
  --muted: #6b7280;
  --line: #dde3ec;
  --panel: #ffffff;
  --soft: #eef2f7;
  --brand: #0769ff;
  --brand-strong: #0453d8;
  --accent: #08c8e8;
  --danger: #b91c1c;
  --warn: #f59e0b;
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Noetix dashboard visual spec - aligned to the supplied mockup. */
body[data-current-view="dashboard"] { background: #fff; }
body[data-current-view="dashboard"] .topbar { display: none; }
body[data-current-view="dashboard"] main { padding: 16px 24px 0; background: #fff; }
body[data-current-view="dashboard"] #dashboardView > :not(.noetix-dashboard) { display: none !important; }

body[data-current-view="dashboard"] .sidebar,
body.sidebar-auto[data-current-view="dashboard"] .sidebar,
body.sidebar-collapsed[data-current-view="dashboard"] .sidebar,
body.sidebar-expanded[data-current-view="dashboard"] .sidebar {
  width: 214px !important;
  min-width: 214px !important;
  padding: 34px 10px 18px !important;
  gap: 28px;
  background: linear-gradient(180deg, #004ee8 0%, #007af4 45%, #00d6e7 100%);
  box-shadow: 18px 0 45px rgba(0, 80, 210, 0.16);
}

body[data-current-view="dashboard"] .brand {
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 0 14px;
}

body[data-current-view="dashboard"] .brand::before {
  content: "N";
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, #22d3ee 0%, #0b78ff 48%, #0046d8 100%);
  color: #ffffff;
  font-size: 40px;
  font-weight: 950;
  line-height: 1;
  text-shadow: 0 10px 22px rgba(0, 46, 135, 0.35);
}

body[data-current-view="dashboard"] .brand-logo,
body.sidebar-auto[data-current-view="dashboard"] .sidebar .brand-logo,
body.sidebar-collapsed[data-current-view="dashboard"] .sidebar .brand-logo,
body.sidebar-auto[data-current-view="dashboard"] .sidebar:not(:hover):not(:focus-within) .brand-logo {
  display: none;
  width: 54px;
  height: 54px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body[data-current-view="dashboard"] .brand-copy,
body.sidebar-auto[data-current-view="dashboard"] .sidebar:not(:hover):not(:focus-within) .brand-copy,
body.sidebar-collapsed[data-current-view="dashboard"] .sidebar .brand-copy {
  display: block;
}

body[data-current-view="dashboard"] .brand-copy strong {
  color: #fff;
  font-size: 24px;
  line-height: 1;
  letter-spacing: 0;
}

body[data-current-view="dashboard"] .brand-copy strong span { display: none; }
body[data-current-view="dashboard"] .brand-copy small {
  color: rgba(255,255,255,0.92);
  font-size: 12px;
  font-weight: 760;
}
body[data-current-view="dashboard"] .brand-copy small #brandVersion { display: none; }

body[data-current-view="dashboard"] nav { gap: 10px; padding: 0; }
body[data-current-view="dashboard"] .nav-item,
body.sidebar-auto[data-current-view="dashboard"] .sidebar:not(:hover):not(:focus-within) .nav-item,
body.sidebar-collapsed[data-current-view="dashboard"] .sidebar .nav-item {
  height: 50px;
  padding: 0 20px;
  justify-content: space-between;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #fff;
  font-size: 14px;
  font-weight: 720;
}
body[data-current-view="dashboard"] .nav-item.active {
  background: rgba(255,255,255,0.94);
  color: #0065f4;
  box-shadow: 0 16px 28px rgba(0, 69, 180, 0.24);
}
body[data-current-view="dashboard"] .nav-label,
body.sidebar-auto[data-current-view="dashboard"] .sidebar:not(:hover):not(:focus-within) .nav-label,
body.sidebar-collapsed[data-current-view="dashboard"] .sidebar .nav-label {
  justify-content: flex-start;
  gap: 16px;
}
body[data-current-view="dashboard"] .nav-label i,
body.sidebar-auto[data-current-view="dashboard"] .sidebar:not(:hover):not(:focus-within) .nav-label i,
body.sidebar-collapsed[data-current-view="dashboard"] .sidebar .nav-label i {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: currentColor;
  font-size: 22px;
  font-style: normal;
}
body[data-current-view="dashboard"] .nav-label span,
body.sidebar-auto[data-current-view="dashboard"] .sidebar:not(:hover):not(:focus-within) .nav-label span,
body.sidebar-collapsed[data-current-view="dashboard"] .sidebar .nav-label span { display: inline; }
body[data-current-view="dashboard"] .nav-badge { display: none; }

body[data-current-view="dashboard"] .sidebar-footer,
body.sidebar-auto[data-current-view="dashboard"] .sidebar:not(:hover):not(:focus-within) .sidebar-footer,
body.sidebar-collapsed[data-current-view="dashboard"] .sidebar .sidebar-footer {
  position: absolute;
  left: 20px !important;
  right: 18px !important;
  bottom: 22px;
  display: grid;
  grid-template-columns: 42px minmax(0,1fr) 18px;
  align-items: center;
  gap: 12px;
  padding-top: 22px;
  border-top: 1px solid rgba(255,255,255,0.24);
}
.sidebar-user-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: #0759c9;
  color: #fff;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(0,39,120,0.28);
}
.sidebar-user-copy,
body.sidebar-auto[data-current-view="dashboard"] .sidebar:not(:hover):not(:focus-within) .sidebar-user-copy,
body.sidebar-collapsed[data-current-view="dashboard"] .sidebar .sidebar-user-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}
.sidebar-user-copy strong {
  overflow: hidden;
  color: #fff;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-user-copy small { color: rgba(255,255,255,0.9); font-size: 13px; }
body[data-current-view="dashboard"] .sidebar-mode-btn {
  width: 18px;
  height: 18px;
  min-height: 18px;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #fff;
}

.noetix-dashboard {
  display: grid;
  gap: 18px;
  max-width: 1286px;
  margin: 0 auto;
  padding-bottom: 22px;
}
.noetix-status-bar,
.noetix-card,
.noetix-metric {
  border: 1px solid #e7edf5;
  background: #fff;
  box-shadow: 0 9px 28px rgba(15,23,42,0.055);
}
.noetix-status-bar {
  display: grid;
  position: relative;
  grid-template-columns: 280px 280px minmax(380px,1fr);
  align-items: center;
  min-height: 78px;
  border-radius: 14px;
  max-width: calc(100% - 108px);
}
.status-block { display: grid; gap: 8px; padding: 0 22px; }
.status-block + .status-block { border-left: 1px solid #e8edf4; }
.status-block span { color: #64748b; font-size: 13px; }
.status-block strong {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #111c33;
  font-size: 16px;
}
.connected-store strong i { width: 9px; height: 9px; border-radius: 50%; background: #10b981; }
.status-block em {
  width: max-content;
  padding: 4px 12px;
  border-radius: 999px;
  background: #eafaf1;
  color: #048247;
  font-style: normal;
  font-weight: 760;
}
.last-sync { grid-template-columns: 1fr auto; }
.last-sync span { grid-column: 1 / -1; }
.status-actions { display: flex; justify-content: flex-end; gap: 12px; padding-right: 16px; }
.status-actions button,
.card-head button,
.card-head select {
  min-height: 42px;
  border: 1px solid #dfe7f2;
  border-radius: 8px;
  background: #fff;
  color: #0c1b33;
  font-weight: 760;
}
.status-actions .primary { background: #0769ff; color: #fff; box-shadow: 0 12px 24px rgba(7,105,255,0.22); }
.status-icons {
  position: absolute;
  left: calc(100% + 34px);
  top: 50%;
  display: flex;
  justify-content: center;
  gap: 26px;
  transform: translateY(-50%);
}
.status-icons button {
  width: 30px;
  height: 30px;
  border: 0;
  background: transparent;
  color: #0b1630;
  font-size: 22px;
  font-weight: 800;
}

.noetix-metric-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 14px; }
.noetix-metric {
  display: grid;
  grid-template-columns: 58px minmax(0,1fr);
  align-items: center;
  min-height: 118px;
  padding: 18px;
  border-radius: 14px;
}
.metric-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 16px;
  color: #fff;
  font-size: 17px;
  font-weight: 900;
}
.metric-woo .metric-icon { background: linear-gradient(135deg,#7c3bbd,#9e45d4); }
.metric-blue .metric-icon { background: linear-gradient(135deg,#0857ed,#1683ff); }
.metric-green .metric-icon { background: linear-gradient(135deg,#07a34d,#35c76f); }
.metric-red .metric-icon { background: linear-gradient(135deg,#fe1746,#fa5574); }
.metric-cyan .metric-icon { background: linear-gradient(135deg,#0498ee,#23c5f4); }
.metric-orange .metric-icon { background: linear-gradient(135deg,#ff8506,#ffad22); }
.metric-purple .metric-icon { background: linear-gradient(135deg,#7225d8,#aa36e6); }
.noetix-metric span,
.table-head,
.card-head span { color: #52617a; font-size: 14px; }
.noetix-metric strong {
  display: block;
  margin-top: 6px;
  color: #101a31;
  font-size: 22px;
  line-height: 1;
}
.noetix-metric .status-value { color: #0ca74e; }
.noetix-metric small { display: block; margin-top: 9px; color: #40516b; font-size: 14px; }

.noetix-main-grid { display: grid; grid-template-columns: 1.42fr 0.95fr 1fr; gap: 16px; }
.noetix-card {
  min-width: 0;
  padding: 16px 16px 12px;
  border-radius: 14px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head h2 { margin: 0; color: #101a31; font-size: 16px; line-height: 1.1; }
.card-head h2 span { color: #111827; font-size: 14px; font-weight: 600; }
.card-head button,
.card-head select {
  min-height: 30px;
  padding: 0 12px;
  border-radius: 8px;
  color: #0067ef;
  font-size: 12px;
}
.noetix-table { display: grid; }
.table-row {
  display: grid;
  grid-template-columns: 0.85fr 1.25fr 1.35fr 1.15fr 0.9fr 1fr;
  align-items: center;
  min-height: 33px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid #e8edf4;
  background: transparent;
  color: #14213b;
  text-align: left;
}
.top-products .table-row { grid-template-columns: 2fr 0.7fr 1.1fr 0.8fr; }
.top-products .table-row { min-height: 28px; font-size: 12px; }
.table-head { min-height: 38px; color: #1d2940; font-size: 12px; font-weight: 800; }
.linkish,
.link-action { color: #006dff; font-weight: 760; }
.link-action { margin-top: 18px; padding: 0; border: 0; background: transparent; font-size: 14px; }
.status-pill,
.margin-pill,
.sync-row em {
  display: inline-flex;
  width: max-content;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-style: normal;
  font-weight: 760;
  max-width: 104px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.status-pill.ok,
.margin-pill,
.sync-row em { background: #e7fbf0; color: #07964c; }
.status-pill.work { background: #e9f3ff; color: #006be8; }
.status-pill.wait { background: #fff2db; color: #d77206; }
.status-pill.muted { background: #f1f5f9; color: #52617a; }

.anomaly-list,
.mail-list,
.sync-list { display: grid; }
.anomaly-row,
.mail-row,
.sync-row {
  display: grid;
  align-items: center;
  min-height: 38px;
  border-bottom: 1px solid #e8edf4;
}
.anomaly-row { grid-template-columns: 28px minmax(0,1fr) auto; }
.warn-icon { color: #ff8a00; font-size: 22px; }
.anomaly-row strong,
.mail-row strong { display: grid; gap: 2px; color: #13213a; font-size: 14px; }
.anomaly-row small,
.mail-row small { color: #516179; font-size: 12px; font-weight: 500; }
.anomaly-row em { color: #17243e; font-style: normal; }
.danger-text { color: #ff153b !important; font-weight: 780; }
.mail-row { grid-template-columns: 26px minmax(0,1fr) auto; }
.mail-row i { width: 10px; height: 10px; border-radius: 50%; background: #117dff; }
.mail-row time,
.sync-row time { color: #52617a; }
.sync-row { grid-template-columns: minmax(0,1fr) 78px auto; gap: 12px; min-height: 32px; font-size: 12px; }
.sync-row span { color: #13213a; font-weight: 650; }

.line-chart-lite {
  position: relative;
  height: 138px;
  padding: 20px 0 0;
  background:
    linear-gradient(#e8edf4 1px, transparent 1px) 0 24px / 100% 48px no-repeat,
    linear-gradient(#e8edf4 1px, transparent 1px) 0 72px / 100% 48px no-repeat,
    linear-gradient(#e8edf4 1px, transparent 1px) 0 120px / 100% 48px no-repeat,
    linear-gradient(#e8edf4 1px, transparent 1px) 0 168px / 100% 48px no-repeat;
}
.line-chart-lite svg { width: 100%; height: 104px; }
.chart-fill { fill: rgba(20,132,255,0.13); }
.chart-line { fill: none; stroke: #1380ff; stroke-width: 1.8; vector-effect: non-scaling-stroke; }
.chart-axis { display: flex; justify-content: space-between; color: #65748b; font-size: 12px; }
.green-text { color: #07964c; font-weight: 800; }

.noetix-footer {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  min-height: 42px;
  color: #5e6c83;
  font-size: 13px;
}
.noetix-footer span:nth-child(2) { text-align: center; }
.noetix-footer span:last-child { text-align: right; }

@media (max-width: 1380px) {
  body[data-current-view="dashboard"] .sidebar,
  body.sidebar-auto[data-current-view="dashboard"] .sidebar,
  body.sidebar-collapsed[data-current-view="dashboard"] .sidebar,
  body.sidebar-expanded[data-current-view="dashboard"] .sidebar {
    width: 236px !important;
    min-width: 236px !important;
  }
  .noetix-status-bar { grid-template-columns: 1fr 1fr; padding: 14px; }
  .status-actions,
  .status-icons { justify-content: flex-start; padding: 0 8px; }
  .noetix-metric-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .noetix-main-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  body[data-current-view="dashboard"] { display: block; overflow: auto; }
  body[data-current-view="dashboard"] .sidebar {
    position: relative;
    width: 100% !important;
    min-width: 0 !important;
    height: auto;
    padding-bottom: 20px !important;
  }
  body[data-current-view="dashboard"] main { padding: 16px; }
  .noetix-status-bar,
  .noetix-metric-grid,
  .noetix-footer { grid-template-columns: 1fr; }
  .status-actions { display: grid; }
  .noetix-footer,
  .noetix-footer span,
  .noetix-footer span:nth-child(2),
  .noetix-footer span:last-child { text-align: left; }
}

body[data-current-view="dashboard"] .brand-copy strong {
  line-height: 1;
}

body[data-current-view="dashboard"] .brand-copy small {
  display: block;
  margin-top: 2px;
}

body[data-current-view="dashboard"] .table-row span,
body[data-current-view="dashboard"] .anomaly-row strong,
body[data-current-view="dashboard"] .mail-row strong,
body[data-current-view="dashboard"] .sync-row span,
body[data-current-view="dashboard"] .anomaly-row small,
body[data-current-view="dashboard"] .mail-row small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

* { box-sizing: border-box; }

html {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  color: var(--ink);
  background: var(--soft);
  font-size: 13px;
}

.login-gate {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #eef2f7;
}

body.auth-locked .login-gate {
  display: flex;
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 16px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.18);
}

.login-card img {
  width: 78px;
  height: 78px;
  object-fit: contain;
  border-radius: 8px;
  background: #061326;
  padding: 6px;
}

.login-card h1 {
  margin: 0 0 5px;
  font-size: 25px;
  line-height: 1.1;
}

.login-card p {
  margin: 0;
  color: var(--muted);
}

.login-card label {
  display: grid;
  gap: 7px;
  color: #334155;
  font-weight: 750;
}

.login-card input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  font-size: 16px;
}

.login-error {
  min-height: 18px;
  color: var(--danger);
  font-weight: 750;
}

button, input, select, textarea {
  font: inherit;
}

.sidebar {
  width: 204px;
  min-width: 204px;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow: hidden;
  background: #07182f;
  color: white;
  padding: 16px 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  transition: width 160ms ease, min-width 160ms ease;
}

.sidebar-mode-btn {
  width: 100%;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  background: rgba(8, 17, 29, 0.22);
  color: #d6deea;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
}

.sidebar-mode-btn:hover {
  background: var(--brand);
  color: #fff;
}

body.sidebar-auto .sidebar,
body.sidebar-collapsed .sidebar {
  width: 64px;
  min-width: 64px;
  padding-left: 9px;
  padding-right: 9px;
}

body.sidebar-auto .sidebar:not(:hover):not(:focus-within) .sidebar-footer,
body.sidebar-collapsed .sidebar .sidebar-footer {
  right: 9px;
  left: 9px;
}

body.sidebar-auto .sidebar:hover,
body.sidebar-auto .sidebar:focus-within,
body.sidebar-expanded .sidebar {
  width: 204px;
  min-width: 204px;
  padding-left: 10px;
  padding-right: 10px;
}

body.sidebar-auto .sidebar:hover .sidebar-footer,
body.sidebar-auto .sidebar:focus-within .sidebar-footer,
body.sidebar-expanded .sidebar .sidebar-footer {
  right: 10px;
  left: 10px;
}

body.sidebar-auto .sidebar:not(:hover):not(:focus-within) .brand-copy,
body.sidebar-auto .sidebar:not(:hover):not(:focus-within) .sidebar-footer-logo,
body.sidebar-auto .sidebar:not(:hover):not(:focus-within) .app-signature,
body.sidebar-auto .sidebar:not(:hover):not(:focus-within) .nav-label span,
body.sidebar-auto .sidebar:not(:hover):not(:focus-within) .sync-card,
body.sidebar-auto .sidebar:not(:hover):not(:focus-within) .nav-badge,
body.sidebar-collapsed .sidebar .brand-copy,
body.sidebar-collapsed .sidebar .sidebar-footer-logo,
body.sidebar-collapsed .sidebar .app-signature,
body.sidebar-collapsed .sidebar .nav-label span,
body.sidebar-collapsed .sidebar .sync-card,
body.sidebar-collapsed .sidebar .nav-badge {
  display: none;
}

body.sidebar-auto .sidebar:not(:hover):not(:focus-within) .nav-submenu,
body.sidebar-collapsed .sidebar .nav-submenu {
  display: none !important;
}

body.sidebar-auto .sidebar:not(:hover):not(:focus-within) .brand,
body.sidebar-collapsed .sidebar .brand {
  justify-items: center;
  padding-left: 0;
  padding-right: 0;
}

body.sidebar-auto .sidebar:not(:hover):not(:focus-within) .brand-logo,
body.sidebar-collapsed .sidebar .brand-logo {
  width: 42px;
  height: 42px;
}

body.sidebar-auto .sidebar:not(:hover):not(:focus-within) .nav-item,
body.sidebar-collapsed .sidebar .nav-item {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

body.sidebar-auto .sidebar:not(:hover):not(:focus-within) .nav-label,
body.sidebar-collapsed .sidebar .nav-label {
  justify-content: center;
  gap: 0;
}

body.sidebar-auto .sidebar:not(:hover):not(:focus-within) .nav-label i,
body.sidebar-collapsed .sidebar .nav-label i {
  width: 26px;
}

.brand {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 7px;
  min-height: 0;
  margin-bottom: 0;
  padding: 4px 5px 10px;
  width: 100%;
  border: 0;
  background: transparent;
  color: white;
  text-align: left;
  overflow: visible;
}

.brand-logo {
  display: none;
  width: 86px;
  height: 58px;
  object-fit: contain;
  object-position: center;
  border-radius: 6px;
  background: rgba(8, 17, 29, 0.7);
  padding: 3px;
}

.brand-logo-noetix {
  display: block;
  background: #061326;
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.16);
}

.brand-copy {
  min-width: 0;
}

.brand-copy strong {
  display: block;
  color: #ffffff;
  font-size: 17px;
  line-height: 1.08;
  font-weight: 800;
  white-space: nowrap;
}

.brand-copy strong > span {
  display: inline;
  color: #8fbaff;
  font-size: inherit;
  margin-top: 0;
}

.brand-copy > small {
  display: block;
  color: #8fbaff;
  font-size: 10.5px;
  font-weight: 650;
  margin-top: 4px;
  line-height: 1.2;
}

.brand:hover {
  background: transparent;
}

nav {
  display: grid;
  gap: 5px;
  flex: 1 1 auto;
  margin-top: 2px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
  padding-bottom: 4px;
}

.nav-item {
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #d6deea;
  padding: 8px 9px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  text-align: left;
  font-size: 12.5px;
  font-weight: 700;
  min-height: 36px;
}

.nav-item:hover, .nav-item.active {
  background: linear-gradient(90deg, var(--brand), #0ab8df);
  color: white;
}

.nav-item.nav-secondary {
  color: #b7c4d6;
}

.nav-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.nav-label i {
  width: 22px;
  flex: 0 0 auto;
  font-style: normal;
  font-size: 17px;
  line-height: 1;
  text-align: center;
}

.nav-label span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-badge {
  display: none;
  min-width: 20px;
  height: 20px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 11px;
  line-height: 16px;
  text-align: center;
  font-weight: 700;
}

.nav-badge.active {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-submenu {
  display: none;
  gap: 4px;
  padding: 0 2px 4px 26px;
}

.nav-submenu.open {
  display: grid;
}

.nav-submenu button {
  min-height: 28px;
  padding: 5px 7px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #aebccd;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  font-size: 10.5px;
  font-weight: 650;
}

.nav-submenu button:hover,
.nav-submenu button.active {
  background: #1b2834;
  color: #fff;
}

.nav-submenu small {
  min-width: 18px;
  height: 18px;
  padding: 1px 5px;
  border-radius: 999px;
  background: #334155;
  color: #fff;
  text-align: center;
  font-weight: 800;
  line-height: 16px;
}

.sidebar-footer {
  position: static;
  display: grid;
  flex: 0 0 auto;
  gap: 10px;
  margin-top: auto;
}

.sidebar-footer-logo {
  width: 72px;
  height: 48px;
  justify-self: center;
  object-fit: contain;
  border-radius: 6px;
  background: #08111d;
  padding: 3px;
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.16);
}

.app-signature {
  color: #8fbaff;
  text-align: center;
  font-size: 10.5px;
  font-weight: 750;
  line-height: 1.25;
}

.sync-card {
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 10px;
  padding: 10px;
  display: grid;
  gap: 4px;
  background: rgba(8, 17, 29, 0.22);
}

.sync-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sync-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #64748b;
  box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.18);
}

.sync-dot.online {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.22);
}

.sync-dot.pending {
  background: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.sync-dot.offline-warning {
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.22);
}

.sync-dot.error {
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.22);
}

.sync-card span, .muted {
  color: var(--muted);
  font-size: 12px;
}

.sync-card strong {
  font-size: 13px;
}

.sync-card small {
  color: #93a4b5;
  font-size: 11px;
  line-height: 1.3;
}

main {
  flex: 1;
  min-width: 0;
  height: 100vh;
  padding: 0 18px 18px;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--soft);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: minmax(180px, 0.75fr) minmax(240px, 1fr) minmax(320px, auto);
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 -18px 12px;
  padding: 14px 22px 10px 18px;
  border-bottom: 1px solid rgba(221, 227, 236, 0.9);
  background: var(--soft);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05);
}

.sync-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  min-width: 0;
  padding: 7px 10px;
  color: var(--muted);
  font-size: 12px;
  justify-self: stretch;
  overflow: hidden;
}

.sync-banner strong {
  color: var(--ink);
  font-size: 13px;
  white-space: nowrap;
}

.sync-banner span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sync-banner.online {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.sync-banner.pending {
  border-color: #bae6fd;
  background: #f0f9ff;
}

.sync-banner.offline-warning {
  border-color: #fde68a;
  background: #fffbeb;
}

.sync-banner.error {
  border-color: #fecaca;
  background: #fef2f2;
}

h1, h2, h3, p {
  margin: 0;
}

h1 {
  font-size: 22px;
  letter-spacing: 0;
  line-height: 1.12;
}

h2 {
  font-size: 15px;
}

h3 {
  font-size: 14px;
}

.topbar p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.top-actions, .button-row, .quote-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
  align-items: center;
  justify-self: end;
  min-width: 0;
  max-width: 100%;
}

.top-sync {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.top-sync-logo {
  width: 34px;
  height: 23px;
  flex: 0 0 auto;
  object-fit: contain;
}

.user-chip {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 6px 10px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.top-site-link {
  width: 42px;
  height: 30px;
  min-height: 30px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  padding: 1px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.top-site-link.mondo-sync-link {
  padding: 2px 4px;
  background: #ffffff;
}

button {
  min-height: 30px;
  border-radius: 7px;
  border: 1px solid var(--line);
  padding: 6px 9px;
  background: white;
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}

button.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: white;
}

button.primary:hover {
  background: var(--brand-strong);
}

button.ghost:hover {
  background: #eef2f7;
}

button.ghost.danger {
  color: var(--danger);
  border-color: #fecaca;
}

button.icon {
  width: 34px;
  height: 34px;
  padding: 0;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.orders-command-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.orders-command-bar h2 {
  font-size: 16px;
}

.orders-command-bar p {
  margin-top: 3px;
}

.orders-sync-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.orders-sync-tools .muted {
  max-width: 460px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-settings-status {
  margin: 10px 0;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.dashboard-metrics {
  grid-template-columns: repeat(5, minmax(150px, 1fr));
}

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

.dashboard-ops-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 12px;
  margin-bottom: 12px;
}

.action-panel {
  overflow: hidden;
}

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

.order-action-card {
  grid-template-columns: 62px minmax(0, 1fr);
  align-items: center;
  column-gap: 14px;
  border: 1px solid #edf1f6;
  border-radius: 7px;
  padding: 14px;
  background: #fbfcfe;
  display: grid;
  gap: 3px;
  text-align: left;
  cursor: pointer;
}

.order-action-card > * {
  min-width: 0;
}

.order-action-card strong {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 1px solid #dbe3ef;
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  font-size: 26px;
  line-height: 1;
}

.order-action-card span {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  overflow-wrap: anywhere;
  white-space: normal;
}

.order-action-card small {
  display: block;
  color: #475569;
  font-size: 12px;
  line-height: 1.3;
  overflow-wrap: anywhere;
  white-space: normal;
}

.order-action-card.workflow-received {
  border-color: #f8d28b;
  background: #fff8eb;
}

.order-action-card.workflow-sent {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.order-action-card.workflow-blocked {
  border-color: #fecaca;
  background: #fef2f2;
}

.order-action-card.workflow-offer {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.order-action-card.workflow-production {
  border-color: #f59e0b;
  background: #fffbeb;
}

.order-action-card.workflow-shipped {
  border-color: #bae6fd;
  background: #f0f9ff;
}

.critical-orders-panel {
  overflow: hidden;
}

.critical-orders-list {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.critical-order-card {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) minmax(120px, auto);
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid #dbe3ef;
  border-left-width: 5px;
  border-radius: 8px;
  background: #fff;
  text-align: left;
}

.critical-order-card > * {
  min-width: 0;
}

.critical-order-card strong {
  color: #1d4ed8;
  font-size: 14px;
}

.critical-order-card b {
  display: block;
  font-size: 14px;
}

.critical-order-card small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  line-height: 1.25;
}

.critical-order-card em {
  border-radius: 999px;
  padding: 5px 9px;
  background: #f8fafc;
  color: #334155;
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
  white-space: normal;
  text-align: center;
}

.critical-order-card.urgent {
  animation: urgentPulse 1.45s ease-in-out infinite;
}

.critical-order-card.tone-blocked,
.critical-order-card.tone-received {
  border-left-color: #dc2626;
}

.critical-order-card.tone-offer,
.critical-order-card.tone-confirmed {
  border-left-color: #16a34a;
}

.critical-order-card.tone-sent,
.critical-order-card.tone-production {
  border-left-color: #d97706;
}

@keyframes urgentPulse {
  0%, 100% { box-shadow: 0 0 0 rgba(220, 38, 38, 0); }
  50% { box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.14); }
}

.dashboard-chart-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 0;
  margin-bottom: 12px;
}

.dashboard-chart-toolbar button {
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #d7deea;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.dashboard-chart-toolbar button.active {
  border-color: var(--brand);
  background: #e8f5ff;
  color: var(--brand-dark);
}

.gmail-filters {
  align-items: end;
  grid-template-columns: minmax(160px, 1fr) minmax(150px, 0.8fr) minmax(160px, 1fr) minmax(180px, 0.8fr);
}

.gmail-filters .filter-check {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 800;
}

.gmail-filters .filter-check input[type="checkbox"] {
  width: auto;
  flex: 0 0 auto;
  margin: 0;
}

.gmail-filters .filter-check span {
  line-height: 1.1;
}

.gmail-status-row {
  margin: 10px 0;
  padding: 9px 10px;
  border: 1px solid #dbeafe;
  border-radius: 7px;
  background: #f8fbff;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}

.technical-fallback {
  border: 1px solid #e5eaf2;
  border-radius: 7px;
  padding: 8px 10px;
  background: #f8fafc;
}

.technical-fallback summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.technical-fallback label {
  margin-top: 8px;
}

.gmail-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.gmail-row .row-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.order-ref-badge {
  background: #dbeafe;
  color: #1d4ed8;
}

.muted-badge {
  background: #f1f5f9;
  color: #64748b;
}

.gmail-dialog {
  width: min(980px, calc(100vw - 48px));
}

.gmail-message-view {
  display: grid;
  gap: 14px;
}

.gmail-message-body {
  max-height: min(58vh, 620px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 14px;
  background: #fbfcfe;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.gmail-message-frame {
  width: 100%;
  height: min(62vh, 680px);
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.separated-charts {
  grid-template-columns: 1fr;
}

.dashboard-filters {
  display: grid;
  grid-template-columns: repeat(7, minmax(130px, 1fr));
  gap: 8px;
  align-items: end;
  margin-bottom: 12px;
}

.main-chart-block {
  border: 1px solid #edf1f6;
  border-radius: 7px;
  padding: 14px;
  margin-bottom: 14px;
  background: #fbfcfe;
}

.chart-card {
  border: 1px solid #edf1f6;
  border-radius: 7px;
  padding: 14px;
  background: #fff;
}

.chart-revenue {
  --chart-color: #2563eb;
  --chart-bg: #dbeafe;
}

.chart-products {
  --chart-color: #0f766e;
  --chart-bg: #ccfbf1;
}

.chart-costs {
  --chart-color: #dc2626;
  --chart-bg: #fee2e2;
}

.chart-controls {
  display: flex;
  gap: 6px;
  align-items: center;
}

.chart-controls button {
  min-height: 28px;
  padding: 4px 9px;
  font-size: 12px;
}

.main-chart-block .panel-head strong {
  font-size: 22px;
}

.main-chart {
  min-height: 250px;
  grid-template-columns: repeat(12, minmax(42px, 1fr));
}

.comparison-chart {
  grid-template-columns: repeat(2, minmax(110px, 180px));
  justify-content: start;
}

.main-chart .vertical-bar {
  grid-template-rows: 28px 190px 34px;
}

.main-chart .vertical-bar div {
  height: 190px;
}

.dashboard-charts h3 {
  margin-bottom: 10px;
}

.vertical-chart {
  display: grid;
  grid-template-columns: repeat(6, minmax(42px, 1fr));
  gap: 10px;
  align-items: end;
  min-height: 210px;
}

.vertical-chart .muted {
  grid-column: 1 / -1;
  align-self: center;
}

.vertical-bar {
  min-width: 0;
  display: grid;
  grid-template-rows: 28px 150px 34px;
  gap: 7px;
  align-items: end;
  justify-items: center;
  font-size: 11px;
}

.vertical-bar strong {
  align-self: end;
  font-size: 10px;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vertical-bar div {
  width: 100%;
  max-width: 44px;
  height: 150px;
  background: var(--chart-bg, #eef2f7);
  border-radius: 6px 6px 3px 3px;
  overflow: hidden;
  display: flex;
  align-items: end;
}

.vertical-bar i {
  display: block;
  width: 100%;
  background: var(--chart-color, var(--brand));
  border-radius: 6px 6px 3px 3px;
}

.vertical-bar.revenue {
  --chart-color: #2563eb;
  --chart-bg: #dbeafe;
}

.vertical-bar.products {
  --chart-color: #0f766e;
  --chart-bg: #ccfbf1;
}

.vertical-bar.costs {
  --chart-color: #dc2626;
  --chart-bg: #fee2e2;
}

.vertical-bar.profit {
  --chart-color: #16a34a;
  --chart-bg: #dcfce7;
}

.vertical-bar.profit.negative {
  --chart-color: #dc2626;
  --chart-bg: #fee2e2;
}

.vertical-bar span {
  color: var(--muted);
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.metrics div, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.metrics div {
  padding: 11px 12px;
}

.metrics span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metrics strong {
  display: block;
  font-size: 23px;
  margin-top: 3px;
}

.sales-metrics {
  margin-top: 0;
}

.view-overview {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.view-overview-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.view-overview-head h2 {
  font-size: 18px;
}

.view-overview-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.view-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
}

.view-overview-card {
  min-height: 78px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #ffffff;
  padding: 12px 14px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.view-overview-card span {
  display: block;
  color: #6b7280;
  font-size: 12px;
  font-weight: 750;
}

.view-overview-card strong {
  display: block;
  margin-top: 6px;
  color: #111827;
  font-size: 24px;
  line-height: 1.1;
}

.order-legend {
  display: grid;
  grid-template-columns: repeat(5, minmax(145px, 1fr));
  gap: 8px;
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid #edf1f6;
  border-radius: 7px;
  background: #fbfcfe;
  color: var(--muted);
  font-size: 12px;
}

.order-legend span {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.orders-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.orders-quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 10px;
}

.orders-quick-filters button {
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid #dbe3ef;
  border-radius: 7px;
  background: #ffffff;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}

.orders-quick-filters button.active {
  border-color: #9db2ca;
  background: #eef4fb;
  color: #1f3b57;
}

.orders-quick-filters span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: 5px;
  border-radius: 999px;
  background: #edf2f7;
  color: #475569;
  font-size: 10px;
}

.dashboard-filters label,
.orders-filters label,
.filters label {
  grid-template-rows: 17px 40px;
  align-items: stretch;
}

.dashboard-filters input,
.dashboard-filters select,
.orders-filters input,
.orders-filters select,
.filters input,
.filters select {
  height: 40px;
  min-height: 40px;
  line-height: 1.2;
}

.state-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: 0 0 auto;
  background: #94a3b8;
}

.state-dot.check {
  background: #64748b;
}

.state-dot.received {
  background: #d8a21d;
}

.state-dot.sent {
  background: #d98a32;
}

.state-dot.offer {
  background: #d98a32;
}

.state-dot.confirmed {
  background: #3f9f5f;
}

.state-dot.production {
  background: #2f9b5d;
}

.state-dot.shipped {
  background: #247a4a;
}

.state-dot.completed {
  background: #15803d;
}

.cost-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #edf1f6;
  font-size: 15px;
}

.costs-dashboard {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

.costs-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 10px;
}

.cost-kpi-card {
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 12px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

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

.cost-kpi-card strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.1;
}

.costs-order-table {
  min-width: 1080px;
}

.costs-order-table th,
.costs-order-table td {
  white-space: nowrap;
}

.costs-order-table .cost-money {
  color: #dc2626;
  font-weight: 750;
}

.costs-order-table th.cost-money,
.costs-order-table th.sale-money,
.costs-order-table th.cost-revenue-money,
.costs-order-table th.warn-money {
  color: var(--ink);
}

.costs-order-table .sale-money {
  color: var(--ink);
  font-weight: 750;
}

.costs-order-table .cost-revenue-money {
  color: #166534;
  font-weight: 750;
}

.costs-order-table .warn-money {
  color: #d97706;
  font-weight: 750;
}

.cost-margin {
  font-weight: 750;
}

.cost-margin.very-low {
  color: #e11d48;
}

.cost-margin.low {
  color: #ea580c;
}

.cost-margin.mid {
  color: #ca8a04;
}

.cost-margin.good {
  color: #22a34a;
}

.costs-order-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.cost-state-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.cost-state-pill.green {
  border: 1px solid #bbf7d0;
  background: #dcfce7;
  color: #15803d;
}

.cost-state-pill.orange {
  border: 1px solid #fed7aa;
  background: #fff7ed;
  color: #c2410c;
}

.cost-state-pill.red {
  border: 1px solid #fecaca;
  background: #fee2e2;
  color: #b91c1c;
}

.cost-total-row span {
  color: var(--muted);
}

.cost-total-row strong {
  font-size: 20px;
}

.panel {
  padding: 12px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.split {
  display: grid;
  grid-template-columns: minmax(390px, 430px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.split.wide-left {
  grid-template-columns: minmax(620px, 1fr) 360px;
}

.stack {
  display: grid;
  gap: 14px;
}

.form {
  display: grid;
  gap: 10px;
}

label {
  display: grid;
  gap: 5px;
  color: #374151;
  font-size: 12px;
  font-weight: 650;
}

input, select, textarea {
  width: 100%;
  border: 1px solid #ccd5e1;
  border-radius: 7px;
  background: white;
  padding: 8px 9px;
  color: var(--ink);
}

textarea {
  resize: vertical;
}

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

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

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

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

.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 21px;
}

.checkbox input {
  width: 18px;
  height: 18px;
}

label.field-updated input,
label.field-updated textarea,
label.field-updated select {
  border-color: #38bdf8;
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.14);
}

label.field-updated::after {
  content: "aggiornato dal documento";
  color: #0369a1;
  font-size: 11px;
  font-weight: 700;
}

.table {
  display: grid;
  gap: 8px;
}

.order-edit-list {
  display: grid;
  gap: 10px;
}

.order-edit-card {
  display: grid;
  gap: 10px;
  border: 1px solid #edf1f6;
  border-radius: 7px;
  padding: 12px;
  background: #fbfcfe;
}

.row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid #e5eaf2;
  border-radius: 8px;
  padding: 11px 12px;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
}

.row:hover {
  background: #f8fbff;
}

.row.warn {
  border-color: #f8d28b;
  background: #fff8eb;
}

.order-row {
  grid-template-columns: minmax(0, 1fr) 96px auto;
  border-color: #e2e8f0;
  border-left-width: 4px;
  background: #ffffff;
}

.order-row.workflow-received {
  border-left-color: #d97706;
  background: #fffbeb;
}

.order-row.workflow-sent {
  border-left-color: #2563eb;
  background: #eff6ff;
}

.order-row.workflow-offer {
  border-left-color: #d97706;
  background: #fff7ed;
}

.order-row.workflow-confirmed {
  border-left-color: #2563eb;
  background: #eff6ff;
}

.order-row.workflow-production {
  border-left-color: #2563eb;
  background: #eff6ff;
}

.order-row.workflow-shipped {
  border-left-color: #0284c7;
  background: #f0f9ff;
}

.order-row.workflow-completed {
  border-left-color: #15803d;
  background: #f0fdf4;
}

.order-row.order-archived {
  border-left-color: #64748b;
  background: #f8fafc;
  opacity: 0.9;
}

.row-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 750;
  min-width: 0;
}

.row-title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.row-actions {
  display: flex;
  gap: 7px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  min-width: max-content;
}

.row-actions button,
.detail-actions button,
.compact-action {
  white-space: nowrap;
}

.order-total-cell {
  display: grid;
  justify-items: end;
  align-content: center;
  min-width: 96px;
  color: #334155;
}

.order-total-cell span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.order-total-cell strong {
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.money-stack {
  display: grid;
  justify-items: end;
  gap: 3px;
}

.money-stack span {
  color: var(--muted);
  font-size: 11px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 2px 8px;
  background: #e7f7f3;
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 750;
}

.badge.warn {
  background: #fff1cc;
  color: #92400e;
}

.badge.danger {
  background: #fee2e2;
  color: #991b1b;
}

.archive-badge {
  background: #e2e8f0;
  color: #475569;
}

.workflow-badge.workflow-received {
  background: #f8fafc;
  color: #334155;
  box-shadow: inset 3px 0 0 #d97706;
}

.workflow-badge.workflow-sent {
  background: #f8fafc;
  color: #334155;
  box-shadow: inset 3px 0 0 #2563eb;
}

.workflow-badge.workflow-offer {
  background: #f8fafc;
  color: #334155;
  box-shadow: inset 3px 0 0 #d97706;
}

.workflow-badge.workflow-confirmed {
  background: #f8fafc;
  color: #334155;
  box-shadow: inset 3px 0 0 #2563eb;
}

.workflow-badge.workflow-production {
  background: #f8fafc;
  color: #334155;
  box-shadow: inset 3px 0 0 #2563eb;
}

.workflow-badge.workflow-shipped {
  background: #f8fafc;
  color: #334155;
  box-shadow: inset 3px 0 0 #0284c7;
}

.workflow-badge.workflow-completed {
  background: #f8fafc;
  color: #334155;
  box-shadow: inset 3px 0 0 #15803d;
}

.woo-status {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 12px;
}

.woo-status.woo-processing {
  background: #dbeafe;
  color: #1d4ed8;
}

.woo-status.woo-completed {
  background: #bbf7d0;
  color: #166534;
}

.woo-status.woo-cancelled {
  background: #fee2e2;
  color: #b91c1c;
}

.woo-status.woo-pending,
.woo-status.woo-hold {
  background: #fef3c7;
  color: #92400e;
}

.woo-status.woo-draft {
  background: #e2e8f0;
  color: #475569;
}

button.danger {
  border-color: #fecaca;
  color: #991b1b;
}

.quote-toolbar {
  justify-content: space-between;
  padding-top: 4px;
}

.quotes-page {
  display: grid;
  gap: 12px;
}

.quotes-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 10px;
}

.quote-kpi {
  display: grid;
  gap: 5px;
  min-height: 78px;
  padding: 13px 15px;
  border: 1px solid #dfe7f1;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

.quote-kpi span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.quote-kpi strong {
  color: #0f172a;
  font-size: 24px;
  line-height: 1;
  letter-spacing: 0;
}

.quote-kpi-value strong {
  color: #0f766e;
}

.quotes-list-panel {
  overflow: hidden;
}

.quotes-list-panel .panel-head {
  align-items: center;
}

.quotes-list-panel .panel-head > div {
  display: grid;
  gap: 3px;
}

.quote-list-actions,
.quote-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.quotes-table-wrap {
  border-top: 1px solid #e8eef6;
}

.quotes-table {
  min-width: 1060px;
}

.quotes-table th,
.quotes-table td {
  height: 48px;
  padding: 8px 11px;
  white-space: nowrap;
}

.quotes-table th:nth-child(3),
.quotes-table td:nth-child(3) {
  white-space: normal;
}

.quotes-table tbody tr {
  cursor: pointer;
  background: #ffffff;
}

.quotes-table tbody tr:hover,
.quotes-table tbody tr.selected {
  background: #f8fbff;
}

.quotes-table td small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quote-code {
  color: #1d4ed8;
  font-weight: 800;
}

.quote-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 800;
}

.quote-status.blue {
  background: #eaf2ff;
  color: #1d4ed8;
}

.quote-status.orange {
  background: #fff7ed;
  color: #c2410c;
}

.quote-status.green {
  background: #dcfce7;
  color: #15803d;
}

.quote-actions {
  width: 170px;
}

.quote-actions button {
  min-height: 34px;
  padding: 7px 12px;
}

.quote-linked-order {
  color: #15803d;
  font-size: 12px;
  font-weight: 800;
}

.quote-editor-panel {
  display: grid;
  gap: 12px;
}

.quote-form-section {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #e8eef6;
  border-radius: 8px;
  background: #fbfdff;
}

.quotes-analysis-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 12px;
  align-items: start;
}

.filters {
  display: grid;
  grid-template-columns: 150px 190px minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.product-page {
  position: relative;
}

.product-page-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin: -2px 0 8px;
}

.products-filters {
  grid-template-columns: minmax(190px, 1.4fr) minmax(135px, 0.9fr) minmax(135px, 0.9fr) minmax(125px, 0.8fr) 110px 92px;
}

.product-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.products-table-wrap {
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
}

.catalog-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
  gap: 12px;
  align-items: start;
  margin-bottom: 12px;
}

.catalog-workspace.single {
  grid-template-columns: minmax(0, 1fr);
}

#shippingView .shipping-workspace {
  grid-template-columns: minmax(0, 1fr);
}

.catalog-panel {
  overflow: hidden;
}

.product-list-panel {
  padding: 0;
}

.detail-side-panel {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 12px;
  padding: 14px;
  min-height: 220px;
  background: #f8fbff;
}

.detail-side-header {
  border-bottom: 1px solid #e5ecf5;
  padding-bottom: 10px;
}

.detail-side-header h2 {
  margin: 0;
  font-size: 17px;
}

.detail-side-section {
  display: grid;
  gap: 8px;
}

.detail-side-section h3 {
  margin: 0;
  color: #334155;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.detail-side-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px dashed #dbe3ef;
  padding-bottom: 7px;
}

.detail-side-row span {
  color: var(--muted);
}

.detail-side-row strong {
  text-align: right;
}

.product-row {
  grid-template-columns: minmax(0, 1fr) max-content;
  cursor: pointer;
}

.product-links {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 6px;
}

.products-table {
  min-width: 1120px;
}

.products-table th:nth-child(1) { width: 280px; }
.products-table th:nth-child(2) { width: 105px; }
.products-table th:nth-child(3) { width: 130px; }
.products-table th:nth-child(4) { width: 130px; }
.products-table th:nth-child(5) { width: 120px; }
.products-table th:nth-child(6),
.products-table th:nth-child(7) { width: 115px; }
.products-table th:nth-child(8) { width: 110px; }
.products-table th:nth-child(9) { width: 105px; }
.products-table th:nth-child(10) { width: 145px; }

.product-table-row {
  cursor: pointer;
}

.product-table-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.25;
}

.product-name-cell strong,
.product-name-cell small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-actions {
  white-space: nowrap;
}

.product-actions button {
  min-height: 30px;
  padding: 6px 9px;
}

.product-cost-missing {
  color: #d97706 !important;
  font-weight: 800 !important;
}

.product-calc-pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  border: 1px solid #dbe3ef;
  border-radius: 999px;
  padding: 3px 8px;
  background: #f8fafc;
  color: #334155;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.product-calc-pill.success {
  border-color: #bbf7d0;
  background: #dcfce7;
  color: #15803d;
}

.product-calc-pill.warning {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #c2410c;
}

.product-calc-pill.danger {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.product-calc-pill.info {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.product-detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.log-table {
  max-height: 570px;
  overflow: auto;
}

.log-row {
  display: grid;
  grid-template-columns: 128px 90px 130px 1fr;
  gap: 10px;
  align-items: start;
  border: 1px solid #edf1f6;
  border-radius: 7px;
  padding: 10px;
  font-size: 12px;
}

.log-row strong {
  font-size: 13px;
}

.log-row .log-detail {
  color: var(--muted);
  margin-top: 4px;
  white-space: pre-wrap;
  word-break: break-word;
}

.level {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 2px 8px;
  font-weight: 750;
  background: #eef2f7;
  color: #334155;
}

.level.error {
  background: #fee2e2;
  color: #991b1b;
}

.level.warn {
  background: #fef3c7;
  color: #92400e;
}

.level.success {
  background: #dcfce7;
  color: #166534;
}

.quote-item {
  border: 1px solid #dbe5f0;
  border-radius: 7px;
  padding: 0;
  display: grid;
  margin-bottom: 10px;
  overflow: hidden;
  background: #ffffff;
}

.quote-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid #e8eef6;
  background: #f8fbff;
}

.quote-item-head > div {
  display: grid;
  gap: 2px;
}

.quote-item-head strong {
  color: #0f172a;
  font-size: 13px;
}

.quote-item-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.quote-item-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1.15fr) minmax(190px, 1.15fr) repeat(3, minmax(86px, 0.65fr));
  gap: 8px;
  align-items: end;
  padding: 10px 12px 0;
}

.quote-item-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
  padding: 10px 12px 0;
}

.quote-item-custom {
  border-color: #bfdbfe;
}

.quote-item-custom .quote-item-head {
  background: #eff6ff;
}

.quote-item-custom .quote-catalog-field {
  display: none;
}

.quote-item:not(.quote-item-custom) .quote-custom-field {
  display: none;
}

.quote-item > .checkbox,
.quote-item > .mini-results {
  margin: 0 12px 10px;
}

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

.mini-results {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.mini-results span {
  background: #f4f6f9;
  border-radius: 6px;
  padding: 5px 7px;
}

.totals {
  display: grid;
  gap: 10px;
  align-content: start;
}

.quote-total-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0 12px;
}

.quote-total-grid div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #eef2f7;
  border-radius: 7px;
  padding: 9px 10px;
  background: #fbfdff;
}

.quote-total-grid span {
  color: var(--muted);
  font-size: 12px;
}

.totals .danger-total strong {
  color: #b91c1c;
}

.totals .success-total strong {
  color: #15803d;
}

.quote-margin-chart {
  display: grid !important;
  gap: 8px !important;
  border: 1px solid #eef2f7 !important;
  border-radius: 7px;
  padding: 9px !important;
}

.margin-chart-row {
  display: grid !important;
  grid-template-columns: 58px 1fr 84px;
  align-items: center;
  gap: 8px !important;
  border-bottom: 0 !important;
  padding-bottom: 0 !important;
  font-size: 11px;
}

.margin-chart-row strong {
  text-align: right;
  font-size: 11px;
}

.margin-chart-track {
  height: 9px;
  background: #eef2f7;
  border-radius: 999px;
  overflow: hidden;
}

.margin-chart-track i {
  display: block;
  height: 100%;
  border-radius: 999px;
}

.margin-chart-track .cost {
  background: #ef4444;
}

.margin-chart-track .margin {
  background: #22c55e;
}

.margin-chart-track .list {
  background: #2563eb;
}

.quote-cost-breakdown {
  display: grid;
  gap: 7px;
  border-bottom: 0 !important;
  padding-bottom: 0 !important;
}

.cost-detail-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.cost-detail-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #eef2f7 !important;
  border-radius: 7px;
  padding: 7px !important;
  font-size: 12px;
}

.cost-detail-row span {
  color: #4b5563;
}

.quote-technical-data {
  display: grid;
  gap: 12px;
}

.quote-technical-card {
  display: grid;
  gap: 10px;
}

.quote-technical-media {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 12px;
  align-items: center;
}

.quote-technical-media img,
.quote-technical-placeholder {
  width: 86px;
  height: 86px;
  border-radius: 7px;
  border: 1px solid #e6ecf3;
  object-fit: cover;
  background: #f4f6f9;
}

.quote-technical-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
  padding: 6px;
}

.technical-rows {
  display: grid;
  gap: 6px;
}

.technical-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px;
  border-top: 1px solid #eef2f7;
  padding-top: 6px;
}

.technical-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.technical-row strong {
  font-size: 12px;
}

.button-row.tight {
  gap: 6px;
  margin-top: 8px;
}

.button-row.tight button {
  padding: 6px 9px;
  font-size: 12px;
}

.compact .row {
  grid-template-columns: 1fr;
}

.settings-form {
  display: grid;
  gap: 14px;
  max-width: none;
}

.settings-form-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.settings-form-toolbar button {
  min-width: 170px;
}

body:has(#settingsView.active) #productTemplateBtn,
body:has(#settingsView.active) #exportProductsBtn,
body:has(#apiSettingsView.active) #productTemplateBtn,
body:has(#apiSettingsView.active) #exportProductsBtn {
  display: none;
}

.settings-page-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(440px, 1fr);
  gap: 16px;
  align-items: start;
}

.settings-card {
  display: grid;
  gap: 12px;
  align-content: start;
  min-width: 0;
  padding: 16px;
}

.settings-card-wide {
  grid-column: 1 / -1;
}

.settings-card .panel-head {
  min-height: 44px;
  margin: -16px -16px 0;
  padding: 12px 16px;
  border-bottom: 1px solid #e6edf5;
  background: #fbfdff;
  border-radius: 8px 8px 0 0;
}

.settings-card .panel-head h2 {
  font-size: 17px;
}

.settings-card > .muted {
  margin: 0;
  line-height: 1.35;
}

.settings-card label {
  gap: 5px;
}

.settings-card input,
.settings-card select,
.settings-card textarea {
  min-height: 38px;
  padding: 8px 10px;
}

.settings-card .grid-2,
.settings-card .grid-3 {
  gap: 12px;
}

.settings-card .checkbox {
  min-height: 40px;
  padding-top: 0;
}

.settings-save-row {
  display: flex;
  justify-content: flex-end;
  padding: 0 0 2px;
}

.settings-save-row button {
  min-width: 170px;
}

.settings-subcategory-heading {
  max-width: none;
  margin: 0 0 10px;
  display: grid;
  gap: 4px;
}

.settings-subcategory-heading h2 {
  margin: 0;
}

.api-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(300px, 1fr));
  gap: 10px;
  align-items: stretch;
}

.api-card {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 12px;
}

.api-card .panel-head {
  min-height: 28px;
  margin-bottom: 0;
}

.api-card label {
  gap: 4px;
}

.api-card input {
  min-height: 36px;
  padding: 7px 10px;
}

.api-card > .muted {
  min-height: 34px;
  margin: 0;
  line-height: 1.35;
}

.api-service-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.api-service-list span {
  border: 1px solid #d8e7eb;
  border-radius: 7px;
  background: #f7fbfc;
  min-height: 40px;
  padding: 7px 10px;
  color: #255260;
  font-size: 12px;
  font-weight: 750;
  display: flex;
  align-items: center;
}

.api-card .detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.api-card .detail-grid div {
  min-height: 65px;
  padding: 8px 10px;
  display: grid;
  align-content: center;
}

.api-card .button-row {
  margin-top: auto;
  gap: 8px;
  flex-wrap: wrap;
}

.api-card .button-row button {
  height: 44px;
  min-height: 44px;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.database-storage-card {
  display: grid;
  gap: 8px;
  border: 1px solid #d8e7eb;
  border-radius: 8px;
  background: #f8fbfc;
  padding: 10px;
}

.database-storage-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  font-size: 12px;
  color: var(--text);
}

.database-storage-head span {
  color: var(--muted);
  font-weight: 750;
  white-space: nowrap;
}

.storage-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5edf3;
}

.storage-bar span {
  display: block;
  width: 0;
  min-width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0f766e, #22c55e);
  transition: width 180ms ease;
}

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

.storage-stats div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.storage-stats span {
  color: var(--muted);
  font-size: 10px;
}

.storage-stats strong {
  color: var(--text);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.database-storage-error .storage-bar span {
  background: #ef4444;
}

#apiSettingsView button {
  height: 44px;
  min-height: 44px;
}

.top-actions button {
  height: 30px;
  min-height: 30px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 650;
}

.top-sync #syncBtn {
  min-width: 96px;
}

.top-actions #quitAppBtn {
  min-width: 44px;
  padding-inline: 8px;
}

.top-actions .top-site-link {
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 1px;
}

.top-actions .top-site-link.mondo-sync-link {
  width: 42px;
  min-width: 42px;
  padding: 2px 4px;
}

.api-test-results {
  display: grid;
  gap: 8px;
}

.api-test-results div {
  border: 1px solid #d9e6ef;
  border-radius: 7px;
  padding: 9px 10px;
  display: grid;
  gap: 3px;
  background: #f8fafc;
  font-size: 12px;
}

.api-test-results .ok {
  border-color: #b8e5c8;
  background: #f3fbf5;
}

.api-test-results .error {
  border-color: #f2c6c6;
  background: #fff7f7;
}

.automation-flow {
  display: grid;
  grid-template-columns: 1fr 22px 1fr 22px 1fr 22px 1fr 22px 1fr;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
}

.settings-operational-flow {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 7px;
  margin-bottom: 10px;
}

.settings-flow-card {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 3px 7px;
  min-height: 68px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #ffffff;
  padding: 8px;
}

.settings-flow-card span {
  grid-row: span 3;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #3153d7;
  color: #fff;
  font-weight: 800;
  font-size: 12px;
}

.settings-flow-card strong {
  font-size: 12px;
  line-height: 1.15;
}

.settings-flow-card small {
  min-height: 24px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.settings-flow-card b {
  color: #0f4fb6;
  font-size: 17px;
  line-height: 1;
}

.settings-flow-card.flow-send,
.settings-flow-card.flow-confirm {
  border-color: #f8d28b;
  background: #fffaf0;
}

.settings-flow-card.flow-sent,
.settings-flow-card.flow-work {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.settings-flow-card.flow-ship,
.settings-flow-card.flow-quote {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.automation-step {
  min-height: 76px;
  border: 1px solid #d7eee9;
  background: #f2fbf8;
  border-radius: 8px;
  padding: 10px;
  display: grid;
  align-content: center;
  gap: 4px;
}

.automation-step.automation-auto {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.automation-step.automation-manual {
  border-color: #fde68a;
  background: #fffbeb;
}

.automation-step select {
  min-height: 34px;
  font-size: 12px;
  padding: 7px 9px;
}

.automation-step strong {
  font-size: 13px;
}

.automation-step span {
  color: var(--muted);
  font-size: 11px;
}

.automation-flow i {
  width: 28px;
  height: 2px;
  background: var(--brand);
  position: relative;
}

.automation-flow i::after {
  content: "";
  position: absolute;
  right: -1px;
  top: -4px;
  border-left: 8px solid var(--brand);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}

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

.automation-settings label {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px;
}

.automation-settings label.automation-auto {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.automation-settings label.automation-manual {
  border-color: #fde68a;
  background: #fffbeb;
}

@keyframes orderAttentionPulse {
  0%, 100% {
    box-shadow: inset 3px 0 0 var(--action-color), 0 0 0 0 rgba(var(--action-rgb), 0.22);
    transform: scale(1);
  }
  50% {
    box-shadow: inset 3px 0 0 var(--action-color), 0 0 0 7px rgba(var(--action-rgb), 0.22);
    transform: scale(1.03);
  }
}

.order-action-blink {
  border: 1px solid var(--action-border);
  background: var(--action-bg);
  color: var(--action-text);
  animation: orderAttentionPulse 0.95s ease-in-out infinite;
}

.workflow-badge.workflow-received.order-action-blink,
.workflow-badge.workflow-offer.order-action-blink {
  --action-color: #d97706;
  --action-rgb: 217, 119, 6;
  --action-border: #facc15;
  --action-bg: #fef3c7;
  --action-text: #92400e;
}

.workflow-badge.workflow-sent.order-action-blink,
.workflow-badge.workflow-confirmed.order-action-blink,
.workflow-badge.workflow-production.order-action-blink {
  --action-color: #2563eb;
  --action-rgb: 37, 99, 235;
  --action-border: #bfdbfe;
  --action-bg: #dbeafe;
  --action-text: #1d4ed8;
}

.workflow-badge.workflow-shipped.order-action-blink {
  --action-color: #0284c7;
  --action-rgb: 2, 132, 199;
  --action-border: #bae6fd;
  --action-bg: #e0f2fe;
  --action-text: #0369a1;
}

.workflow-badge.workflow-completed.order-action-blink {
  --action-color: #15803d;
  --action-rgb: 21, 128, 61;
  --action-border: #bbf7d0;
  --action-bg: #dcfce7;
  --action-text: #166534;
}

dialog {
  width: min(860px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  padding: 0;
  overflow: auto;
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.42);
}

.dialog-head {
  position: sticky;
  top: 0;
  z-index: 8;
  min-height: 50px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
  background: #f2f7fc;
}

.dialog-head h2 {
  flex: 1;
}

.dialog-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.dialog-dot {
  width: 12px;
  height: 12px;
  min-width: 12px;
  min-height: 12px;
  border: 0;
  border-radius: 999px;
  padding: 0;
  line-height: 1;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
}

.dialog-dot.close {
  background: #ff5f57;
  box-shadow: inset 0 0 0 1px #e0443e;
}

.dialog-dot.min {
  background: #ffbd2e;
  box-shadow: inset 0 0 0 1px #dea123;
}

.dialog-dot.zoom {
  background: #28c840;
  box-shadow: inset 0 0 0 1px #1aad35;
}

.dialog-dot::before {
  color: rgba(0, 0, 0, 0.55);
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  opacity: 0;
}

.dialog-controls:hover .dialog-dot::before,
.dialog-dot:focus-visible::before {
  opacity: 1;
}

.dialog-dot.close::before {
  content: "×";
}

.dialog-dot.min::before {
  content: "−";
  transform: translateY(-2px);
}

.dialog-dot.zoom::before {
  content: "+";
  transform: translateY(-1px);
}

dialog.dialog-zoomed {
  width: calc(100vw - 48px);
  max-height: calc(100vh - 48px);
}

dialog.dialog-minimized {
  width: min(420px, calc(100vw - 48px));
}

dialog.dialog-minimized .dialog-head {
  border-bottom: 0;
}

dialog.dialog-minimized #orderDialogContent {
  display: none;
}

#orderDialogContent {
  padding: 16px;
  display: grid;
  gap: 14px;
}

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

.supplier-block {
  border: 1px solid #e6ecf3;
  border-radius: 7px;
  background: #ffffff;
  padding: 12px;
}

.order-progress-block {
  display: grid;
  gap: 12px;
}

.order-flow {
  display: grid;
  grid-template-columns: repeat(6, minmax(110px, 1fr));
  gap: 10px;
}

.order-flow-step {
  position: relative;
  min-height: 96px;
  border: 1px solid #e3e9f1;
  border-radius: 8px;
  background: #f8fafc;
  color: #64748b;
  padding: 12px 10px;
  display: grid;
  gap: 6px;
  align-content: start;
}

.order-flow-step:not(:last-child)::after {
  content: ">";
  position: absolute;
  right: -15px;
  top: 38px;
  color: #7a8798;
  font-weight: 800;
  z-index: 2;
}

.order-flow-step.active {
  border-color: #9bd7b0;
  background: #eefaf1;
  color: #166534;
}

.order-flow-step.current {
  border-color: #f2c46f;
  background: #fff8e8;
  color: #92400e;
}

.order-flow-index {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: #fff;
  border: 1px solid currentColor;
  font-weight: 800;
  font-size: 12px;
}

.order-flow-step strong {
  font-size: 13px;
  line-height: 1.2;
}

.order-flow-step small {
  color: inherit;
  opacity: 0.78;
  line-height: 1.25;
}

.order-history-block {
  display: grid;
  gap: 10px;
}

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

.order-history-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 0.8fr);
  gap: 12px;
  align-items: start;
  padding: 8px 10px;
  border: 1px solid #edf1f6;
  border-radius: 7px;
  background: #fff;
}

.order-history-row div {
  display: grid;
  gap: 4px;
}

.order-history-row span,
.order-history-row small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.order-history-row strong {
  font-size: 13px;
}

.empty-inline {
  color: var(--muted);
  padding: 8px 0;
}

.order-product-card {
  display: grid;
  gap: 12px;
}

.order-product-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

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

.detail-grid div,
.work-note {
  border: 1px solid #edf1f6;
  border-radius: 7px;
  padding: 9px;
  background: #fbfcfe;
}

.detail-grid span,
.work-note span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 4px;
}

.detail-grid strong,
.work-note strong {
  font-size: 13px;
  word-break: break-word;
}

/* MONDORETI - Tabella gestionale compatta */
.table-wrap {
  width: 100%;
  overflow: auto;
}

.compact-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 12px;
}

.compact-table th,
.compact-table td {
  border-bottom: 1px solid #edf1f6;
  padding: 5px 7px;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compact-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #eef3f9;
  color: #334155;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 10px;
  line-height: 1.2;
  font-weight: 650;
}

.compact-table th.draggable-column {
  cursor: grab;
  user-select: none;
}

.compact-table th.draggable-column::after {
  content: "⋮⋮";
  float: right;
  color: #94a3b8;
  font-size: 10px;
  margin-left: 6px;
}

.compact-table th.dragging-column {
  opacity: 0.55;
}

.compact-table th.column-drop-target {
  box-shadow: inset 3px 0 0 #3153d7;
  background: #eaf0ff;
}

.compact-table td {
  background: #fff;
  color: #263244;
  font-weight: 500;
}

.compact-table tbody tr:hover td,
.compact-table tbody tr.selected td {
  background: #f5f9ff;
}

.compact-table tbody tr.bulk-selected td {
  background: #eefdf8;
}

.compact-table tbody tr.compact-order-row {
  cursor: default;
}

.compact-table tbody tr.compact-order-row:hover td {
  background: #eef6ff;
}

.compact-table tbody tr.compact-order-row.selected td {
  background: #e6f1ff;
  box-shadow: inset 0 1px 0 #93c5fd, inset 0 -1px 0 #93c5fd;
}

.compact-table tbody tr.compact-order-row.selected td:first-child {
  box-shadow: inset 4px 0 0 #0f4fb6, inset 0 1px 0 #93c5fd, inset 0 -1px 0 #93c5fd;
}

.compact-table tbody tr.compact-order-row.bulk-selected td:first-child {
  box-shadow: inset 4px 0 0 #0f766e;
}

.compact-table .right,
.compact-table .money {
  text-align: right;
}

.compact-table .small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compact-table .order-code,
.compact-table .compact-code {
  color: #0f4fb6;
  font-weight: 800;
}

.compact-table .order-code {
  font-size: 15px;
  line-height: 1.1;
}

.compact-table .product-category {
  color: var(--ink);
  font-weight: 700;
}

.compact-table .customer {
  color: var(--ink);
  font-weight: 600;
}

.compact-table .tag {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  border: 1px solid #dbe3ef;
  border-radius: 7px;
  padding: 3px 6px;
  background: #f8fafc;
  color: #334155;
  font-size: 11px;
  font-weight: 600;
}

/* MONDORETI - Colonne strette ordini e fornitori */
.orders-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.orders-workspace.has-detail {
  grid-template-columns: minmax(720px, 1fr) minmax(340px, 380px);
}

.orders-workspace.detail-expanded {
  grid-template-columns: minmax(0, 1fr);
}

.orders-workspace.detail-expanded::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 23, 42, 0.34);
  pointer-events: none;
}

.orders-workspace.detail-expanded .order-detail-panel {
  position: fixed;
  top: 32px;
  left: 50%;
  z-index: 81;
  width: min(1180px, calc(100vw - 64px));
  max-height: calc(100vh - 64px);
  transform: translateX(-50%);
  border-color: #b9d8de;
  background: #eef8fa;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
}

.orders-total-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(105px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.orders-total-strip div {
  border: 1px solid #dde6f2;
  border-radius: 7px;
  padding: 10px 12px;
  background: #fff;
}

.orders-total-strip span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.orders-total-strip strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.1;
}

.orders-table {
  min-width: 1180px;
}

.orders-table .check-cell {
  width: 36px;
  text-align: center;
}

.orders-table .order-code-cell {
  width: 96px;
}

.orders-table .order-date-cell { width: 90px; }
.orders-table .order-customer-cell { width: 150px; }
.orders-table .order-product-cell { width: 150px; }
.orders-table .supplier-order-cell { width: 88px; }
.orders-table .order-woo-cell { width: 145px; }
.orders-table .progress-cell { width: 230px; }
.orders-table .order-supplier-status-cell { width: 150px; }
.orders-table .next-action-cell { width: 150px; }

.next-action-head,
.next-action-cell {
  text-align: left;
}

.next-action-cell {
  white-space: normal;
}

.compact-action {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 600;
}

.action-badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 22px;
  border: 1px solid #dbe3ef;
  border-radius: 999px;
  padding: 3px 8px;
  background: #f8fafc;
  color: #334155;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.1;
  white-space: nowrap;
}

.action-badge.action-todo {
  border-color: #ead48b;
  background: #fff8df;
  color: #7a560d;
}

.action-badge.action-waiting {
  border-color: #e8c5a5;
  background: #fff3e8;
  color: #8a4b19;
}

.action-badge.action-late {
  border-color: #e7b4ad;
  background: #fff1ef;
  color: #9d2f20;
}

.action-badge.action-neutral {
  border-color: #dbe3ef;
  background: #f8fafc;
  color: #64748b;
}

/* MONDORETI - Badge stati WooCommerce */
.state.woo-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  min-height: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
}

.state .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
}

.state.woo-completed { color: #15803d; }
.state.woo-processing,
.state.woo-hold { color: #475569; }
.state.woo-pending { color: #d97706; }
.state.woo-cancelled { color: #b91c1c; }
.state.woo-refunded { color: #64748b; }
.state.woo-draft { color: #64748b; }

/* MONDORETI - Avanzamento MondoReti */
.progress-cell {
  min-width: 0;
}

.progress-text {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #334155;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.progress-track {
  width: 180px;
  max-width: 100%;
  height: 7px;
  margin-top: 5px;
  border-radius: 999px;
  background: #e7ebf0;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #e7c65a 0%, #9fcb6d 55%, #3f9f68 100%);
}

.progress-fill.progress-blocked {
  background: linear-gradient(90deg, #94a3b8 0%, #64748b 100%);
}

.progress-fill.progress-check {
  background: linear-gradient(90deg, #cbd5e1 0%, #94a3b8 100%);
}

.progress-fill.progress-received,
.progress-fill.progress-sent {
  background: linear-gradient(90deg, #e3bd45 0%, #d4ad3a 48%, #8fb95d 100%);
}

.progress-fill.progress-offer,
.progress-fill.progress-confirmed {
  background: linear-gradient(90deg, #dcaa63 0%, #b8bd66 48%, #62a96d 100%);
}

.progress-fill.progress-production {
  background: linear-gradient(90deg, #c5b45d 0%, #7db66e 45%, #3f9f68 100%);
}

.progress-fill.progress-shipped,
.progress-fill.progress-completed {
  background: linear-gradient(90deg, #9fcb6d 0%, #4c9f67 45%, #247a4a 100%);
}

.supplier-state {
  color: #334155;
  font-weight: 600;
}

.supplier-order-plain {
  color: #334155;
  font-weight: 750;
}

.mondoreti-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #334155;
  font-weight: 600;
  line-height: 1.25;
}

/* MONDORETI - Dettaglio laterale ordine a comparsa */
.order-detail-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  max-height: calc(100vh - 170px);
  min-height: 0;
  overflow: hidden;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #f8fbff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.07);
}

.order-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid #edf1f6;
  background: #f8fbff;
}

.order-detail-header > div:first-child {
  min-width: 0;
}

.order-detail-header h3 {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.15;
}

.order-detail-header span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.order-detail-body {
  display: grid;
  gap: 12px;
  min-height: 0;
  overflow: auto;
  padding: 12px;
}

.order-detail-tools {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.order-detail-expand {
  border-color: #bfdbfe;
  color: #1d4ed8;
  background: #eff6ff;
}

.order-detail-close {
  flex: 0 0 auto;
}

.blocked-alert {
  border: 1px solid #fecaca;
  border-radius: 7px;
  padding: 9px;
  background: #fef2f2;
  color: #991b1b;
  font-weight: 650;
}

.detail-section {
  display: grid;
  gap: 8px;
}

.detail-section h4 {
  color: #334155;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
  font-weight: 650;
}

.order-detail-body > .detail-section:first-of-type {
  margin: -2px -2px 0;
  padding: 12px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
  box-shadow: 0 8px 18px rgba(154, 52, 18, 0.08);
}

.order-detail-body > .detail-section:first-of-type h4 {
  color: #9a3412;
}

.recommended-action {
  display: grid;
  gap: 8px;
  border: 1px solid #fb923c;
  border-radius: 7px;
  padding: 12px;
  background: #fffaf2;
  box-shadow:
    inset 4px 0 0 #f97316,
    0 1px 0 rgba(154, 52, 18, 0.05);
}

.recommended-action strong {
  color: #111827;
  font-size: 14px;
  font-weight: 700;
}

.recommended-action span {
  color: #475569;
  font-size: 12px;
  font-weight: 600;
}

.recommended-action .primary {
  border-color: #0f766e;
  background: #0f766e;
  color: #ffffff;
  box-shadow: 0 1px 0 rgba(15, 118, 110, 0.14);
}

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

.detail-section-grid div,
.detail-product-card {
  border: 1px solid #edf1f6;
  border-radius: 7px;
  padding: 8px;
  background: #ffffff;
}

.detail-section-grid span,
.detail-product-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.detail-section-grid strong,
.detail-product-card strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  word-break: break-word;
}

.expanded-order-data {
  border-top: 1px solid #edf1f6;
  padding-top: 4px;
}

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

.orders-workspace.detail-expanded .expanded-data-grid,
.orders-workspace.detail-expanded .economic-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.order-detail-products {
  display: grid;
  gap: 8px;
}

.compact-flow {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.compact-flow .order-flow-step {
  min-height: 0;
  padding: 8px;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 2px 7px;
}

.compact-flow .order-flow-step:not(:last-child)::after {
  content: none;
}

.compact-flow .order-flow-step.current {
  border-color: #16a34a;
  background: #f0fdf4;
  color: #166534;
}

.compact-flow .order-flow-step small {
  grid-column: 2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compact-history .order-history-row {
  padding: 7px 9px;
  gap: 4px;
}

.compact-history .order-history-row {
  grid-template-columns: 1fr;
}

.detail-actions {
  justify-content: flex-start;
  flex-wrap: nowrap;
  overflow-x: auto;
}

/* MONDORETI - Pagina Vendite */
.sales-table-wrap {
  margin-top: 2px;
}

.sales-table {
  min-width: 2020px;
}

.sales-table col.col-date { width: 72px; }
.sales-table col.col-order { width: 62px; }
.sales-table col.col-supplier-order { width: 82px; }
.sales-table col.col-client { width: 120px; }
.sales-table col.col-product { width: 150px; }
.sales-table col.col-state { width: 112px; }
.sales-table col.col-supplier-state { width: 124px; }
.sales-table col.col-money-main { width: 108px; }
.sales-table col.col-money { width: 98px; }
.sales-table col.col-margin { width: 74px; }

.sales-table .supplier-code {
  color: #334155;
  font-weight: 600;
}

/* MONDORETI - Gruppi colonne Vendite */
.sales-table thead tr.sales-groups th {
  top: 0;
  z-index: 4;
  padding: 5px 7px;
  text-align: center;
  color: #000;
  font-size: 10px;
  font-weight: 700;
  border-right: 1px solid rgba(255, 255, 255, 0.75);
}

.sales-table thead tr.sales-columns th {
  top: 25px;
  z-index: 3;
  background: #f8fafc;
  color: #000 !important;
  font-weight: 650;
}

.sales-table th,
.sales-table td {
  white-space: nowrap;
}

.sales-table td > span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sales-table .group-order { background: #e9eef7; }
.sales-table .group-main,
.sales-table .group-main-sale { background: #dff7e8; }
.sales-table .group-detail,
.sales-table .group-detail-sale { background: #fff3df; }
.sales-table .head-order { background: #f3f6fb !important; }
.sales-table .head-main-sale { background: #f0fdf4 !important; }
.sales-table .head-detail-sale { background: #fff8ed !important; }

/* MONDORETI - Valori economici ricavi/costi/margini */
.sales-table .value-sale-total,
.sales-table .value-cost-total,
.sales-table .value-revenue,
.economic-grid .strong-value strong {
  font-weight: 700;
}

.sales-table .value-cost-total,
.sales-table .value-cost-net,
.economic-grid .cost-value strong {
  color: #dc2626;
}

.sales-table .value-revenue,
.economic-grid .revenue-value strong {
  color: #15803d;
}

.sales-table .value-margin.good { color: #15803d; font-weight: 650; }
.sales-table .value-margin.mid { color: #d97706; font-weight: 650; }
.sales-table .value-margin.low { color: #dc2626; font-weight: 650; }

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  background: transparent;
  color: white;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
  width: min(620px, calc(100vw - 44px));
  max-width: min(620px, calc(100vw - 44px));
  z-index: 9999;
  display: grid;
  gap: 10px;
  word-break: break-word;
}

.toast-message {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 12px 42px 12px 14px;
  border-radius: 8px;
  background: #101820;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.22);
}

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

.toast-actions button,
.toast-close {
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 7px 10px;
  cursor: pointer;
}

.toast-actions button:hover,
.toast-close:hover {
  background: rgba(255, 255, 255, 0.18);
}

.toast-close {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 8px;
}

.hidden {
  display: none;
}

.shipping-table {
  display: grid;
  gap: 8px;
  overflow-x: auto;
}

.shipping-header,
.shipping-row {
  display: grid;
  grid-template-columns: 1.2fr 1.4fr 1.2fr 0.7fr 0.7fr 0.8fr 0.7fr 1.2fr;
  gap: 8px;
  align-items: center;
  min-width: 980px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.shipping-header {
  font-weight: 800;
  color: #475569;
  background: #f8fafc;
}

.shipment-header,
.shipment-row {
  grid-template-columns: 0.75fr 1.4fr 1.4fr 0.9fr 1fr 1fr minmax(150px, 0.75fr);
}

.shipment-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
}

.shipment-actions button {
  min-width: 0;
  padding-inline: 8px;
}

.shipment-row {
  cursor: pointer;
}

.shipment-row.selected {
  border-color: #bfdbfe;
  background: #f8fbff;
}

.shipment-detail-row {
  display: grid;
  gap: 12px;
  min-width: 980px;
  padding: 14px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #f8fbff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

.shipment-detail-row .order-history-list {
  display: grid;
  gap: 7px;
}

.shipment-detail-row .order-history-row {
  grid-template-columns: minmax(0, 1fr) minmax(150px, auto);
}

.shipping-table input,
.shipping-table select {
  width: 100%;
}

.shipping-table .empty-row {
  min-width: 0;
}

/* Densita gestionale compatta: form, pannelli e tabelle piu rapidi da scansionare. */
main {
  padding: 0 14px 14px;
}

.topbar {
  margin: 0 -14px 10px;
  padding: 11px 18px 8px 14px;
}

h1 {
  font-size: 20px;
}

h2 {
  font-size: 14px;
}

h3 {
  font-size: 13px;
}

.topbar p,
.muted,
label,
.sync-banner,
.metrics span,
.row-meta,
.detail-grid strong,
.work-note strong {
  font-size: 11.5px;
}

button,
.top-actions button,
.button-row button,
.quote-toolbar button,
.dashboard-chart-toolbar button,
.orders-quick-filters button,
.product-actions button,
.row-actions button,
.detail-actions button,
.shipment-actions button {
  min-height: 28px;
  padding: 5px 8px;
  font-size: 11.5px;
  border-radius: 6px;
}

.api-card .button-row button,
#apiSettingsView button {
  height: 34px;
  min-height: 34px;
  padding: 6px 10px;
}

input,
select,
textarea,
.dashboard-filters input,
.dashboard-filters select,
.orders-filters input,
.orders-filters select,
.filters input,
.filters select,
.settings-card input,
.settings-card select,
.settings-card textarea,
.api-card input,
.automation-step select,
.shipping-table input,
.shipping-table select {
  min-height: 32px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.2;
}

input,
select,
.dashboard-filters input,
.dashboard-filters select,
.orders-filters input,
.orders-filters select,
.filters input,
.filters select,
.settings-card input,
.settings-card select,
.api-card input,
.automation-step select,
.shipping-table input,
.shipping-table select {
  height: 32px;
}

textarea {
  min-height: 64px;
  line-height: 1.3;
}

label,
.form,
.stack,
.settings-form,
.settings-card,
.api-card,
.detail-panel,
.order-workflow-panel,
.shipment-detail-row {
  gap: 8px;
}

.grid-2,
.grid-3,
.grid-4,
.settings-card .grid-2,
.settings-card .grid-3,
.api-card .detail-grid,
.detail-grid,
.detail-section-grid,
.expanded-data-grid,
.economic-grid {
  gap: 8px;
}

.panel,
.settings-card,
.api-card,
.order-edit-card,
.detail-grid div,
.detail-section-grid div,
.work-note,
.toast-message,
.shipment-detail-row {
  padding: 10px;
}

.settings-card .panel-head {
  min-height: 36px;
  margin: -10px -10px 0;
  padding: 9px 10px;
}

.settings-card .panel-head h2 {
  font-size: 15px;
}

.settings-page-grid {
  gap: 12px;
}

.api-settings-grid {
  gap: 8px;
}

.metrics div {
  padding: 9px 10px;
}

.metrics strong,
.view-overview-card strong,
.costs-kpi strong {
  font-size: 20px;
}

.row,
.log-row,
.shipping-row,
.shipment-row,
.order-history-row {
  padding: 8px 10px;
  gap: 8px;
  border-radius: 7px;
}

.compact-table {
  font-size: 11.5px;
}

.compact-table th,
.compact-table td {
  padding: 4px 6px;
}

.compact-table .order-code {
  font-size: 13px;
}

.compact-table .tag,
.status-badge,
.workflow-badge,
.badge {
  padding: 2px 6px;
  font-size: 10.5px;
}

/* Densita extra leggibile: piu dati visibili senza perdere scansione e click comodi. */
body {
  font-size: 12.5px;
}

main {
  padding: 0 12px 12px;
}

.topbar {
  margin: 0 -12px 8px;
  padding: 9px 16px 7px 12px;
  gap: 8px;
}

h1 {
  font-size: 19px;
}

h2 {
  font-size: 13.5px;
}

h3 {
  font-size: 12.5px;
}

.topbar p,
.muted,
label,
.row-meta,
.sync-banner,
.metrics span,
.view-overview-card span,
.detail-grid span,
.detail-section-grid span,
.work-note span {
  font-size: 11px;
}

.sidebar {
  gap: 14px;
}

nav {
  gap: 3px;
}

.nav-item {
  height: 34px;
  min-height: 34px;
  padding: 6px 8px;
}

.nav-label {
  gap: 7px;
}

.nav-label i {
  width: 22px;
  font-size: 16px;
}

.nav-submenu {
  gap: 3px;
  padding-bottom: 3px;
}

.nav-submenu button {
  min-height: 24px;
  padding: 4px 7px;
  font-size: 10.5px;
}

button,
.top-actions button,
.button-row button,
.quote-toolbar button,
.dashboard-chart-toolbar button,
.orders-quick-filters button,
.product-actions button,
.row-actions button,
.detail-actions button,
.shipment-actions button {
  min-height: 26px;
  padding: 4px 8px;
}

input,
select,
.dashboard-filters input,
.dashboard-filters select,
.orders-filters input,
.orders-filters select,
.filters input,
.filters select,
.settings-card input,
.settings-card select,
.api-card input,
.automation-step select,
.shipping-table input,
.shipping-table select {
  height: 30px;
  min-height: 30px;
  padding: 5px 8px;
}

textarea,
.settings-card textarea {
  min-height: 56px;
  padding: 6px 8px;
}

.top-actions,
.button-row,
.quote-toolbar,
.form,
.stack,
.settings-form,
.settings-card,
.api-card,
.detail-panel,
.order-workflow-panel,
.shipment-detail-row,
.view-overview,
.dashboard-ops-grid,
.quotes-analysis-grid {
  gap: 8px;
}

.grid-2,
.grid-3,
.grid-4,
.settings-card .grid-2,
.settings-card .grid-3,
.detail-grid,
.detail-section-grid,
.expanded-data-grid,
.economic-grid,
.api-card .detail-grid {
  gap: 7px;
}

.panel,
.settings-card,
.api-card,
.order-edit-card,
.detail-grid div,
.detail-section-grid div,
.work-note,
.toast-message,
.shipment-detail-row {
  padding: 8px;
}

.panel-head {
  gap: 8px;
  margin-bottom: 8px;
}

.settings-card .panel-head {
  min-height: 32px;
  margin: -8px -8px 0;
  padding: 8px;
}

.settings-card .panel-head h2,
.api-card .panel-head h2 {
  font-size: 14px;
}

.metrics,
.dashboard-metrics,
.view-overview-grid,
.costs-kpis,
.product-kpis,
.quotes-kpis {
  gap: 8px;
}

.metrics div,
.view-overview-card,
.costs-kpi,
.product-kpi,
.quote-kpi {
  min-height: 58px;
  padding: 8px 10px;
}

.metrics strong,
.view-overview-card strong,
.costs-kpi strong,
.product-kpi strong,
.quote-kpi strong {
  font-size: 19px;
}

.row,
.log-row,
.shipping-row,
.shipment-row,
.order-history-row {
  padding: 7px 9px;
  gap: 7px;
}

.compact-table {
  font-size: 11px;
}

.compact-table th,
.compact-table td {
  padding: 3px 5px;
}

.compact-table .order-code {
  font-size: 12.5px;
}

.product-list-panel .products-filters {
  border-bottom: 1px solid #dbe3ef;
  margin: 0;
  padding: 8px;
}

.product-list-panel #productsNotice {
  margin: 6px 8px;
}

.product-list-panel .products-table-wrap {
  border: 0;
  border-radius: 0 0 8px 8px;
}

.api-card-required {
  border-left: 3px solid var(--brand);
}

.api-card-optional {
  border-left: 3px solid #94a3b8;
}

.api-instructions {
  margin: 8px 0 12px;
  padding: 9px 10px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  font-size: 13px;
  font-weight: 650;
}

.legacy-api-fields {
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  padding: 9px 10px 10px;
  background: #fbfdff;
}

.legacy-api-fields summary {
  cursor: pointer;
  color: #334155;
  font-weight: 750;
}

.legacy-api-fields label {
  margin-top: 8px;
}

.detail-grid strong,
.detail-section-grid strong,
.work-note strong {
  font-size: 12px;
}

.settings-page-grid,
.api-settings-grid {
  gap: 10px;
}

.shipping-page {
  display: grid;
  gap: 12px;
}

.shipping-page-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: -2px;
}

.shipping-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 10px;
}

.shipping-kpi-card {
  min-height: 62px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.035);
  display: grid;
  align-content: center;
  gap: 4px;
}

.shipping-kpi-card span {
  color: #64748b;
  font-size: 11.5px;
  font-weight: 750;
}

.shipping-kpi-card strong {
  font-size: 22px;
  line-height: 1;
}

.shipping-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 12px;
  align-items: start;
}

.shipping-list-panel,
.shipment-timeline-panel,
.shipping-rules-panel {
  padding: 0;
  overflow: hidden;
}

.shipping-list-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 0.9fr) minmax(360px, 1.1fr);
  gap: 10px;
  align-items: end;
  padding: 10px 12px;
  border-bottom: 1px solid #e5edf6;
  background: #fbfdff;
}

.shipping-list-toolbar h2 {
  font-size: 15px;
  margin-bottom: 2px;
}

.shipping-filters-inline {
  grid-template-columns: minmax(190px, 1fr) minmax(150px, 0.6fr);
  gap: 8px;
  margin: 0;
}

.shipping-orders-table {
  gap: 0;
}

.shipping-header,
.shipping-row {
  border-radius: 0;
  border-width: 0 0 1px;
  box-shadow: none;
}

.shipping-orders-table .shipment-header,
.shipping-orders-table .shipment-row {
  min-width: 0;
  grid-template-columns: 70px 90px 105px 95px 110px 125px 90px minmax(120px, 1fr);
}

.shipping-orders-table .shipment-header {
  padding: 9px 12px;
  background: #eef3f9;
  color: #334155;
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: 0.02em;
}

.shipping-orders-table .shipment-row {
  min-height: 46px;
  padding: 8px 12px;
  font-size: 12px;
  background: #ffffff;
}

.shipping-orders-table .shipment-row.selected {
  background: #eef6ff;
  border-color: #dbeafe;
}

.shipment-order-code {
  color: #2563eb;
  font-weight: 850;
}

.shipment-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.shipment-pill.green {
  color: #15803d;
  border: 1px solid #bbf7d0;
  background: #dcfce7;
}

.shipment-pill.blue {
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  background: #dbeafe;
}

.shipment-pill.orange {
  color: #b45309;
  border: 1px solid #fed7aa;
  background: #ffedd5;
}

.shipment-timeline-panel {
  display: grid;
  align-content: start;
}

.shipment-timeline-panel .detail-side-header {
  padding: 13px 14px;
  border-bottom: 1px solid #e5edf6;
  background: #fbfdff;
}

.shipment-timeline-panel .detail-side-header h2 {
  font-size: 17px;
}

.shipping-timeline-mini {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.shipping-timeline-item {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid #e7edf5;
  border-radius: 8px;
  background: #ffffff;
  font-size: 12px;
}

.shipping-timeline-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #94a3b8;
}

.shipping-timeline-dot.green { background: #16a34a; }
.shipping-timeline-dot.blue { background: #2563eb; }
.shipping-timeline-dot.orange { background: #f59e0b; }
.shipping-timeline-dot.muted { background: #94a3b8; }

.shipment-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0 14px 12px;
}

.shipment-detail-save {
  width: calc(100% - 28px);
  margin: 0 14px 14px;
}

.shipping-rules-panel {
  padding: 10px;
}

.shipping-rules-panel .panel-head {
  margin-bottom: 8px;
}

.shipping-rules-panel .shipping-table {
  max-height: 260px;
}

@media (max-width: 1180px) {
  .shipping-main-grid {
    grid-template-columns: 1fr;
  }

  .shipping-kpis {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }
}

@media (max-width: 1100px) {
  .topbar {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .top-actions {
    justify-content: start;
    flex-wrap: wrap;
    width: 100%;
    min-width: 0;
  }

  .top-actions button {
    flex: 1 1 190px;
  }

  .top-sync {
    flex: 0 0 auto;
  }

  .top-actions #quitAppBtn {
    flex: 0 0 auto;
  }

  .split, .split.wide-left, .metrics, .dashboard-metrics, .dashboard-ops-grid, .costs-kpis, .view-overview-grid, .settings-operational-flow {
    grid-template-columns: 1fr;
  }

  .orders-workspace.has-detail {
    grid-template-columns: 1fr;
  }

  .orders-command-bar,
  .orders-sync-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .orders-sync-tools .muted {
    max-width: none;
    white-space: normal;
  }

  .orders-workspace.detail-expanded {
    grid-template-columns: 1fr;
  }

  .orders-workspace.detail-expanded .order-detail-panel {
    top: 12px;
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
  }

  .order-detail-panel {
    max-height: none;
  }

  .dashboard-charts,
    .orders-total-strip,
    .order-legend,
    .grid-4,
    .detail-section-grid,
    .automation-flow,
    .order-flow,
    .automation-settings {
      grid-template-columns: 1fr;
    }

    .order-row {
      grid-template-columns: minmax(0, 1fr);
    }

    .order-total-cell {
      justify-items: start;
      min-width: 0;
    }

    .order-flow-step:not(:last-child)::after {
      content: none;
    }

  .automation-flow i {
    width: 2px;
    height: 22px;
    justify-self: center;
  }

  .automation-flow i::after {
    right: -4px;
    top: auto;
    bottom: -2px;
    border-top: 8px solid var(--brand);
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 0;
  }

  .sidebar {
    width: 196px;
    min-width: 196px;
  }
}

@media (max-width: 760px) {
  html,
  body {
    height: auto;
    min-height: 100%;
    overflow: auto;
  }

  body {
    display: block;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    min-width: 0;
    height: auto;
    max-height: 46vh;
    padding: 10px;
    gap: 10px;
    border-bottom: 1px solid #243444;
  }

  .sidebar-footer {
    position: static;
  }

  .brand {
    width: 260px;
    flex: 0 0 auto;
    padding: 0 2px 6px;
  }

  .brand-logo {
    width: 40px;
    height: 40px;
  }

  nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
  }

  .nav-item {
    flex: 0 0 auto;
    min-width: max-content;
    padding: 9px 11px;
  }

  .nav-submenu.open {
    display: flex;
    overflow-x: auto;
    padding: 0 0 2px;
  }

  .nav-submenu button {
    flex: 0 0 auto;
    min-width: max-content;
  }

  .sync-card {
    display: none;
  }

  main {
    height: auto;
    min-height: 100vh;
    padding: 0 12px 20px;
    overflow: visible;
  }

  .topbar {
    position: static;
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
    margin: 0 -12px 12px;
    padding: 14px 12px;
    gap: 12px;
  }

  .sync-banner {
    width: 100%;
    justify-self: stretch;
  }

  h1 {
    font-size: 21px;
  }

  .top-actions,
  .button-row,
  .quote-toolbar {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

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

  .detail-side-panel {
    position: static;
  }

  .quote-item-options {
    grid-template-columns: 1fr;
  }

  .top-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  .top-sync {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px;
    gap: 7px;
  }

  .top-actions button,
  .button-row button,
  .quote-toolbar button {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .top-actions button {
    width: 100%;
    white-space: normal;
  }

  .top-actions .top-sync {
    width: 100%;
  }

  .product-page-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-page-actions button {
    width: 100%;
  }

  .product-list-panel {
    padding: 0;
  }

  .product-list-panel .products-filters {
    grid-template-columns: 1fr;
  }

  .top-actions #syncBtn,
  .top-actions .top-sync,
  .top-actions #quitAppBtn {
    grid-column: span 1;
  }

  .sync-banner {
    align-items: flex-start;
    flex-wrap: wrap;
    line-height: 1.35;
  }

  .metrics,
  .dashboard-metrics,
  .dashboard-charts,
  .quotes-kpis,
  .product-kpis,
  .quotes-analysis-grid,
  .quote-total-grid,
  .settings-page-grid,
  .api-settings-grid,
  .storage-stats,
  .orders-filters,
  .grid-2,
  .grid-3,
  .grid-4,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .metrics strong {
    font-size: 25px;
    overflow-wrap: anywhere;
  }

  .panel {
    padding: 14px;
  }

  .panel-head,
  .dashboard-chart-toolbar,
  .cost-total-row,
  .order-product-title {
    display: grid;
    align-items: start;
  }

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

  .row,
  .input-action,
  .order-history-row {
    grid-template-columns: 1fr;
  }

  .table,
  .shipping-table {
    overflow-x: auto;
  }

  .toast {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
  }
}

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

  .top-actions #syncBtn,
  .top-actions .top-sync,
  .top-actions #quitAppBtn {
    grid-column: auto;
  }

  .order-action-summary {
    grid-template-columns: 1fr;
  }

}
