/* Reception IA Pro - interface 2026.07
   Couche visuelle unique chargee apres les styles historiques. */

body.ui-revolution {
  --app-bg: #f4f6f8;
  --surface: #ffffff;
  --surface-soft: #f8fafb;
  --surface-strong: #edf1f4;
  --ink: #17212b;
  --ink-soft: #344252;
  --muted: #586a7b;
  --muted-strong: #405164;
  --line: #dce2e7;
  --line-strong: #c5ced6;
  --primary-soft: #e1f3f1;
  --coral: #c74432;
  --coral-soft: #fff0ec;
  --amber: #b9750b;
  --amber-soft: #fff5d8;
  --green: #167a55;
  --green-soft: #e4f5ed;
  --blue: #2d6cdf;
  --blue-soft: #eaf0ff;
  --danger: #c53b3b;
  --danger-soft: #fdecec;
  --trade-accent: #176b72;
  --trade-soft: #e1f3f1;
  --sidebar-width: 248px;
  --topbar-height: 76px;
  margin: 0;
  color: var(--ink);
  background: var(--app-bg);
  font-family: "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  letter-spacing: 0;
}

body.ui-revolution.trade-plumber { --trade-accent: #08766f; --trade-soft: #dff6f2; }
body.ui-revolution.trade-electrician { --trade-accent: #2d6cdf; --trade-soft: #eaf0ff; }
body.ui-revolution.trade-painter { --trade-accent: #a83363; --trade-soft: #fbe8f0; }
body.ui-revolution.trade-btp { --trade-accent: #99570d; --trade-soft: #fff0d8; }
body.ui-revolution.sector-bakery { --trade-accent: #a65a06; --trade-soft: #fff0d8; }
body.ui-revolution.sector-bar { --trade-accent: #167a55; --trade-soft: #e4f5ed; }
body.ui-revolution.sector-salon { --trade-accent: #a83363; --trade-soft: #fbe8f0; }

body.ui-revolution *,
body.ui-revolution *::before,
body.ui-revolution *::after {
  box-sizing: border-box;
}

body.ui-revolution h1,
body.ui-revolution h2,
body.ui-revolution h3,
body.ui-revolution p {
  letter-spacing: 0;
}

body.ui-revolution .layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
  background: var(--app-bg);
}

/* Sidebar */
body.ui-revolution .sidebar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  height: 100vh;
  padding: 18px 14px 14px;
  overflow: hidden;
  color: var(--ink);
  background: #fbfcfd;
  border-right: 1px solid var(--line);
  box-shadow: none;
}

body.ui-revolution .brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  margin: 0 4px 18px;
}

body.ui-revolution .brand-mark {
  display: block;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  padding: 0;
  overflow: hidden;
  background: transparent;
  border: 0;
  border-radius: 8px;
  box-shadow: none;
}

body.ui-revolution .brand-logo {
  display: block;
  width: 40px;
  height: 40px;
}

body.ui-revolution .brand > div:last-child {
  display: grid;
  min-width: 0;
  line-height: 1.1;
}

body.ui-revolution .brand strong {
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 800;
}

body.ui-revolution .brand strong span {
  margin-left: 2px;
  color: var(--coral);
}

body.ui-revolution .brand > div:last-child > span {
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.ui-revolution .sidebar > .field {
  gap: 5px;
  margin: 0 2px 10px;
}

body.ui-revolution .installer-details {
  margin: 6px 2px 0;
  color: var(--ink-soft);
  background: var(--surface-strong);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
}

body.ui-revolution .installer-details > summary {
  padding: 9px 10px;
  color: var(--ink-soft);
  background: var(--surface-strong);
  font-size: 0.7rem;
  font-weight: 750;
}

body.ui-revolution .installer-details[open] { padding-bottom: 8px; }
body.ui-revolution .installer-details[open] > summary { margin-bottom: 8px; border-bottom: 1px solid var(--line); }
body.ui-revolution .installer-details .field,
body.ui-revolution .installer-details .nav-btn { margin-inline: 8px; }
body.ui-revolution .installer-details .nav-btn { width: calc(100% - 16px); color: var(--ink-soft); background: #fff; border-color: var(--line); }

body.ui-revolution .sidebar > .field > span {
  color: var(--muted-strong);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

body.ui-revolution .sidebar select {
  min-height: 39px;
  padding: 0 32px 0 11px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  font-size: 0.84rem;
  font-weight: 700;
}

body.ui-revolution .onboarding-open-btn,
body.ui-revolution .logout-btn {
  min-height: 38px;
  margin: 0 2px 10px;
  justify-content: flex-start;
  color: var(--ink-soft);
  background: var(--surface);
  border-color: var(--line);
  box-shadow: none;
}

body.ui-revolution .sidebar-create-shell {
  position: relative;
  margin: 1px 2px 12px;
}

body.ui-revolution .sidebar-create-btn {
  display: grid;
  grid-template-columns: 18px 1fr 14px;
  align-items: center;
  width: 100%;
  min-height: 40px;
  padding: 0 11px;
  color: #fff;
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 7px;
  box-shadow: none;
}

body.ui-revolution .sidebar-create-btn:hover {
  color: #fff;
  background: #24313d;
  border-color: #24313d;
  transform: none;
}

body.ui-revolution .sidebar-create-btn svg {
  width: 17px;
  height: 17px;
  padding: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

body.ui-revolution .sidebar-create-btn .create-chevron {
  width: 13px;
  height: 13px;
  transition: transform 160ms ease;
}

body.ui-revolution .sidebar-create-btn[aria-expanded="true"] .create-chevron {
  transform: rotate(90deg);
}

body.ui-revolution .global-create-menu {
  position: absolute;
  top: 46px;
  left: 0;
  z-index: 90;
  display: grid;
  width: 286px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: 0 18px 40px rgba(23, 33, 43, 0.16);
}

body.ui-revolution .global-create-menu.hidden {
  display: none;
}

body.ui-revolution .global-create-menu button {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px;
  color: var(--ink);
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

body.ui-revolution .global-create-menu button:hover {
  background: var(--surface-strong);
}

body.ui-revolution .global-create-menu button > svg {
  width: 32px;
  height: 32px;
  padding: 7px;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 6px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

body.ui-revolution .global-create-menu button > span {
  display: grid;
  gap: 2px;
}

body.ui-revolution .global-create-menu strong {
  font-size: 0.82rem;
}

body.ui-revolution .global-create-menu small {
  color: var(--muted);
  font-size: 0.7rem;
}

body.ui-revolution .nav {
  display: block;
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 1px 12px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
}

body.ui-revolution .nav-group-label {
  margin: 15px 10px 5px;
  color: #5c6e7f;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

body.ui-revolution .nav-group-label:first-child {
  margin-top: 2px;
}

body.ui-revolution .nav-btn {
  position: relative;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  width: 100%;
  min-height: 38px;
  margin: 2px 0;
  padding: 0 10px;
  color: #4a5968;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 0.82rem;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
}

body.ui-revolution .nav-btn:hover {
  color: var(--ink);
  background: #eef2f4;
  border-color: transparent;
}

body.ui-revolution .nav-btn.active {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
  box-shadow: none;
}

body.ui-revolution .nav-btn.active::after {
  position: absolute;
  top: 9px;
  right: 7px;
  width: 3px;
  height: 18px;
  background: var(--trade-accent);
  border-radius: 3px;
  content: "";
}

body.ui-revolution .nav-icon {
  width: 17px;
  height: 17px;
  padding: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

body.ui-revolution .nav-btn[data-tab="production"] .nav-icon,
body.ui-revolution .nav-btn[data-tab="inventory"] .nav-icon {
  color: var(--trade-accent);
}

body.ui-revolution .nav-btn.active .nav-icon {
  color: #fff;
  stroke: #fff;
}

body.ui-revolution .sidebar-card {
  display: grid;
  gap: 3px;
  margin: auto 2px 0;
  padding: 10px 11px;
  color: var(--ink-soft);
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: none;
}

body.ui-revolution .sidebar-card strong { font-size: 0.76rem; }
body.ui-revolution .sidebar-card strong { color: var(--ink); }
body.ui-revolution .sidebar-card span,
body.ui-revolution .sidebar-card p { margin: 0; color: var(--muted); font-size: 0.66rem; }

/* Main and top command bar */
body.ui-revolution main {
  min-width: 0;
  height: 100vh;
  padding: 0 22px 18px;
  overflow: hidden;
  background: var(--app-bg);
}

body.ui-revolution .topbar {
  position: relative;
  z-index: 35;
  display: grid;
  grid-template-columns: minmax(250px, 1fr) minmax(250px, 420px) auto;
  align-items: center;
  gap: 18px;
  min-height: var(--topbar-height);
  margin: 0 -22px 14px;
  padding: 11px 22px;
  background: rgba(244, 246, 248, 0.98);
  border-bottom: 1px solid var(--line);
  backdrop-filter: none;
}

body.ui-revolution .topbar-title {
  min-width: 0;
}

body.ui-revolution .topbar .eyebrow {
  display: block;
  margin: 0 0 2px;
  color: var(--trade-accent);
  background: transparent;
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

body.ui-revolution .topbar h1 {
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 1.28rem;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.ui-revolution .topbar p:last-child {
  display: none;
}

body.ui-revolution .global-command-shell {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 11px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
}

body.ui-revolution .global-command-shell > svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
}

body.ui-revolution .global-command-shell input {
  width: 100%;
  min-height: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 0.8rem;
}

body.ui-revolution .global-command-menu {
  position: absolute;
  top: 46px;
  left: 0;
  z-index: 100;
  display: grid;
  width: 100%;
  max-height: 360px;
  padding: 6px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(23, 33, 43, 0.18);
}

body.ui-revolution .global-command-menu.hidden { display: none; }

body.ui-revolution .global-command-menu button {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  padding: 5px 7px;
  color: var(--ink);
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

body.ui-revolution .global-command-menu button:hover,
body.ui-revolution .global-command-menu button.active {
  background: var(--surface-strong);
}

body.ui-revolution .global-command-menu button > svg {
  width: 30px;
  height: 30px;
  padding: 7px;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 6px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

body.ui-revolution .global-command-menu button span { display: grid; gap: 1px; }
body.ui-revolution .global-command-menu button strong { font-size: 0.78rem; }
body.ui-revolution .global-command-menu button small { color: var(--muted); font-size: 0.68rem; }
body.ui-revolution .global-command-menu button > em { color: var(--muted); font-size: 0.66rem; font-style: normal; }

body.ui-revolution .topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  min-width: 0;
}

body.ui-revolution .autopilot-status {
  display: grid;
  grid-template-columns: 8px auto auto;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 10px;
  color: var(--ink-soft);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 0.7rem;
  cursor: pointer;
}

body.ui-revolution .autopilot-status strong {
  color: var(--green);
  font-size: 0.68rem;
}

body.ui-revolution .autopilot-status strong.attention { color: #a25208; }

body.ui-revolution .status-pulse,
body.ui-revolution .live-indicator i {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: #24a36f;
  border-radius: 50%;
  box-shadow: 0 0 0 3px #dff4ea;
}

body.ui-revolution .topbar-icon-btn,
body.ui-revolution .topbar .btn {
  min-height: 36px;
  height: 36px;
  padding: 0 10px;
  color: var(--ink-soft);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: none;
}

body.ui-revolution .topbar-icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  padding: 0;
}

body.ui-revolution .topbar-icon-btn svg,
body.ui-revolution .topbar .btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

body.ui-revolution .notification-count {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  place-items: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  color: #fff;
  background: var(--coral);
  border: 2px solid var(--app-bg);
  border-radius: 9px;
  font-size: 0.58rem;
  font-weight: 800;
}

body.ui-revolution .notification-count.hidden { display: none; }

/* Shared UI primitives */
body.ui-revolution .btn {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 7px;
  font-size: 0.78rem;
  font-weight: 700;
  box-shadow: none;
}

body.ui-revolution .btn:hover { transform: none; }

body.ui-revolution .btn.primary {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: none;
}

body.ui-revolution .btn.primary:hover {
  color: #fff;
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

body.ui-revolution .btn.secondary {
  color: var(--ink-soft);
  background: #fff;
  border-color: var(--line-strong);
}

body.ui-revolution .btn.ghost {
  color: var(--primary-dark);
  background: transparent;
  border-color: #b5d7d4;
}

body.ui-revolution .btn.danger { color: #fff; background: var(--danger); border-color: var(--danger); }
body.ui-revolution .btn.success { color: #fff; background: var(--green); border-color: var(--green); }

body.ui-revolution .btn svg,
body.ui-revolution .icon-action svg,
body.ui-revolution .head-icon {
  width: 16px;
  height: 16px;
  padding: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.ui-revolution input,
body.ui-revolution select,
body.ui-revolution textarea {
  min-height: 38px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  font: inherit;
  font-size: 0.8rem;
  box-shadow: none;
}

body.ui-revolution input:focus,
body.ui-revolution select:focus,
body.ui-revolution textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 107, 114, 0.12);
  outline: 0;
}

body.ui-revolution .field > span {
  color: var(--muted-strong);
  font-size: 0.7rem;
  font-weight: 700;
}

body.ui-revolution .badge {
  min-height: 22px;
  padding: 3px 7px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 0.64rem;
  font-weight: 750;
}

body.ui-revolution .badge.ok { color: #0c6443; background: var(--green-soft); border-color: #b9e2ce; }
body.ui-revolution .badge.warn { color: #815407; background: var(--amber-soft); border-color: #efd998; }
body.ui-revolution .badge.danger { color: #a52f2f; background: var(--danger-soft); border-color: #efc3c3; }
body.ui-revolution .badge.info { color: #2857aa; background: var(--blue-soft); border-color: #c8d7fa; }
body.ui-revolution .item-head .badge.ok { color: #0c6443; }
body.ui-revolution .item-head .badge.warn { color: #815407; }
body.ui-revolution .item-head .badge.danger { color: #a52f2f; }
body.ui-revolution .item-head .badge.info { color: #2857aa; }

body.ui-revolution .panel {
  padding: 15px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: none;
}

body.ui-revolution .panel-head {
  min-height: 32px;
  margin: 0 0 11px;
}

body.ui-revolution .panel-head h2 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--ink);
  font-size: 0.96rem;
  font-weight: 750;
}

body.ui-revolution .panel-head .eyebrow,
body.ui-revolution .page-dashboard-strip .eyebrow {
  margin: 0 0 3px;
  color: var(--trade-accent);
  background: transparent;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

body.ui-revolution .empty {
  padding: 18px 12px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px dashed var(--line-strong);
  border-radius: 7px;
  font-size: 0.76rem;
  text-align: center;
}

body.ui-revolution .alert {
  margin: 0 0 12px;
  padding: 10px 12px;
  color: #8d2929;
  background: var(--danger-soft);
  border: 1px solid #efc3c3;
  border-radius: 7px;
}

/* Page canvas */
body.ui-revolution .tab-panel.active {
  min-height: 0;
  padding: 0 3px 16px 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #b8c3cc transparent;
}

body.ui-revolution .tab-panel[data-panel="overview"].active {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 13px;
  height: calc(100vh - var(--topbar-height) - 16px);
  overflow-y: auto;
}

body.ui-revolution .automation-ribbon {
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) minmax(360px, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 58px;
  padding: 9px 12px;
  background: #fff;
  border: 1px solid #cfe4e1;
  border-left: 4px solid var(--primary);
  border-radius: 8px;
}

body.ui-revolution .automation-ribbon-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

body.ui-revolution .automation-ribbon-icon {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 7px;
}

body.ui-revolution .automation-ribbon-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

body.ui-revolution .automation-ribbon-main > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

body.ui-revolution .automation-ribbon-main strong { font-size: 0.8rem; }
body.ui-revolution .automation-ribbon-main span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.69rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.ui-revolution .automation-ribbon-metrics {
  display: flex;
  justify-content: center;
  gap: 5px;
}

body.ui-revolution .automation-ribbon-metrics > span {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-height: 30px;
  padding: 6px 8px;
  color: var(--muted-strong);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.65rem;
  white-space: nowrap;
}

body.ui-revolution .automation-ribbon-metrics strong { color: var(--ink); font-size: 0.78rem; }
body.ui-revolution .automation-ribbon-metrics .attention strong { color: var(--coral); }

body.ui-revolution .pilotage-panel {
  padding: 0;
  overflow: visible;
  background: transparent;
  border: 0;
}

body.ui-revolution .pilotage-panel > .panel-head {
  margin: 0 1px 8px;
}

body.ui-revolution .live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.66rem;
}

body.ui-revolution .pilotage-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 108px;
  gap: 10px;
}

body.ui-revolution .pilotage-tile {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  min-width: 0;
  min-height: 0;
  height: 108px;
  padding: 10px;
  overflow: hidden;
  color: var(--ink);
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: none;
}

body.ui-revolution button.pilotage-tile { cursor: pointer; }
body.ui-revolution button.pilotage-tile:hover { border-color: var(--line-strong); background: #fff; transform: none; }

body.ui-revolution .pilotage-tile::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--tile-accent, var(--trade-accent));
  content: "";
}

body.ui-revolution .pilotage-tile:nth-child(1) { --tile-accent: var(--trade-accent); --tile-soft: var(--trade-soft); }
body.ui-revolution .pilotage-tile:nth-child(2) { --tile-accent: var(--green); --tile-soft: var(--green-soft); }
body.ui-revolution .pilotage-tile:nth-child(3) { --tile-accent: var(--amber); --tile-soft: var(--amber-soft); }
body.ui-revolution .pilotage-tile:nth-child(4) { --tile-accent: var(--blue); --tile-soft: var(--blue-soft); }
body.ui-revolution .pilotage-tile.warn { --tile-accent: var(--amber); --tile-soft: var(--amber-soft); }
body.ui-revolution .pilotage-tile.danger { --tile-accent: var(--danger); --tile-soft: var(--danger-soft); }

body.ui-revolution .pilotage-tile > svg {
  grid-row: 1;
  width: 38px;
  height: 38px;
  padding: 9px;
  color: var(--tile-accent, var(--trade-accent));
  background: var(--tile-soft, var(--trade-soft));
  border-radius: 7px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

body.ui-revolution .pilotage-tile > div {
  display: grid;
  align-content: start;
  gap: 3px;
  min-width: 0;
}

body.ui-revolution .pilotage-tile small {
  color: var(--muted-strong);
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
}

body.ui-revolution .pilotage-tile strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 760;
  line-height: 1.15;
  text-overflow: ellipsis;
}

body.ui-revolution .pilotage-tile span {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

body.ui-revolution .pilotage-tile > div:not(.kpi-foot) > span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.ui-revolution .kpi-foot {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 14px;
  margin-top: 0;
  color: var(--muted);
  font-size: 0.62rem;
}

body.ui-revolution .kpi-foot b { color: var(--tile-accent, var(--trade-accent)); }
body.ui-revolution .kpi-foot span {
  display: block;
  overflow: hidden;
  font-size: 0.6rem;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.ui-revolution .business-flow-shell {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  margin-top: 10px;
  padding: 9px 11px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

body.ui-revolution .business-flow-head {
  display: grid;
  gap: 2px;
  min-width: 150px;
}

body.ui-revolution .business-flow-head strong {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 0.7rem;
}

body.ui-revolution .business-flow-head > span {
  width: max-content;
  padding: 2px 6px;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 5px;
  font-size: 0.6rem;
  font-weight: 750;
}

body.ui-revolution .business-flow-head > span.warn { color: #815407; background: var(--amber-soft); }

body.ui-revolution .business-flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(82px, 1fr));
  gap: 5px;
}

body.ui-revolution .business-flow-step {
  position: relative;
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 39px;
  padding: 5px 7px;
  color: var(--ink-soft);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
}

body.ui-revolution .business-flow-step.active { background: var(--blue-soft); border-color: #c7d6f7; }
body.ui-revolution .business-flow-step.warn { background: var(--amber-soft); border-color: #ead492; }

body.ui-revolution .business-flow-icon {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  color: var(--blue);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 5px;
}

body.ui-revolution .business-flow-icon svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
body.ui-revolution .business-flow-step > span:nth-child(2) { display: grid; }
body.ui-revolution .business-flow-step small { color: var(--muted); font-size: 0.58rem; }
body.ui-revolution .business-flow-step strong { color: var(--ink); font-size: 0.78rem; }
body.ui-revolution .business-flow-step i { display: none; }

body.ui-revolution .today-command-shell {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

body.ui-revolution .today-command-head {
  min-height: 28px;
  padding: 0 1px;
  background: transparent;
  border: 0;
}

body.ui-revolution .today-command-head h2 {
  color: var(--ink);
  font-size: 0.92rem;
}

body.ui-revolution .today-command-grid,
body.ui-revolution .home-command-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 0;
}

body.ui-revolution .home-command {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  justify-items: start;
  gap: 1px 8px;
  min-width: 0;
  min-height: 58px;
  padding: 9px 10px;
  color: var(--ink);
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: none;
}

body.ui-revolution .home-command:hover { background: var(--surface-soft); border-color: var(--line-strong); transform: none; }

body.ui-revolution .home-command svg {
  grid-row: 1 / 3;
  width: 34px;
  height: 34px;
  padding: 8px;
  box-sizing: border-box;
  color: var(--blue);
  background: var(--blue-soft);
  border-radius: 7px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

body.ui-revolution .home-command:nth-child(4n + 2) svg { color: var(--amber); background: var(--amber-soft); }
body.ui-revolution .home-command:nth-child(4n + 3) svg { color: var(--green); background: var(--green-soft); }
body.ui-revolution .home-command:nth-child(4n + 4) svg { color: var(--coral); background: var(--coral-soft); }
body.ui-revolution .home-command.primary { color: var(--ink); background: var(--trade-soft); border-color: color-mix(in srgb, var(--trade-accent) 35%, #fff); }
body.ui-revolution .home-command.primary svg { color: var(--trade-accent); background: #fff; }
body.ui-revolution .home-command.danger { color: var(--ink); background: var(--danger-soft); border-color: #efc3c3; }
body.ui-revolution .home-command.danger svg { color: var(--danger); background: #fff; }
body.ui-revolution .home-command strong { grid-column: 2; color: var(--ink); font-size: 0.75rem; line-height: 1.2; }
body.ui-revolution .home-command span { grid-column: 2; overflow: hidden; color: var(--muted); font-size: 0.64rem; text-overflow: ellipsis; white-space: nowrap; }

body.ui-revolution .overview-action-strip {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.9fr);
  gap: 10px;
  min-height: 0;
}

body.ui-revolution .priority-panel,
body.ui-revolution .validation-panel {
  min-height: 170px;
  overflow: hidden;
}

body.ui-revolution .action-queue,
body.ui-revolution .validation-list,
body.ui-revolution .card-list,
body.ui-revolution .billing-list {
  display: grid;
  gap: 6px;
}

body.ui-revolution .action-item,
body.ui-revolution .validation-card,
body.ui-revolution .item-card,
body.ui-revolution .billing-card {
  padding: 9px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: none;
}

body.ui-revolution .action-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

body.ui-revolution .action-item > div { display: grid; gap: 2px; min-width: 0; }
body.ui-revolution .action-item strong { font-size: 0.75rem; }
body.ui-revolution .action-item span { overflow: hidden; color: var(--muted); font-size: 0.68rem; text-overflow: ellipsis; white-space: nowrap; }

body.ui-revolution .validation-card .item-head strong { font-size: 0.75rem; }
body.ui-revolution .validation-card .item-head span,
body.ui-revolution .validation-card .item-head small { color: var(--muted); font-size: 0.65rem; }
body.ui-revolution .validation-card .payload-details { margin-top: 5px; }
body.ui-revolution .validation-card .payload-details summary { color: var(--muted); font-size: 0.64rem; }
body.ui-revolution .validation-card .item-actions { margin-top: 7px; }

/* Page headers and operational pages */
body.ui-revolution .page-dashboard-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 74px;
  margin: 0 0 12px;
  padding: 10px 2px 12px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}

body.ui-revolution .page-dashboard-strip h2 {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 1.12rem;
}

body.ui-revolution .page-dashboard-strip p:last-child {
  max-width: 700px;
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
}

body.ui-revolution .page-hero-actions,
body.ui-revolution .toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

body.ui-revolution .page-menu-tiles {
  display: none;
}

body.ui-revolution .prod-subnav,
body.ui-revolution .stock-subnav {
  display: flex;
  align-items: center;
  gap: 3px;
  width: max-content;
  max-width: 100%;
  margin: 0 0 11px;
  padding: 3px;
  overflow-x: auto;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 7px;
}

body.ui-revolution .prod-subtab,
body.ui-revolution .stock-subtab {
  min-height: 34px;
  padding: 0 10px;
  color: var(--muted-strong);
  background: transparent;
  border: 0;
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 700;
}

body.ui-revolution .prod-subtab.active,
body.ui-revolution .stock-subtab.active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 1px 2px rgba(23, 33, 43, 0.08);
}

body.ui-revolution .prod-subtab svg,
body.ui-revolution .stock-subtab svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }

body.ui-revolution .split,
body.ui-revolution .billing-split,
body.ui-revolution .admin-layout {
  gap: 11px;
}

body.ui-revolution .admin-kpi-grid,
body.ui-revolution .billing-kpis,
body.ui-revolution .stock-kpi-grid,
body.ui-revolution .production-tracking-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 11px;
}

body.ui-revolution .admin-kpi-grid article,
body.ui-revolution .billing-kpis article,
body.ui-revolution .stock-kpi-grid article,
body.ui-revolution .production-tracking-kpis article {
  display: grid;
  gap: 3px;
  min-height: 82px;
  padding: 11px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-bottom: 3px solid var(--blue);
  border-radius: 8px;
  box-shadow: none;
}

body.ui-revolution .admin-kpi-grid article:nth-child(4n + 2),
body.ui-revolution .billing-kpis article:nth-child(4n + 2),
body.ui-revolution .stock-kpi-grid article:nth-child(4n + 2) { border-bottom-color: var(--green); }
body.ui-revolution .admin-kpi-grid article:nth-child(4n + 3),
body.ui-revolution .billing-kpis article:nth-child(4n + 3),
body.ui-revolution .stock-kpi-grid article:nth-child(4n + 3) { border-bottom-color: var(--amber); }
body.ui-revolution .admin-kpi-grid article:nth-child(4n + 4),
body.ui-revolution .billing-kpis article:nth-child(4n + 4),
body.ui-revolution .stock-kpi-grid article:nth-child(4n + 4) { border-bottom-color: var(--coral); }

body.ui-revolution .admin-kpi-grid article span,
body.ui-revolution .billing-kpis article span,
body.ui-revolution .stock-kpi-grid article span { color: var(--muted-strong); font-size: 0.65rem; font-weight: 700; }
body.ui-revolution .admin-kpi-grid article strong,
body.ui-revolution .billing-kpis article strong,
body.ui-revolution .stock-kpi-grid article strong { color: var(--ink); font-size: 1.25rem; }
body.ui-revolution .admin-kpi-grid article small,
body.ui-revolution .billing-kpis article small,
body.ui-revolution .stock-kpi-grid article small { color: var(--muted); font-size: 0.64rem; }

body.ui-revolution .production-catalog-grid {
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 9px;
}

body.ui-revolution .production-product-card {
  grid-template-rows: auto auto auto auto auto;
  align-content: start;
  min-height: 150px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: none;
}

body.ui-revolution .production-product-card:hover { border-color: var(--trade-accent); transform: none; }

body.ui-revolution .product-visual {
  width: 42px;
  height: 42px;
  color: var(--trade-accent);
  background: var(--trade-soft);
  border: 0;
  border-radius: 7px;
  box-shadow: none;
}

body.ui-revolution .product-visual svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.ui-revolution table,
body.ui-revolution .inventory-table {
  width: 100%;
  color: var(--ink-soft);
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.72rem;
}

body.ui-revolution th {
  height: 35px;
  padding: 7px 8px;
  color: var(--muted-strong);
  background: #eef2f4;
  border-bottom: 1px solid var(--line-strong);
  font-size: 0.63rem;
  font-weight: 800;
  text-transform: uppercase;
}

body.ui-revolution td {
  min-height: 39px;
  padding: 7px 8px;
  background: #fff;
  border-bottom: 1px solid #e8ecef;
}

body.ui-revolution tbody tr:hover td { background: #f7f9fa; }

body.ui-revolution .planning-board,
body.ui-revolution .planning-grid,
body.ui-revolution .stock-sheet,
body.ui-revolution .inventory-sheet-wrap {
  border-color: var(--line);
  border-radius: 8px;
  box-shadow: none;
}

body.ui-revolution .planning-board {
  height: 295px;
  max-height: 295px;
  overflow: auto;
}

@media (min-width: 801px) {
  body.ui-revolution .appointments-panel { display: none; }
  body.ui-revolution .planning-layout {
    grid-template-columns: minmax(300px, 0.42fr) minmax(0, 1fr);
    height: 385px;
    overflow: hidden;
  }
  body.ui-revolution .planning-manual-panel,
  body.ui-revolution .planning-calendar-panel {
    height: 385px;
    min-height: 0;
  }
  body.ui-revolution .planning-manual-panel { overflow-y: auto; }
  body.ui-revolution .planning-calendar-panel { overflow: hidden; }
}

body.ui-revolution .integration-card,
body.ui-revolution .module-card,
body.ui-revolution .supplier-card,
body.ui-revolution .customer-case-card {
  border-radius: 8px;
  box-shadow: none;
}

body.ui-revolution .integration-config-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

body.ui-revolution .tab-panel[data-panel="requests"] .install-tools,
body.ui-revolution .tab-panel[data-panel="requests"] .integration-config-panel {
  display: none;
}

body.ui-revolution .tab-panel[data-panel="requests"] .integration-config-panel.is-open {
  display: block;
}

body.ui-revolution #messageList {
  max-height: 430px;
  overflow-y: auto;
}

body.ui-revolution #outboxList,
body.ui-revolution #orderList {
  max-height: 340px;
  overflow-y: auto;
}

body.ui-revolution .list-limit-note {
  position: sticky;
  bottom: 0;
  padding: 7px 9px;
  color: var(--muted-strong);
  background: #eef2f4;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.66rem;
  text-align: center;
}

body.ui-revolution .integration-card {
  padding: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

body.ui-revolution .integration-card legend { color: var(--ink); font-size: 0.75rem; font-weight: 750; }

body.ui-revolution .stock-cards-details { display: none !important; }

body.ui-revolution .stock-subpanel[data-stock-subpanel="scan"] .operations-grid {
  grid-template-columns: minmax(260px, 0.72fr) minmax(460px, 1.28fr);
  align-items: start;
}

body.ui-revolution .stock-subpanel[data-stock-subpanel="scan"] .scanner-panel {
  grid-column: 2;
  grid-row: 1 / span 2;
}

/* Modals */
body.ui-revolution .modal-shell { backdrop-filter: none; }
body.ui-revolution .modal-backdrop { background: rgba(23, 33, 43, 0.54); }

body.ui-revolution .modal-card {
  max-height: 90vh;
  padding: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(23, 33, 43, 0.26);
}

body.ui-revolution .modal-card > .modal-head {
  min-height: 62px;
  padding: 13px 17px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

body.ui-revolution .modal-card > .modal-head h2 { color: var(--ink); font-size: 1.02rem; }
body.ui-revolution .modal-card > .modal-actions { padding: 11px 17px; background: var(--surface-soft); border-top: 1px solid var(--line); }
body.ui-revolution .modal-card > *:not(.modal-head):not(.modal-actions) { margin-right: 17px; margin-left: 17px; }

body.ui-revolution .icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  color: var(--muted-strong);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
}

body.ui-revolution .quote-trade-details { background: var(--surface-soft); border-color: var(--line); border-radius: 7px; }

/* Login */
body.ui-revolution .login-screen {
  background: #edf1f4;
}

body.ui-revolution .login-card {
  width: min(410px, 100%);
  padding: 28px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: 0 22px 60px rgba(23, 33, 43, 0.16);
}

body.ui-revolution .login-brand {
  width: 52px;
  height: 52px;
  background: var(--ink);
  border-radius: 8px;
}

/* Desktop density */
@media (min-width: 1000px) {
  body.ui-revolution:not(.phone-mode) .tab-panel.active {
    height: calc(100vh - var(--topbar-height) - 15px);
  }

  body.ui-revolution:not(.phone-mode) .tab-panel[data-panel="overview"].active {
    display: grid;
    grid-template-rows: auto auto auto minmax(135px, 1fr);
    align-content: stretch;
    gap: 5px;
    overflow-y: hidden;
  }

  body.ui-revolution:not(.phone-mode) .today-command-shell {
    height: auto;
    overflow: visible;
  }

  body.ui-revolution:not(.phone-mode) .overview-action-strip {
    min-height: 0;
    overflow: hidden;
  }

  body.ui-revolution:not(.phone-mode) .priority-panel,
  body.ui-revolution:not(.phone-mode) .validation-panel {
    height: 100%;
    min-height: 0;
  }
}

@media (max-width: 1280px) {
  body.ui-revolution { --sidebar-width: 224px; }
  body.ui-revolution .topbar { grid-template-columns: minmax(220px, 1fr) minmax(220px, 320px) auto; }
  body.ui-revolution .autopilot-status > span:nth-child(2) { display: none; }
  body.ui-revolution .automation-ribbon { grid-template-columns: minmax(240px, 1fr) auto auto; }
  body.ui-revolution .automation-ribbon-metrics > span { padding-inline: 6px; }
}

@media (min-width: 801px) {
  body.ui-revolution .brand { order: 1; }
  body.ui-revolution .sidebar > .field { order: 2; }
  body.ui-revolution .sidebar-create-shell { order: 3; }
  body.ui-revolution .nav { order: 4; flex: 0 0 auto; overflow: visible; }
  body.ui-revolution .sidebar-card { order: 5; }
  body.ui-revolution .onboarding-open-btn { order: 80; }
  body.ui-revolution .installer-details { order: 90; }
  body.ui-revolution .logout-btn { order: 95; }
  body.ui-revolution .nav-btn { min-height: 31px; padding-block: 5px; }
  body.ui-revolution .nav-group-label { margin: 8px 8px 3px; }
}

@media (max-width: 1100px) and (min-width: 801px) {
  body.ui-revolution .pilotage-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.ui-revolution:not(.phone-mode) .tab-panel[data-panel="overview"].active { overflow-y: auto; }
}

@media (max-width: 1050px) {
  body.ui-revolution .global-command-shell { display: none; }
  body.ui-revolution .topbar { grid-template-columns: minmax(220px, 1fr) auto; }
  body.ui-revolution .automation-ribbon { grid-template-columns: 1fr auto; }
  body.ui-revolution .automation-ribbon-metrics { display: none; }
  body.ui-revolution .business-flow-shell { grid-template-columns: 1fr; gap: 7px; }
}

/* Mobile */
@media (max-width: 800px) {
  body.ui-revolution {
    --topbar-height: 64px;
    padding: 0;
    overflow-x: hidden;
    font-size: 15px;
  }

  body.ui-revolution .layout {
    display: block;
    min-width: 0;
  }

  body.ui-revolution .sidebar {
    position: sticky;
    top: 0;
    z-index: 70;
    display: grid;
    grid-template-columns: auto minmax(150px, 1fr);
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 64px;
    padding: 8px 10px;
    overflow: visible;
    background: #fff;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  body.ui-revolution .brand {
    min-height: 40px;
    margin: 0;
  }

  body.ui-revolution .brand-mark,
  body.ui-revolution .brand-logo { width: 36px; height: 36px; }
  body.ui-revolution .brand > div:last-child { display: none; }

  body.ui-revolution .sidebar > .field {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 7px;
    width: 100%;
    margin: 0;
  }

  body.ui-revolution .sidebar > .field > span { font-size: 0.58rem; }
  body.ui-revolution .sidebar select { min-width: 0; width: 100%; min-height: 36px; }

  body.ui-revolution .installer-details,
  body.ui-revolution .onboarding-open-btn,
  body.ui-revolution .logout-btn,
  body.ui-revolution .sidebar-create-shell,
  body.ui-revolution .sidebar-card,
  body.ui-revolution .nav-group-label { display: none !important; }

  body.ui-revolution .nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 90;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
    height: 66px;
    padding: 5px 6px max(5px, env(safe-area-inset-bottom));
    overflow: hidden;
    background: rgba(255, 255, 255, 0.98);
    border-top: 1px solid var(--line-strong);
    box-shadow: 0 -8px 24px rgba(23, 33, 43, 0.08);
  }

  body.ui-revolution .nav-btn {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 24px auto;
    justify-items: center;
    gap: 1px;
    min-width: 0;
    min-height: 54px;
    margin: 0;
    padding: 5px 2px;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 7px;
    font-size: 0.58rem;
    text-align: center;
  }

  body.ui-revolution .nav-btn .nav-icon { width: 19px; height: 19px; }
  body.ui-revolution .nav-btn.active { color: var(--primary-dark); background: var(--primary-soft); }
  body.ui-revolution .nav-btn.active .nav-icon { color: var(--primary); stroke: currentColor; }
  body.ui-revolution .nav-btn.active::after { display: none; }
  body.ui-revolution .nav-btn { display: none; }
  body.ui-revolution .nav-btn[data-tab="overview"],
  body.ui-revolution .nav-btn[data-tab="requests"],
  body.ui-revolution .nav-btn[data-tab="planning"],
  body.ui-revolution .nav-btn[data-tab="inventory"],
  body.ui-revolution .nav-btn[data-tab="settings"] { display: grid; }

  body.ui-revolution main {
    width: 100%;
    height: auto;
    min-height: calc(100vh - 64px);
    padding: 0 10px 78px;
    overflow: visible;
  }

  body.ui-revolution .topbar {
    position: sticky;
    top: 64px;
    z-index: 55;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    min-height: 58px;
    margin: 0 -10px 10px;
    padding: 8px 10px;
    background: rgba(244, 246, 248, 0.98);
  }

  body.ui-revolution .topbar .eyebrow { display: none; }
  body.ui-revolution .topbar h1 { font-size: 1rem; }
  body.ui-revolution .autopilot-status,
  body.ui-revolution #workshopModeBtn span,
  body.ui-revolution #refreshBtn span { display: none; }
  body.ui-revolution .topbar .btn { width: 36px; padding: 0; }

  body.ui-revolution .tab-panel.active,
  body.ui-revolution .tab-panel[data-panel="overview"].active {
    display: grid;
    height: auto;
    max-height: none;
    padding: 0 0 8px;
    overflow: visible;
  }

  body.ui-revolution .automation-ribbon {
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 58px;
    padding: 8px 9px;
  }

  body.ui-revolution .automation-ribbon-main span { white-space: normal; }
  body.ui-revolution .automation-ribbon .btn { width: 35px; padding: 0; }
  body.ui-revolution .automation-ribbon .btn span { display: none; }

  body.ui-revolution .pilotage-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  body.ui-revolution .pilotage-grid { grid-auto-rows: auto; }
  body.ui-revolution .pilotage-tile { height: auto; min-height: 105px; grid-template-columns: 32px minmax(0, 1fr); gap: 7px; padding: 10px; }
  body.ui-revolution .pilotage-tile:first-child { grid-column: 1 / -1; min-height: 86px; }
  body.ui-revolution .pilotage-tile > svg { width: 32px; height: 32px; padding: 7px; }
  body.ui-revolution .pilotage-tile strong { font-size: 0.92rem; }
  body.ui-revolution .pilotage-tile > div:not(.kpi-foot) > span { white-space: normal; }

  body.ui-revolution .business-flow-shell { padding: 8px; }
  body.ui-revolution .business-flow-head { display: flex; align-items: center; justify-content: space-between; }
  body.ui-revolution .business-flow { grid-template-columns: repeat(5, minmax(54px, 1fr)); gap: 4px; }
  body.ui-revolution .business-flow-step { grid-template-columns: 1fr; justify-items: center; min-height: 55px; padding: 5px 2px; text-align: center; }
  body.ui-revolution .business-flow-icon { width: 24px; height: 24px; }
  body.ui-revolution .business-flow-step small { font-size: 0.51rem; }

  body.ui-revolution .today-command-grid,
  body.ui-revolution .home-command-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  body.ui-revolution .home-command { min-height: 62px; padding: 8px; }

  body.ui-revolution .overview-action-strip,
  body.ui-revolution .split,
  body.ui-revolution .billing-split,
  body.ui-revolution .admin-layout { grid-template-columns: 1fr; }

  body.ui-revolution .page-dashboard-strip {
    align-items: flex-start;
    min-height: 64px;
    padding: 8px 1px 10px;
  }

  body.ui-revolution .page-dashboard-strip h2 { font-size: 1rem; }
  body.ui-revolution .page-dashboard-strip p:last-child { display: none; }
  body.ui-revolution .page-hero-actions .btn span { display: none; }

  body.ui-revolution .admin-kpi-grid,
  body.ui-revolution .billing-kpis,
  body.ui-revolution .stock-kpi-grid,
  body.ui-revolution .production-tracking-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  body.ui-revolution .integration-config-grid { grid-template-columns: 1fr; }
  body.ui-revolution .production-catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.ui-revolution .planning-board { height: 480px; max-height: 480px; }
  body.ui-revolution .planning-layout { height: auto; overflow: visible; }
  body.ui-revolution .planning-calendar-panel { order: 1; height: auto; overflow: visible; }
  body.ui-revolution .planning-manual-panel { order: 2; height: auto; overflow: visible; }
  body.ui-revolution .stock-subpanel[data-stock-subpanel="scan"] .operations-grid { grid-template-columns: 1fr; }
  body.ui-revolution .stock-subpanel[data-stock-subpanel="scan"] .scanner-panel { grid-column: auto; grid-row: auto; }

  body.ui-revolution .modal-shell { align-items: end; padding: 0; }
  body.ui-revolution .modal-card {
    width: 100%;
    max-width: none;
    max-height: calc(100vh - 20px);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 8px 8px 0 0;
  }

  body.ui-revolution .quote-modal-card { width: 100%; }
}

@media (max-width: 420px) {
  body.ui-revolution .automation-ribbon-main span { display: none; }
  body.ui-revolution .pilotage-grid { grid-template-columns: 1fr 1fr; }
  body.ui-revolution .pilotage-tile:nth-child(4) { grid-column: 1 / -1; }
  body.ui-revolution .production-catalog-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  body.ui-revolution *,
  body.ui-revolution *::before,
  body.ui-revolution *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
