:root {
  --bg: #f3f4f6;
  --ink: #1a1a2e;
  --muted: #6b7280;
  --panel: #ffffff;
  --line: #e5e7eb;
  --primary: #f5a623;
  --secondary: #51adff;
  --warn: #b1261e;
  --ok: #0f8143;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, "Courier New", monospace;

  --sidebar-width: 268px;
  --sidebar-collapsed-width: 60px;
  --header-height: 60px;
  --sidebar-bg: #ffffff;
  --sidebar-active-bg: #eef4ff;
  --sidebar-active-border: #f5a623;
  --sidebar-hover-bg: #f9fafb;
}

@font-face {
  font-family: "Byotone";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/statics/fonts/byotone/Byotone-Regular.otf") format("opentype");
}

@font-face {
  font-family: "Byotone";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("/statics/fonts/byotone/Byotone-Light.otf") format("opentype");
}

@font-face {
  font-family: "Byotone";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/statics/fonts/byotone/Byotone-Medium.otf") format("opentype");
}

@font-face {
  font-family: "Byotone";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/statics/fonts/byotone/Byotone-SemiBold.otf") format("opentype");
}

@font-face {
  font-family: "Byotone";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/statics/fonts/byotone/Byotone-Bold.otf") format("opentype");
}

@font-face {
  font-family: "Byotone";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/statics/fonts/byotone/Byotone-ExtraBold.otf") format("opentype");
}

@font-face {
  font-family: "Mortend";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/statics/fonts/Mortend.woff2") format("woff2");
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
}

/* ─── App Shell ────────────────────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

body.auth-page .app-shell {
  display: none;
}

body.has-session .login-overlay {
  display: none;
}

/* ─── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid #7f9293;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 30;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width 0.22s ease, min-width 0.22s ease;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 14px 47px 14px;
  border-bottom: 1px solid #7f9293;
  gap: 8px;
}

.sidebar-logo-img {
  display: block;
  width: 140px;
  height: auto;
  flex-shrink: 0;
  transition: opacity 0.18s ease;
}

.sidebar-logo-icon {
  display: none;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 6px;
}

.sidebar-toggle {
  position: fixed;
  left: calc(var(--sidebar-width) - 14px);
  top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #7f9293;
  border-radius: 50%;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  z-index: 40;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  transition: background 0.15s, color 0.15s, transform 0.22s ease, left 0.22s ease;
}

.sidebar-toggle.collapsed {
  left: calc(var(--sidebar-collapsed-width) - 14px);
  transform: rotate(180deg);
}

.sidebar-toggle:hover {
  background: var(--sidebar-hover-bg);
  color: var(--ink);
}

/* ─── Sidebar navigation items ─────────────────────────────── */
.module-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 10px;
  flex: 1;
}

.nav-separator {
  height: 1px;
  background: #7f9293;
  margin: 8px -10px;
  flex-shrink: 0;
}

.nav-group__title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8c867d;
  padding: 12px 12px 4px;
}

.nav-group-block .nav-item--parent {
  position: relative;
  overflow: visible;
}

.module-nav button.nav-item--parent {
  white-space: normal;
  overflow: visible;
  align-items: center;
  line-height: 1.3;
}

.module-nav button.nav-item--parent .nav-label {
  flex: 1;
  min-width: 0;
  overflow: visible;
  white-space: normal;
  line-height: 1.3;
}

.nav-item__chev {
  flex-shrink: 0;
  margin-left: auto;
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #8c867d;
  cursor: pointer;
  transition: transform 0.15s ease, color 0.15s ease;
}

.nav-item__chev:hover {
  color: #4a2e2a;
}

.nav-item__chev svg {
  width: 16px;
  height: 16px;
  display: block;
}

.nav-item--parent.is-open .nav-item__chev {
  transform: rotate(90deg);
}

.nav-subnav {
  display: none;
  flex-direction: column;
  gap: 1px;
  margin: 2px 0 4px;
}

.nav-subnav.is-open {
  display: flex;
}

.module-nav .nav-subitem {
  display: flex;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 8px 12px 8px 44px;
  border: none;
  border-left: 4px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #5c534c;
  font-family: "Byotone", var(--sans);
  font-size: 13px;
  cursor: pointer;
}

.module-nav .nav-subitem:hover {
  background: #fff2ef;
}

.module-nav .nav-subitem.active {
  background: #fff2ef;
  color: #ff6038;
  font-weight: 600;
  border-left-color: #ff6038;
  padding-left: 40px;
}

.sidebar.collapsed .nav-group__title,
.sidebar.collapsed .nav-subnav {
  display: none !important;
}

.sidebar.collapsed .nav-item__chev {
  display: none;
}

.module-nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 0;
  border: none;
  border-left: 4px solid transparent;
  background: transparent;
  color: #4a2e2a;
  font-family: "Byotone", var(--sans);
  font-size: 14px;
  font-weight: 500;
  line-height: 16px;
  letter-spacing: -0.03em;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  position: relative;
  white-space: nowrap;
  overflow: hidden;
}

.module-nav button:hover {
  background: #fff2ef;
}

.module-nav button.active {
  background: #fff2ef;
  color: #4a2e2a;
  font-weight: 600;
  border-left: 4px solid #4a2e2a;
  padding-left: 8px;
}

.module-nav button .nav-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
}

.module-nav button .nav-icon svg {
  width: 18px;
  height: 18px;
}

.module-nav button .nav-label {
  transition: opacity 0.18s ease;
}

.module-nav button .nav-badge {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  transition: opacity 0.18s ease;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
  min-width: var(--sidebar-collapsed-width);
}

.sidebar-user-container {
  margin-top: auto;
  border-top: 1px solid #7f9293;
  padding: 24px 0 24px 0;
  width: 100%;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  margin: 0 10px;
  border: 1px solid #7f9293;
  border-radius: 12px;
  cursor: pointer;
  position: relative;
  background: #fbfbfb;
  transition: background 0.15s;
}

.sidebar-user:hover {
  background: var(--sidebar-hover-bg);
}

.sidebar-user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #f3f4f6;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#header-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-user-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.sidebar-username {
  font-family: "Byotone", var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: #4a2e2a;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.1;
  margin-bottom: 2px;
}

.sidebar-role {
  font-family: "Poppins", var(--sans);
  font-size: 9px;
  font-weight: 400;
  color: #7f9293;
  text-transform: uppercase;
  line-height: 1;
}

.sidebar-user-chevron {
  color: #4a2e2a;
  flex-shrink: 0;
  transition: transform 0.2s;
}

#header-user-menu.open .sidebar-user-chevron {
  transform: rotate(180deg);
}

#header-dropdown {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  padding: 6px;
  z-index: 100;
}

#header-user-menu.open #header-dropdown {
  display: block;
}

.header-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s;
}

.header-dropdown-item:hover {
  background: #fee2e2;
  color: #dc2626;
}

/* ─── Sidebar collapsed state ──────────────────────────────── */

.sidebar.collapsed .sidebar-logo {
  justify-content: center;
  padding: 14px 8px;
}

.sidebar.collapsed .sidebar-logo-img {
  display: none;
}

.sidebar.collapsed .sidebar-logo-icon {
  display: block;
  width: 34px;
  height: 34px;
}

.sidebar.collapsed .module-nav {
  padding: 12px 6px;
}

.sidebar.collapsed .module-nav button {
  justify-content: center;
  padding: 10px 0;
  gap: 0;
  border-left: none;
}

/* ─── Access Control ───────────────────────────────────────── */
.ac-shell {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ac-hero,
.ac-card,
.ac-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.ac-hero,
.ac-card,
.ac-section {
  padding: 18px 20px;
}

.ac-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.ac-kicker {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ac-hero h2,
.ac-card h3,
.ac-section h3,
.ac-card h4 {
  margin: 0;
}

.ac-hero p,
.ac-card p,
.ac-section p {
  color: var(--muted);
}

.ac-grid {
  display: grid;
  gap: 16px;
}

.ac-grid--triple {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.ac-grid--double {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.ac-input,
.ac-select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
  color: var(--ink);
}

.ac-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.ac-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ac-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ac-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 5px 10px;
  background: #f3f4f6;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.ac-meta {
  margin: -4px 0 0;
  font-size: 12px;
}

.ac-subgroup {
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ac-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ac-pill,
.ac-empty {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
}

.ac-pill {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.ac-pill:hover {
  background: #f9fafb;
}

.ac-pill--static {
  cursor: default;
  background: #f9fafb;
}

.ac-pill--static:hover {
  background: #f9fafb;
}

.ac-empty {
  background: #f9fafb;
  color: var(--muted);
}

.ac-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ac-section-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ac-section-head--row {
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.ac-shell .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 14px 26px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.ac-shell .btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.ac-shell .btn-primary {
  background: #ff6038;
  color: #fff;
}

.ac-shell .btn-primary:hover:not(:disabled) {
  background: #cb4017;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(22, 18, 14, 0.12);
}

.ac-shell .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.ac-section-head--row .ac-create-user-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.sidebar.collapsed .module-nav button.active {
  border-left: 3px solid var(--sidebar-active-border);
}

.sidebar.collapsed .module-nav button .nav-label {
  display: none;
}

.sidebar.collapsed .module-nav button .nav-badge {
  display: none;
}

.sidebar.collapsed .sidebar-user {
  padding: 12px 6px;
  justify-content: center;
}

.sidebar.collapsed .sidebar-user-info,
.sidebar.collapsed .sidebar-user-chevron {
  display: none;
}

.sidebar.collapsed .header-dropdown-item-label {
  display: none;
}

.sidebar.collapsed .header-dropdown-item {
  justify-content: center;
  padding-left: 10px;
  padding-right: 10px;
}

.sidebar.collapsed .header-dropdown-item svg {
  flex-shrink: 0;
}

/* Tooltip on hover when collapsed */
.sidebar.collapsed .module-nav button::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  padding: 5px 10px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 50;
}

.sidebar.collapsed .module-nav button:hover::after {
  opacity: 1;
}

/* ─── Main area (to the right of the sidebar) ──────────────── */
.main-area {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
  transition: margin-left 0.22s ease;
}

.sidebar.collapsed ~ .main-area {
  margin-left: var(--sidebar-collapsed-width);
}

/* ─── App header ───────────────────────────────────────────── */
.app-header {
  height: var(--header-height);
  min-height: var(--header-height);
  background: #fff;
  border-bottom: 1px solid #7f9293;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-lang-select {
  font-family: "Poppins", var(--sans);
  font-size: 13px;
  font-weight: 400;
  line-height: 16px;
  letter-spacing: -0.03em;
  color: var(--ink);
  border: 1px solid #7f9293;
  border-radius: 8px;
  padding: 6px 10px;
  background: #fff;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
}

.header-lang-select:hover {
  border-color: var(--muted);
}

.header-lang-select:focus-visible {
  border-color: var(--primary);
}

.header-separator {
  width: 1px;
  height: 24px;
  background: var(--line);
  flex-shrink: 0;
}

/* ─── Main content ─────────────────────────────────────────── */
.main-content {
  flex: 1;
  min-height: 0;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ─── Console panel ────────────────────────────────────────── */
.console-panel {
  display: none;
}

h1 {
  margin: 8px 0;
  font-size: clamp(24px, 3.7vw, 42px);
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.connection-card {
  width: min(420px, 100%);
  padding: 12px;
  display: grid;
  gap: 8px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

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

input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
}

button {
  border: none;
  border-radius: 10px;
  padding: 9px 12px;
  color: #fff;
  font-weight: 600;
  background: linear-gradient(120deg, var(--primary), #d9672a);
  cursor: pointer;
}

button.ghost {
  color: var(--ink);
  border: 1px solid var(--line);
  background: transparent;
  font-weight: 500;
}

.section-title {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 11px;
  color: var(--muted);
  font-family: var(--mono);
}

.quick-links {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  display: grid;
  gap: 6px;
  font-size: 12px;
}

.module-root {
  min-width: 0;
}

.module-shell {
  display: grid;
  gap: 12px;
}

.grid-two {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 1fr;
}

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

.panel {
  padding: 14px;
}

.panel h2,
.panel h3 {
  margin: 0;
}

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

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

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

.form-grid > button {
  grid-column: 1 / -1;
}

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

.form-grid.wide > button {
  grid-column: span 1;
}

.item-list {
  display: grid;
  gap: 10px;
  max-height: 430px;
  overflow: auto;
  padding-right: 2px;
}

.item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #fff;
  display: grid;
  gap: 5px;
}

.item-title {
  font-weight: 700;
  font-size: 14px;
}

.item-meta {
  color: var(--muted);
  font-size: 12px;
  font-family: var(--mono);
}

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-family: var(--mono);
}

.badge.ok {
  background: var(--ok);
  color: #fff;
}

.badge.warn {
  background: var(--warn);
  color: #fff;
}

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

.machine-block {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
}

.machine-title {
  font-weight: 700;
  margin-bottom: 8px;
}

.indicator-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px dashed #ebdfce;
  padding: 6px 0;
  font-size: 12px;
}

.indicator-row:first-child {
  border-top: none;
}

.console-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#response {
  margin: 8px 0 0;
  white-space: pre-wrap;
  color: #f6ecdd;
  background: #17130f;
  border-radius: 12px;
  padding: 12px;
  min-height: 120px;
  font-family: var(--mono);
  font-size: 12px;
}

.hidden {
  display: none !important;
}

@media (max-width: 1100px) {
  .grid-two,
  .grid-three,
  .form-grid,
  .form-grid.compact,
  .form-grid.wide {
    grid-template-columns: 1fr;
  }

  .form-grid.wide > button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: var(--sidebar-collapsed-width);
    min-width: var(--sidebar-collapsed-width);
  }

  .sidebar .sidebar-logo {
    padding: 14px 8px;
  }

  .sidebar .sidebar-logo-img {
    display: none;
  }

  .sidebar .sidebar-logo-icon {
    display: block;
  }

  .sidebar-toggle {
    display: none;
  }

  .sidebar .module-nav button .nav-label,
  .sidebar .module-nav button .nav-badge {
    display: none;
  }

  .sidebar .module-nav button {
    justify-content: center;
    padding: 10px;
    gap: 0;
  }

  .main-area {
    margin-left: var(--sidebar-collapsed-width);
  }

  .sidebar.collapsed ~ .main-area {
    margin-left: var(--sidebar-collapsed-width);
  }
}

/* —— Organizational structure (same outer contract as Resources: full-bleed) —— */
.org-structure-view {
  --org-ink: #361e1c;
  --org-panel: #fffbf8;
  --org-sage: #e9eee3;
  --org-sage-2: #ebecdc;
  --org-surface: #f5f5ed;
  --org-teal: #67c5c9;
  --org-teal-soft: #a0c9cb;
  --org-ink-deep: #11363e;
  --org-border: #c5dad3;
  --org-border-strong: #7f9293;
  --org-split-left: 400px;
  --org-panel-top-pad: 20px;
  --org-panel-pad-inline-start: 18px;
  --org-panel-pad-inline-end: 16px;
  --org-hero-kicker-height: 22px;
  padding: 0;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.main-content:has(.org-structure-view) {
  padding: 0;
  flex: 1;
  min-height: 0;
}

.main-content:has(.org-structure-view) .module-root {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.org-structure-view > .rsv-layout {
  flex: 1;
  min-height: 0;
}

.org-structure-view .rsv-layout {
  grid-template-columns: var(--org-split-left) 6px minmax(0, 1fr);
}

.org-structure-view .org-splitter {
  grid-column: 2;
  grid-row: 1;
  align-self: stretch;
  width: 6px;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: col-resize;
  touch-action: none;
  position: relative;
  z-index: 4;
  flex-shrink: 0;
  color: var(--org-border-strong);
}

.org-structure-view .org-splitter::before {
  display: none;
}

.org-structure-view .org-splitter:hover,
.org-structure-view .org-splitter:focus-visible {
  background: rgba(103, 197, 201, 0.12);
}

.org-structure-view .org-splitter:focus-visible {
  outline: none;
}

.org-structure-view .org-splitter:focus-visible::after {
  content: "";
  position: absolute;
  inset: 0;
  outline: 2px solid var(--org-teal);
  outline-offset: 2px;
  pointer-events: none;
}

.org-structure-view.org-structure-view--resizing,
.org-structure-view.org-structure-view--resizing * {
  cursor: col-resize !important;
  user-select: none;
}

.org-structure-view .rsv-left {
  background: var(--org-panel);
  border-right: 1px solid var(--org-border-strong);
  gap: 0;
  padding: var(--org-panel-top-pad) var(--org-panel-pad-inline-end) 18px var(--org-panel-pad-inline-start);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  box-sizing: border-box;
  container-type: inline-size;
  container-name: org-left;
}

.org-structure-view .rsv-right {
  background: var(--org-sage-2);
  border-left: none;
  padding: 0 var(--org-panel-pad-inline-end) 24px var(--org-panel-pad-inline-start);
  overflow: auto;
  min-width: 0;
  container-type: inline-size;
  container-name: org-right;
}

.org-left-static {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.org-structure-view .org-plants-scroll {
  flex: 1;
  min-height: 120px;
  overflow-y: auto;
  overflow-x: hidden;
  margin-left: calc(-1 * var(--org-panel-pad-inline-start));
  margin-right: calc(-1 * var(--org-panel-pad-inline-end));
  width: calc(100% + var(--org-panel-pad-inline-start) + var(--org-panel-pad-inline-end));
  padding-right: 0;
  scrollbar-gutter: stable;
  box-sizing: border-box;
  background: var(--org-panel);
}

.org-detail-inner {
  min-height: 100%;
  box-sizing: border-box;
}

/* Hero — Figma 1853:35822: title + actions in one wrapped row, 16px/8px gap */
.org-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 16px 8px;
  box-sizing: border-box;
}

.org-hero-text {
  flex: 1 1 333px;
  width: min(333px, 100%);
  max-width: 333px;
  min-width: 0;
}

.org-hero-kicker-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-height: var(--org-hero-kicker-height);
  margin-bottom: 18px;
  color: #361e1c;
}

.org-hero-kicker {
  font-family: "Byotone", var(--sans);
  font-size: 20px;
  font-weight: 400;
  text-transform: uppercase;
  line-height: 1.1;
}

.org-help-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  z-index: 6;
}

.org-help-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 20px;
  height: 20px;
  border: 1px solid #7f9293;
  border-radius: 6px;
  background: #fffbf8;
  cursor: pointer;
  padding: 2px;
  color: #361e1c;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}

.org-help-btn:hover {
  background: #f9f9f5;
}

.org-help-btn:focus-visible {
  outline: 2px solid #67c5c9;
  outline-offset: 2px;
}

.org-help-btn .org-help-glyph {
  display: block;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  color: inherit;
  margin: 0;
  padding: 0;
  transform: translateY(-0.5px);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.org-help-bubble {
  display: none;
  position: absolute;
  right: 100%;
  left: auto;
  top: 50%;
  transform: translateY(-50%);
  margin-right: 8px;
  margin-left: 0;
  width: min(219px, calc(100vw - 48px));
  max-width: 219px;
  padding: 6px;
  background: #ebecdc;
  border-radius: 6px;
  box-shadow: 0 4px 2px rgba(0, 0, 0, 0.25);
  font-family: "Byotone", var(--sans);
  font-size: 10px;
  font-weight: 400;
  line-height: 16px;
  letter-spacing: 0.5px;
  color: #361e1c;
  text-align: left;
  word-break: break-word;
  z-index: 20;
}

.org-help-wrap:hover .org-help-bubble,
.org-help-wrap:focus-within .org-help-bubble {
  display: block;
}

.org-brand-block {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.org-brand-line {
  font-family: "Mortend", "Byotone", var(--sans);
  font-size: 36px;
  font-weight: 700;
  line-height: 1.15;
  color: #361e1c;
  text-transform: uppercase;
  margin: 0;
}

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

.org-btn {
  font-family: "Byotone", var(--sans);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  padding: 12px 16px;
  border-radius: 12px;
  cursor: pointer;
  border: 1px solid #7f9293;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.org-btn-outline {
  background: #fffbf8;
  color: #361e1c;
}

.org-btn-outline:hover {
  background: #f5f5ed;
}

.org-btn-primary {
  background: #67c5c9;
  color: #f5f5ed;
  border-color: #7f9293;
}

.org-btn-primary:hover {
  filter: brightness(1.03);
}

.org-btn-sm {
  padding: 10px 14px;
  font-size: 14px;
}

/* Stats row — Figma 1853:35835 */
.org-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: center;
  gap: 10px;
  padding-left: 16px;
  box-sizing: border-box;
  width: 100%;
}

.org-stat-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 21px 0;
  border-right: 1px solid #c5dad3;
  width: 152px;
  flex: 0 0 auto;
  box-sizing: border-box;
}

.org-stat-card--last {
  border-right: none;
}

.org-stat-ic {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 20px;
  background: #a0c9cb;
  color: #fff;
  padding: 8px;
  box-sizing: border-box;
}

.org-stat-ic .org-ic {
  width: 16px;
  height: 16px;
  display: block;
}

.org-stat-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
  flex: 1 1 0;
  min-width: 0;
}

.org-stat-label {
  font-family: "Byotone", var(--sans);
  font-size: 16px;
  font-weight: 500;
  color: #000;
  line-height: 16px;
}

.org-stat-value {
  font-family: "Byotone", var(--sans);
  font-size: 36px;
  font-weight: 300;
  line-height: 1.4;
  color: #11363e;
  white-space: nowrap;
}

.org-hr {
  height: 1px;
  background: #c5dad3;
  margin: 0;
  border: 0;
  flex-shrink: 0;
}

/* Plants section header — Figma 1887:38633 */
.org-structure-view .org-plants-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  flex-wrap: wrap;
  box-sizing: border-box;
  padding: 12px var(--org-panel-pad-inline-end) 12px var(--org-panel-pad-inline-start);
  margin: 16px calc(-1 * var(--org-panel-pad-inline-end)) 16px calc(-1 * var(--org-panel-pad-inline-start));
  width: calc(100% + var(--org-panel-pad-inline-start) + var(--org-panel-pad-inline-end));
  border: none;
  background: var(--org-panel);
  flex-shrink: 0;
  min-height: 48px;
  position: relative;
  min-width: 0;
}

.org-structure-view .org-plants-head::before,
.org-structure-view .org-plants-head::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: #c5dad3;
  pointer-events: none;
}

.org-structure-view .org-plants-head::before {
  top: 0;
}

.org-structure-view .org-plants-head::after {
  bottom: 0;
}

.org-plants-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #361e1c;
  flex: 1 1 auto;
  min-width: 0;
}

.org-plants-title-ic {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: #361e1c;
}

.org-plants-title-ic .org-ic {
  display: block;
  width: 16px;
  height: 16px;
}

.org-plants-title {
  font-family: "Byotone", var(--sans);
  font-size: 20px;
  font-weight: 400;
  text-transform: uppercase;
  line-height: normal;
  color: #361e1c;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.org-plants-head .org-plants-add-btn,
.gv-panel-actions .org-plants-add-btn {
  flex: 0 1 auto;
  max-width: 100%;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  border-radius: 12px;
  border-color: #7f9293;
  background: transparent;
  white-space: nowrap;
}

.org-plants-head .org-plants-add-btn:hover,
.gv-panel-actions .org-plants-add-btn:hover {
  background: #f9f9f5;
}

.org-plants-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
}

/* Plant row — Figma 1887:38334 (selected), 38335–38337 (default) */
.org-plant-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px var(--org-panel-pad-inline-end) 16px var(--org-panel-pad-inline-start);
  cursor: pointer;
  border: none;
  border-radius: 0;
  background: var(--org-panel);
  transition: background 0.15s;
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  flex-shrink: 0;
  position: relative;
}

.org-plant-row:hover:not(.org-plant-row--selected) {
  background: rgba(235, 236, 220, 0.65);
}

.org-plant-row--selected {
  background: #ebecdc;
  z-index: 1;
}

.org-plant-row--selected::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: #ebecdc;
  pointer-events: none;
}

.org-plant-row-main {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.org-plant-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  border-radius: 50%;
  flex-shrink: 0;
}

.org-plant-icon {
  display: block;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.org-plant-name {
  font-family: "Byotone", var(--sans);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.54px;
  color: #361e1c;
  line-height: 22px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.org-plant-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.org-mini-stat {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px 2px;
  font-family: "Byotone", var(--sans);
  font-size: 18px;
  color: #361e1c;
  letter-spacing: 0.54px;
}

.org-mini-stat b,
.org-mini-stat-num {
  font-weight: 400;
  line-height: 22px;
}

.org-mini-stat .org-ic {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.org-plant-stat {
  justify-content: center;
  align-items: center;
  padding: 0 2px;
  line-height: 22px;
}

.org-plant-go {
  flex-shrink: 0;
  border: 1px solid #7f9293;
  border-radius: 12px;
  background: transparent;
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #361e1c;
  transition: background 0.15s;
}

.org-plant-go--active,
.org-plant-row--selected .org-plant-go {
  background: #ebecdc;
}

.org-plant-go:hover {
  background: #f5f5ed;
}

.org-plant-row--selected .org-plant-go:hover {
  background: #e4e5d4;
}

.org-plant-go-ic {
  display: block;
  flex-shrink: 0;
}

.org-empty-msg {
  padding: 16px;
  font-family: "Byotone", var(--sans);
  font-size: 14px;
  color: #361e1c;
}

/* Right detail — Figma 1850:33643 (close) + 1850:33650 (hero) */
.org-detail-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  min-height: min-content;
  box-sizing: border-box;
}

.org-detail-stack--empty {
  justify-content: center;
  align-items: center;
  min-height: 320px;
  padding: 20px 12px 28px;
}

/* Header block: flat on sage panel (no white card) */
.org-detail-header {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  width: 100%;
  padding-top: var(--org-panel-top-pad);
  box-sizing: border-box;
}

.org-detail-close-row {
  display: flex;
  align-items: center;
  min-height: var(--org-hero-kicker-height);
  padding: 0;
  box-sizing: border-box;
}

.org-detail-close {
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  color: #000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border-radius: 4px;
  transition: opacity 0.15s;
}

.org-detail-close:hover {
  opacity: 0.7;
}

.org-detail-close:focus-visible {
  outline: 2px solid var(--org-teal);
  outline-offset: 2px;
}

.org-detail-close .org-ic {
  display: block;
  width: 16px;
  height: 16px;
}

/* Figma Frame 259 — hero row */
.org-detail-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px;
  padding: 16px 0 0;
  box-sizing: border-box;
  width: 100%;
}

.org-detail-photo {
  width: 50px;
  height: 52px;
  border-radius: 25px;
  object-fit: cover;
  flex-shrink: 0;
}

.org-detail-hero-text {
  flex: 1 1 200px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  justify-content: center;
}

.org-detail-kicker {
  margin: 0;
  font-family: "Byotone", var(--sans);
  font-size: 20px;
  font-weight: 400;
  line-height: normal;
  text-transform: uppercase;
  color: #361e1c;
}

.org-detail-title {
  margin: 0;
  font-family: "Byotone", var(--sans);
  font-size: 40px;
  font-weight: 300;
  line-height: 1.4;
  color: #000;
  word-break: break-word;
}

.org-detail-desc-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.org-detail-desc-label {
  font-family: "Byotone", var(--sans);
  font-size: 14px;
  font-weight: 400;
  line-height: 16px;
  color: #000;
}

.org-detail-desc {
  margin: 0;
  font-family: "Byotone", var(--sans);
  font-size: 14px;
  font-weight: 300;
  line-height: 1.43;
  color: #000;
}

.org-detail-hero-actions {
  display: flex;
  align-items: flex-start;
  flex-shrink: 0;
  margin-left: auto;
}

.org-detail-edit {
  flex-shrink: 0;
  border-color: var(--org-border);
}

/* Figma 1914:43395 — tabs card + groups by areas */
.org-detail-tabs-card {
  margin: 0;
  width: 100%;
  background: var(--org-surface);
  border: 1px solid var(--org-border-strong);
  border-radius: 16px;
  overflow: hidden;
  box-sizing: border-box;
}

@container org-right (max-width: 520px) {
  .org-detail-hero-actions {
    margin-left: 0;
    width: 100%;
    justify-content: flex-end;
  }

  .org-detail-title {
    font-size: 32px;
  }
}

/* Figma 1896:40971 — tab row: 3 equal columns + dividers, fixed 56px */
.org-tabs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr) 1px minmax(0, 1fr);
  grid-template-rows: 56px;
  align-items: stretch;
  gap: 0;
  background: var(--org-sage-2);
  width: 100%;
  height: 56px;
  min-height: 56px;
  max-height: 56px;
  overflow: clip;
  box-sizing: border-box;
}

.org-tabs > .org-tab:nth-child(1) {
  grid-column: 1;
  grid-row: 1;
}

.org-tabs > .org-tab-div:nth-child(2) {
  grid-column: 2;
  grid-row: 1;
}

.org-tabs > .org-tab:nth-child(3) {
  grid-column: 3;
  grid-row: 1;
}

.org-tabs > .org-tab-div:nth-child(4) {
  grid-column: 4;
  grid-row: 1;
}

.org-tabs > .org-tab:nth-child(5) {
  grid-column: 5;
  grid-row: 1;
}

/* Tab slots — div[role=tab]; inactive = full-height sage, active = surface cap */
.org-detail-tabs-card .org-tab {
  position: relative;
  z-index: 0;
  align-self: stretch;
  justify-self: stretch;
  width: 100%;
  min-width: 0;
  height: 100%;
  min-height: 56px;
  max-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 6px 20px;
  border: none;
  border-radius: 0;
  background-color: var(--org-sage-2);
  box-shadow: none;
  color: #000;
  font-family: "Byotone", var(--sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 16px;
  text-transform: capitalize;
  cursor: pointer;
  box-sizing: border-box;
  overflow: hidden;
}

.org-detail-tabs-card .org-tab:hover:not(.org-tab--active):not([aria-selected="true"]) {
  background-color: #e4e5d4;
}

.org-detail-tabs-card .org-tab:focus-visible {
  outline: 2px solid var(--org-teal);
  outline-offset: -2px;
}

.org-detail-tabs-card .org-tab--active,
.org-detail-tabs-card .org-tab[aria-selected="true"] {
  z-index: 1;
  background-color: var(--org-surface);
  border-radius: 16px 16px 0 0;
}

.org-detail-tabs-card .org-tab-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-width: 0;
  max-width: 600px;
  height: 100%;
  padding: 8px 0;
  background: transparent;
  border-radius: 0;
  box-sizing: border-box;
}

@container org-right (min-width: 720px) {
  .org-detail-tabs-card .org-tab-inner {
    max-width: none;
  }

  .org-detail-tabs-card .org-tab-label {
    overflow: visible;
    text-overflow: clip;
  }
}

.org-detail-tabs-card .org-tab-label {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 16px;
  font-weight: 400;
  line-height: 16px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #000;
}

.org-detail-tabs-card .org-tab--active .org-tab-label,
.org-detail-tabs-card .org-tab[aria-selected="true"] .org-tab-label {
  font-weight: 700;
}

.org-detail-tabs-card .org-tab-count {
  flex-shrink: 0;
  font-size: 20px;
  font-weight: 400;
  line-height: normal;
  text-transform: uppercase;
  white-space: nowrap;
  color: #000;
}

.org-tab-count::before {
  content: "(";
}

.org-tab-count::after {
  content: ")";
}

.org-tab-div {
  width: 1px;
  height: 56px;
  min-height: 56px;
  max-height: 56px;
  justify-self: stretch;
  align-self: stretch;
  background: var(--org-border);
}

.org-tab-panel {
  position: relative;
  z-index: 0;
  padding: 0;
  background: var(--org-surface);
  min-height: 200px;
  display: flex;
  flex-direction: column;
}

.org-groups-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding: 16px;
  box-sizing: border-box;
  width: 100%;
}

.org-groups-title {
  font-family: "Byotone", var(--sans);
  font-size: 20px;
  font-weight: 400;
  line-height: normal;
  text-transform: uppercase;
  color: #361e1c;
  flex-shrink: 0;
}

.org-groups-hint {
  flex: 1 1 200px;
  margin: 0;
  min-width: 0;
  font-family: "Byotone", var(--sans);
  font-size: 14px;
  font-weight: 300;
  line-height: 1.43;
  color: #000;
}

.org-groups-add-btn {
  flex-shrink: 0;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  border-color: var(--org-border-strong);
  background: transparent;
  color: #361e1c;
}

.org-groups-add-btn:hover {
  background: #f9f9f5;
}

/* Figma 1896:40970 — production lines tab */
.org-lines-groups-bar .org-lines-groups-title {
  flex-shrink: 0;
  max-width: 191px;
  text-align: left;
}

/* Figma 1914:43639 — workstations tab */
.org-ws-groups-bar {
  justify-content: space-between;
}

.org-ws-groups-bar .org-groups-title {
  flex: none;
}

.org-ws-acc-head .org-line-path-stat {
  flex-shrink: 0;
  max-width: 200px;
}

.org-ws-title-block {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  flex: 1 1 0;
  min-width: 88px;
  line-height: 16px;
}

.org-ws-title-block .org-acc-type {
  flex-shrink: 0;
}

.org-ws-title-block .org-acc-name {
  flex: none;
  width: 100%;
}

.org-ws-row {
  background: transparent;
}

.org-ws-acc-body {
  gap: 6px;
}

.org-ws-person-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--org-sage-2);
  box-sizing: border-box;
  width: 100%;
}

.org-ws-person-row {
  background: transparent;
}

.org-ws-person-email {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0 auto;
  padding: 0 8px;
  font-family: "Byotone", var(--sans);
  font-size: 10px;
  font-weight: 400;
  line-height: 16px;
  letter-spacing: 0.5px;
  color: #808191;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.org-ws-shift-stat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 10px 2px;
  flex-shrink: 0;
  color: #361e1c;
}

.org-ws-shift-stat .org-ic {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.org-ws-shift-text {
  font-family: "Byotone", var(--sans);
  font-size: 10px;
  font-weight: 400;
  line-height: 16px;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.org-ws-shift-stat--muted .org-ws-shift-text {
  color: #808191;
}

.org-ws-area-empty {
  margin: 0;
  padding: 8px 6px;
  font-family: "Byotone", var(--sans);
  font-size: 12px;
  color: #7f9293;
}

.org-line-acc-head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px 8px;
  border: none;
  border-radius: 16px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: background 0.15s;
  box-sizing: border-box;
}

.org-line-acc-head:hover {
  background: rgba(255, 255, 255, 0.45);
}

.org-line-acc-head--open {
  border-radius: 16px 16px 0 0;
}

.org-line-acc-head--open .org-acc-chev {
  transform: rotate(90deg);
}

.org-line-acc-title-block,
.org-line-acc-supervisor-block {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 0;
  min-width: 0;
  flex: 1 1 0;
  line-height: 16px;
}

.org-line-acc-title-block {
  flex: 0 1 auto;
  min-width: 88px;
}

.org-line-acc-supervisor-block {
  flex: 1 1 120px;
  max-width: 220px;
}

.org-line-acc-meta-label {
  font-family: "Byotone", var(--sans);
  font-size: 10px;
  font-weight: 400;
  line-height: 16px;
  letter-spacing: 0.5px;
  color: #808191;
  text-transform: capitalize;
}

.org-line-acc-supervisor-names {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  width: 100%;
  min-width: 0;
}

.org-line-acc-supervisor-name {
  flex: 1 1 0;
  min-width: 0;
  font-family: "Byotone", var(--sans);
  font-size: 12px;
  font-weight: 200;
  line-height: 12px;
  color: #000;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.org-line-acc-supervisor-name--empty {
  color: #808191;
}

.org-line-acc-meta {
  flex-shrink: 0;
}

.org-line-path-stat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 10px 2px;
  max-width: 180px;
}

.org-line-path-stat .org-ic {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: #808191;
}

.org-line-path-text {
  font-family: "Byotone", var(--sans);
  font-size: 10px;
  font-weight: 400;
  line-height: 16px;
  letter-spacing: 0.5px;
  color: #808191;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.org-line-acc-body {
  background: #fff;
  padding: 10px 8px;
  box-sizing: border-box;
  width: 100%;
}

.org-line-acc-body--hidden {
  display: none;
}

.org-line-ws-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}


.org-acc-scroll {
  position: relative;
  border-top: 1px solid var(--org-border);
  border-bottom: 1px solid var(--org-border);
  padding: 6px;
  box-sizing: border-box;
  max-height: min(694px, 58vh);
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
  background: var(--org-surface);
  box-shadow: inset 0 -11px 11.2px rgba(17, 54, 62, 0.06);
}

.org-acc-scroll::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.88);
  pointer-events: none;
  z-index: 0;
}

.org-acc-scroll::-webkit-scrollbar {
  width: 8px;
}

.org-acc-scroll::-webkit-scrollbar-track {
  background: var(--org-surface);
  border-radius: 9px;
}

.org-acc-scroll::-webkit-scrollbar-thumb {
  background: var(--org-ink-deep);
  border-radius: 9px;
  min-height: 48px;
}

.org-acc-scroll {
  scrollbar-width: thin;
  scrollbar-color: var(--org-ink-deep) var(--org-surface);
}

.org-acc-root {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.org-acc-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid var(--org-border);
  border-radius: 12px;
  background: var(--org-surface);
  overflow: visible;
  width: 100%;
  box-sizing: border-box;
}

.org-acc-head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px 8px;
  border: none;
  border-radius: 16px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: background 0.15s;
  box-sizing: border-box;
}

.org-acc-head:hover {
  background: rgba(255, 255, 255, 0.45);
}

.org-acc-head--open {
  border-radius: 16px 16px 0 0;
}

.org-acc-chev {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: #000;
  transition: transform 0.2s;
}

.org-acc-chev .org-ic {
  display: block;
  width: 16px;
  height: 16px;
}

.org-acc-head--open .org-acc-chev {
  transform: rotate(90deg);
}

.org-acc-type-ic {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 4px 8px;
  border: 1px solid #ebedf0;
  border-radius: 6px;
  background: #fff;
  flex-shrink: 0;
  box-sizing: border-box;
}

.org-acc-type-ic--area {
  color: #7f9293;
}

.org-acc-type-ic--nested {
  width: 32px;
  height: 32px;
  color: #361e1c;
}

.org-acc-type-ic .org-ic {
  display: block;
  width: 16px;
  height: 16px;
}

.org-acc-type {
  font-family: "Byotone", var(--sans);
  font-size: 10px;
  font-weight: 400;
  line-height: 16px;
  letter-spacing: 0.5px;
  color: #808191;
  text-transform: capitalize;
  flex-shrink: 0;
}

.org-acc-name {
  flex: 1 1 0;
  font-family: "Byotone", var(--sans);
  font-size: 14px;
  font-weight: 400;
  line-height: 16px;
  color: #000;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.org-acc-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.org-acc-stat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 10px 2px;
  color: #361e1c;
}

.org-acc-stat .org-ic {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.org-acc-stat-num {
  font-family: "Byotone", var(--sans);
  font-size: 16px;
  font-weight: 500;
  line-height: 16px;
}

.org-acc-menu {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: #000;
}

.org-acc-menu .org-ic {
  display: block;
  width: 16px;
  height: 16px;
}

.org-area-menu-wrap {
  position: relative;
  flex-shrink: 0;
  margin-left: auto;
}

.org-area-menu-portal {
  position: fixed;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  min-width: 220px;
  padding: 12px 16px;
  border: 1px solid #7f9293;
  border-radius: 12px;
  background: #f5f5f5;
  box-shadow: 0 8px 24px rgba(54, 30, 28, 0.12);
  box-sizing: border-box;
}

.org-area-menu-portal.hidden {
  display: none;
}

.org-acc-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #000;
  cursor: pointer;
}

.org-acc-menu-btn:hover,
.org-acc-menu-btn[aria-expanded="true"] {
  background: rgba(0, 0, 0, 0.06);
}

.org-area-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 30;
  display: none;
}

.org-area-menu-item {
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  color: #361e1c;
  font-family: "Byotone", var(--sans);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  text-align: center;
  cursor: pointer;
}

.org-area-menu-item:hover {
  opacity: 0.75;
}

.org-acc-body {
  background: #fff;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-sizing: border-box;
  width: 100%;
  overflow: hidden;
  border-radius: 0 0 12px 12px;
}

.org-acc-body--hidden {
  display: none;
}

.org-nested-divider {
  height: 1px;
  width: 100%;
  background: #ebedf0;
  flex-shrink: 0;
}

.org-nested-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border-radius: 10px;
  background: #fff;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
}

.org-nested-row--workstation {
  background: transparent;
}

.org-branch-head {
  width: 100%;
  border: none;
  background: #fff;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: background 0.15s;
}

.org-branch-head:hover {
  background: rgba(255, 255, 255, 0.85);
}

.org-branch-head--open .org-nested-chev {
  transform: rotate(90deg);
}

.org-nested-row--branch:not(.org-branch-head) .org-nested-chev,
.org-branch-head:not(.org-branch-head--open) .org-nested-chev {
  transform: none;
}

.org-branch-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--org-sage-2);
  box-sizing: border-box;
  width: 100%;
}

.org-branch-panel .org-nested-row--workstation {
  background: transparent;
}

.org-tree-connector {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 13px;
  height: 11px;
  flex-shrink: 0;
  color: var(--org-border-strong);
}

.org-tree-connector-ic {
  display: block;
  width: 13px;
  height: 11px;
}

.org-nested-row--tree {
  padding-left: 0;
}

.org-nested-chev {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  flex-shrink: 0;
  color: #000;
}

.org-nested-chev .org-ic {
  display: block;
  width: 16px;
  height: 16px;
}

.org-simple-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.org-line-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #c5dad3;
  border-radius: 10px;
}

.org-line-ctx {
  font-family: "Byotone", var(--sans);
  font-size: 12px;
  color: #7f9293;
  margin-left: auto;
}

.org-detail-empty {
  padding: 40px 28px 48px;
  text-align: center;
  font-family: "Byotone", var(--sans);
  color: var(--org-ink);
  background: #fff;
  border: 1px solid var(--org-border);
  border-radius: 16px;
  box-shadow: 0 1px 4px rgba(54, 30, 28, 0.07);
  max-width: 420px;
  margin: 0 auto;
}

.org-detail-empty-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
  color: var(--org-border-strong);
  opacity: 0.85;
}

.org-detail-empty-icon .org-ic {
  width: 48px;
  height: 48px;
}

.org-detail-empty-title {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--org-ink);
}

.org-detail-empty-text {
  margin: 0;
  font-size: 15px;
  font-weight: 300;
  line-height: 1.5;
  color: #000;
}

.org-ic {
  display: block;
}

/* Narrow left panel: avoid overlap; hide row stats before the vertical divider */
@container org-left (max-width: 520px) {
  .org-structure-view .org-plants-head {
    align-items: flex-start;
  }

  .org-plants-title-row {
    flex: 1 1 100%;
    max-width: 100%;
  }

  .org-structure-view .org-plants-head .org-plants-add-btn {
    align-self: flex-end;
  }
}

@container org-left (max-width: 400px) {
  .org-plant-meta {
    display: none;
  }

  .org-plant-row {
    gap: 8px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .org-plant-go {
    padding: 10px 12px;
  }

  .org-brand-line {
    font-size: 28px;
  }

  .org-stat-card {
    width: min(152px, 100%);
  }
}

@container org-left (max-width: 340px) {
  .org-plants-title {
    font-size: 16px;
  }

  .org-plant-name {
    font-size: 16px;
  }

  .org-structure-view .org-plants-head .org-plants-add-btn {
    font-size: 13px;
    padding: 10px 12px;
  }

  .org-hero-actions .org-btn {
    font-size: 12px;
    padding: 10px 12px;
  }
}

@media (max-width: 900px) {
  .org-structure-view .rsv-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(200px, 1fr);
  }

  .org-structure-view .org-splitter {
    display: none;
  }

  .org-structure-view .rsv-left {
    border-right: none;
    border-bottom: 1px solid #7f9293;
  }
}

.hierarchy-root {
  display: grid;
  gap: 12px;
}

.h-node {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 10px;
  position: relative;
}

.h-node::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 14px;
  width: 8px;
  height: 2px;
  background: #b9a991;
}

.h-line::before {
  display: none;
}

.h-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: var(--mono);
}

.h-title {
  font-weight: 700;
  margin-top: 2px;
}

.h-children {
  margin-top: 10px;
  margin-left: 12px;
  padding-left: 10px;
  border-left: 2px solid #d7c8b4;
  display: grid;
  gap: 10px;
}

.h-block {
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 8px;
  background: #fffdf9;
}

.h-subtitle {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}

.h-item {
  font-size: 12px;
  margin-bottom: 6px;
}

.h-inline-list {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.h-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  background: #fff;
}

body.auth-page {
  background: #f2ece0;
}

.login-overlay {
  --login-page-bg: #2b1c18;
  --login-card-bg: #f2f2e6;
  --login-ink: #1a120e;
  --login-muted: #5c534c;
  --login-primary: #ff6038;
  --login-link: #0a8f9a;
  --login-field-bg: #f5f5f0;
  --login-field-border: #e4e4e4;
  --login-hero-font: "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --login-ui-font: "Inter", var(--sans);
  /* SDS typography tokens (Figma Temporis Pro 2026 — subheading medium) */
  --sds-typography-subheading-size-medium: 20px;
  --sds-typography-subheading-font-weight: 400;

  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 40px);
  background: rgba(43, 28, 24, 0.55);
  backdrop-filter: blur(8px);
}

body.auth-page .login-overlay {
  position: static;
  min-height: 100vh;
  inset: auto;
  padding: clamp(20px, 5vw, 48px) clamp(14px, 4vw, 32px);
  background: #f2ece0;
  backdrop-filter: none;
}

.login-card {
  display: flex;
  align-items: stretch;
  gap: clamp(20px, 2.8vw, 32px);
  width: min(1100px, 100%);
  max-height: min(700px, calc(100vh - 32px));
  padding: clamp(22px, 2.8vw, 36px);
  overflow: hidden;
  border-radius: 20px;
  background: #f2ece0;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.06), 0 24px 48px rgba(0, 0, 0, 0.35);
  font-family: var(--login-ui-font);
  color: var(--login-ink);
  box-sizing: border-box;
}

@media (min-width: 901px) {
  .login-card {
    min-height: min(600px, calc(100vh - 96px));
  }
}

body.auth-page .login-card {
  background: transparent;
  box-shadow: none;
}

.login-card__form {
  flex: 1 1 50%;
  min-width: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.login-form-inner {
  flex: 1;
  width: 100%;
  max-width: 560px;
  margin: 0;
  padding: clamp(12px, 1.5vw, 20px) clamp(8px, 1.2vw, 16px) clamp(12px, 1.5vw, 24px) 0;
  box-sizing: border-box;
}

.login-marketing-header {
  margin-bottom: 28px;
}

.login-logo {
  display: block;
  width: min(240px, 100%);
  height: auto;
  margin-bottom: 28px;
}

.lang-select {
  border: 1.5px solid var(--login-field-border);
  border-radius: 8px;
  padding: 6px 10px;
  background: var(--login-field-bg);
  color: var(--login-ink);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
  height: 32px;
  margin-top: 6px;
}
.lang-select:focus-visible {
  border-color: var(--login-primary);
}

/* Base heading (TOTP steps, etc.) */
.login-heading {
  margin: 0;
  color: var(--login-ink);
}

/*
 * Login screen title — Figma Temporis Pro 2026 node 945:4426
 * https://www.figma.com/design/N2kKZWHMrJsqLiYFrrA8e7/Temporis-Pro-2026?node-id=945-4426
 */
.login-marketing-header .login-heading {
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #000;
  font-family: "Byotone";
  font-size: 40px;
  font-style: normal;
  font-weight: 400;
  line-height: 100%; /* 40px */
  letter-spacing: 2px;
  text-transform: uppercase;
  vertical-align: middle;
  leading-trim: none;
}

.login-heading--compact {
  font-family: var(--login-ui-font);
  font-size: clamp(1.25rem, 3.5vw, 1.625rem);
  line-height: 1.1;
  letter-spacing: normal;
  text-transform: none;
  font-weight: 400;
}

.login-subheading {
  margin: 10px 0 0;
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--login-muted);
}

/*
 * Login welcome line — Figma Temporis Pro 2026 node 945:4427
 * https://www.figma.com/design/N2kKZWHMrJsqLiYFrrA8e7/Temporis-Pro-2026?node-id=945-4427
 */
.login-marketing-header .login-subheading {
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: 10px 0 0;
  color: #000;
  font-family: "Byotone", var(--login-ui-font);
  font-size: var(--sds-typography-subheading-size-medium);
  font-style: normal;
  font-weight: var(--sds-typography-subheading-font-weight);
  line-height: 1.2;
}

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

/*
 * Field labels (Email, Contraseña, etc.) — Figma node 945:4430
 * https://www.figma.com/design/N2kKZWHMrJsqLiYFrrA8e7/Temporis-Pro-2026?node-id=945-4430
 */
.login-card .login-form label,
.login-card .totp-panel label {
  gap: 8px;
  font-family: "Byotone", var(--login-ui-font);
  font-size: 14px;
  font-style: normal;
  font-weight: 400;
  line-height: 16px;
  color: #000;
  white-space: nowrap;
}

/*
 * Login / TOTP inputs — Figma 945:4431 (field) + 945:4432 (placeholder text)
 * https://www.figma.com/design/N2kKZWHMrJsqLiYFrrA8e7/Temporis-Pro-2026?node-id=945-4431
 */
.login-card .login-form input,
.login-card .totp-panel input {
  box-sizing: border-box;
  border: 1.5px solid var(--login-field-border);
  border-radius: 12px;
  padding: 16px;
  background: var(--login-field-bg);
  color: var(--login-ink);
  font-family: "Byotone", var(--login-ui-font);
  font-size: 14px;
  font-style: normal;
  font-weight: 400;
  line-height: 16px;
}

.login-card .login-form input::placeholder,
.login-card .totp-panel input::placeholder {
  color: #808191;
  font-family: "Byotone", var(--login-ui-font);
  font-size: 14px;
  line-height: 16px;
}

.login-input-wrap--with-action {
  position: relative;
  display: block;
  width: 100%;
}

.login-input-wrap--with-action input {
  width: 100%;
  padding-right: 48px;
}

.login-field-action {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #808191;
  cursor: pointer;
}

.login-field-action:hover {
  color: var(--login-ink);
}

.login-field-action:focus-visible {
  outline: 2px solid var(--login-primary);
  outline-offset: 2px;
}

.login-field-action svg {
  display: block;
}

.field-error {
  margin: 0;
  font-size: 12px;
  color: var(--warn);
  min-height: 0;
}

/*
 * Primary submit — Figma 945:4437 (button) + 945:4438 (label)
 * https://www.figma.com/design/N2kKZWHMrJsqLiYFrrA8e7/Temporis-Pro-2026?node-id=945-4437
 */
.login-submit-btn {
  margin-top: 4px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border-radius: 12px;
  border: none;
  background: #ff6038 !important;
  color: #fff !important;
  font-family: "Byotone", var(--login-ui-font);
  font-size: 14px;
  font-style: normal;
  font-weight: 500;
  line-height: 20px;
  text-align: center;
  text-transform: uppercase;
  cursor: pointer;
  box-sizing: border-box;
}

.login-submit-btn:hover {
  filter: brightness(1.04);
}

.login-submit-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  filter: none;
}

.login-forgot {
  text-align: center;
  font-size: 0.75rem;
  color: var(--login-muted);
  text-decoration: none;
}

.login-forgot:hover {
  color: var(--login-ink);
  text-decoration: underline;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 20px 0 4px;
  font-size: 0.75rem;
  color: var(--login-muted);
}

.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #c8c4bc;
}

.login-divider span {
  white-space: nowrap;
}

.login-footer-signup {
  margin: 20px 0 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--login-muted);
}

.login-footer-signup-link {
  margin-left: 4px;
  font-weight: 600;
  color: var(--login-primary);
  text-decoration: none;
}

.login-footer-signup-link:hover {
  text-decoration: underline;
}

.oauth-row {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

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

@media (max-width: 520px) {
  .oauth-row--split {
    grid-template-columns: 1fr;
  }
}

.oauth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fff;
  color: var(--login-ink);
  border: 1px solid #c8c4bc;
  font-weight: 600;
  font-size: 0.72rem;
  cursor: pointer;
}

.oauth-btn:hover {
  background: #fafaf8;
}

.oauth-ms {
  border-color: #c8c4bc;
}

.oauth-svg {
  flex-shrink: 0;
}

.oauth-ms-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.ms-tl {
  background: #f25022;
}
.ms-tr {
  background: #7fba00;
}
.ms-bl {
  background: #00a4ef;
}
.ms-br {
  background: #ffb900;
}

/*
 * Hero panel — Figma Temporis Pro 2026 node 945:4488
 * https://www.figma.com/design/N2kKZWHMrJsqLiYFrrA8e7/Temporis-Pro-2026?node-id=945-4488
 * (Mortend Bold → Bebas Neue; Byotone Light → weight 300 with Byotone fallback)
 */
.login-card__hero {
  position: relative;
  flex: 1 1 50%;
  min-width: min(100%, 300px);
  min-height: 0;
  align-self: stretch;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 1px 4px 0 rgba(12, 12, 13, 0.1), 0 1px 4px 0 rgba(12, 12, 13, 0.05);
}

.login-card__hero-backdrop {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  overflow: hidden;
}

.login-card__hero-conic {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: conic-gradient(
    from 180deg at 50% 50%,
    #361e1c 0deg,
    #ff6038 57.11deg,
    #9a3f2a 166.15deg,
    #361e1c 360deg
  );
}

.login-card__hero-photo-wrap {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0.45;
  overflow: hidden;
  border-radius: inherit;
}

.login-card__hero-photo {
  position: absolute;
  height: 143.82%;
  width: 283.7%;
  left: -111.56%;
  top: -14.58%;
  max-width: none;
  background-image: url("/statics/hero.jpg");
  background-size: cover;
  background-position: center;
}

.login-card__hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  gap: clamp(12px, 1.8vw, 18px);
  height: 100%;
  min-height: 100%;
  box-sizing: border-box;
  /* top padding takes up ~50% so text stays in the bottom half */
  padding: 50% clamp(22px, 3.5vw, 40px) clamp(28px, 4vw, 44px);
  color: #f4f5f7;
}

/*
 * Hero headline — Figma node 945:4491 (Mortend Bold)
 * https://www.figma.com/design/N2kKZWHMrJsqLiYFrrA8e7/Temporis-Pro-2026?node-id=945-4491
 */
.login-card__hero-title {
  margin: 0;
  max-width: min(100%, 34rem);
  font-family: "Mortend", "Bebas Neue", var(--login-hero-font);
  font-size: 40px;
  font-style: normal;
  font-weight: 700;
  line-height: 121%;
  letter-spacing: 3.2px;
  text-transform: uppercase;
  color: #f4f5f7;
  leading-trim: both;
  text-edge: cap;
}

/*
 * Hero lead — Figma node 945:4492 (Byotone Light)
 * https://www.figma.com/design/N2kKZWHMrJsqLiYFrrA8e7/Temporis-Pro-2026?node-id=945-4492
 */
.login-card__hero-lead {
  margin: 0;
  max-width: min(100%, 32rem);
  width: 100%;
  font-family: Byotone;
  font-size: 28px;
  font-style: normal;
  font-weight: 300;
  line-height: 140%;
  text-align: left;
  color: #f4f5f7;
  leading-trim: both;
  text-edge: cap;
}

/*
 * Hero body copy — Figma node 945:4493 (Byotone Light, 20px)
 * https://www.figma.com/design/N2kKZWHMrJsqLiYFrrA8e7/Temporis-Pro-2026?node-id=945-4493
 */
.login-card__hero-copy {
  margin: 0;
  max-width: min(100%, 38rem);
  width: 100%;
  font-family: "Byotone", var(--login-ui-font);
  font-size: clamp(0.7rem, 0.5vw + 0.4rem, 0.85rem);
  font-weight: 300;
  font-style: normal;
  line-height: 1.45;
  text-align: left;
  color: #f4f5f7;
}

@media (max-width: 900px) {
  .login-card {
    flex-direction: column;
    max-height: none;
    min-height: 0;
    padding: clamp(16px, 4vw, 24px);
    gap: clamp(16px, 4vw, 24px);
  }

  .login-form-inner {
    padding: clamp(8px, 2vw, 16px) 0;
    max-width: none;
  }

  .login-card__hero {
    flex: none;
    order: -1;
    width: 100%;
    min-width: 0;
    min-height: 200px;
    max-height: min(42vh, 320px);
    border-radius: 12px;
    box-shadow: none;
  }

  .login-card__hero-content {
    justify-content: center;
    gap: 10px;
    padding: clamp(16px, 4vw, 24px);
  }

  .login-card__hero-title {
    max-width: none;
    font-size: clamp(1.2rem, 5vw, 1.65rem);
    letter-spacing: 0.05em;
    line-height: 1.15;
  }

  .login-card__hero-lead {
    max-width: none;
    font-size: clamp(0.9rem, 3.2vw, 1.05rem);
    line-height: 1.35;
  }

  .login-card__hero-copy {
    display: none;
  }
}

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

.login-card .totp-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  align-self: flex-start;
  margin: 0 0 4px;
  padding: 4px 2px;
  border: none;
  background: none;
  font-family: "Byotone", var(--sans);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  color: #361e1c;
  cursor: pointer;
  transition: color 0.2s ease;
}

.login-card .totp-back-btn:hover:not(:disabled) {
  color: var(--primary);
}

.login-card .totp-back-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.login-card .totp-back-btn:focus-visible {
  outline: 2px solid rgba(54, 30, 28, 0.35);
  outline-offset: 3px;
  border-radius: 4px;
}

.login-card .totp-back-btn svg {
  flex: none;
}

.totp-kicker {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.totp-email {
  display: block;
  margin-top: 6px;
  font-weight: 600;
  color: var(--ink);
}

.totp-setup-grid {
  display: grid;
  gap: 16px;
}

@media (min-width: 640px) {
  .totp-setup-grid {
    grid-template-columns: 220px 1fr;
    align-items: start;
  }
}

.totp-qr-wrap {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  background: #fffdf9;
  justify-self: center;
}

/* ── Machines Module ── */

/* Tipografía alineada al sidebar (nav: Poppins 13px, -0.03em) */
.machines-view {
  font-family: "Poppins", var(--sans);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.machines-view .machines-header .panel-head h2 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.machines-view .machines-subtitle,
.machines-view .machines-filter-field-label {
  font-family: "Poppins", var(--sans);
  letter-spacing: -0.03em;
}

.machines-view .machines-filter-sensors,
.machines-view .machines-filter-search,
.machines-view .machines-plant-search {
  font-family: "Poppins", var(--sans);
  font-size: 13px;
  letter-spacing: -0.03em;
}

.machines-view .machine-card {
  font-family: "Poppins", var(--sans);
  letter-spacing: -0.03em;
}

.machines-view .mc-name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.machines-view .mc-type-label {
  font-size: 13px;
  font-weight: 600;
}

.machines-view .mc-plant,
.machines-view .mc-vel-nominal,
.machines-view .mc-status,
.machines-view .mc-status span,
.machines-view .mc-sensor-meta,
.machines-view .mc-sensor-meta span,
.machines-view .mc-sensor-empty,
.machines-view .machines-empty {
  font-family: "Poppins", var(--sans);
  letter-spacing: -0.03em;
}

.machines-view .mc-plant {
  font-size: 13px;
}

.machines-view .mc-sensor-name {
  font-family: "Poppins", var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.machines-view .machines-detail-panel h3,
.machines-view .machines-detail-panel .machines-subtitle,
.machines-view .machines-detail-panel .sensor-item,
.machines-view .machines-detail-panel .sensor-item-name {
  font-family: "Poppins", var(--sans);
  letter-spacing: -0.03em;
}

.machines-header .panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.machines-header .panel-head h2 {
  margin: 0;
}

.machines-subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  color: #6b7280;
}

.machines-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.machines-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.machines-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 24px;
  color: #6b7280;
  font-size: 14px;
  background: #fff;
  border: 2px dashed #e5e7eb;
  border-radius: 12px;
}

/* ── Machine Card (matches Next.js design) ── */

.machine-card {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  cursor: default;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.2s ease, transform 0.15s ease;
  display: flex;
  flex-direction: column;
  min-height: 280px;
}

.machine-card:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.machine-card.selected {
  box-shadow: 0 0 0 2px #3b82f6, 0 8px 30px rgba(59, 130, 246, 0.12);
}

.mc-top {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 16px;
}

.mc-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;
}

.mc-status svg {
  color: #6b7280;
}

.mc-top--live .mc-status {
  color: #2ecc71;
}

.mc-top--live .mc-status svg {
  color: #2ecc71;
}

.mc-title-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-bottom: 8px;
  min-width: 0;
}

.mc-name {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  color: #111;
  line-height: 1.15;
  letter-spacing: -0.02em;
  min-width: 0;
  flex: 1 1 auto;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.mc-type-label {
  font-size: 16px;
  font-weight: 600;
  color: #374151;
  white-space: nowrap;
}

.mc-plant {
  margin: 0 0 12px;
  font-size: 14px;
  color: #111;
}

.mc-plant:has(+ .mc-vel-nominal-row) {
  margin-bottom: 6px;
}

.mc-vel-nominal-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 12px;
  min-width: 0;
}

.mc-vel-nominal {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 13px;
  line-height: 1.35;
}

.mc-vel-nominal-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}

.mc-vel-nominal-value {
  font-weight: 700;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

.mc-vel-nominal-unit {
  font-size: 12px;
  font-weight: 500;
  color: #94a3b8;
}

.mc-vel-nominal-edit {
  flex-shrink: 0;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #2563eb;
  cursor: pointer;
  font-family: "Poppins", var(--sans);
}

.mc-vel-nominal-edit:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.mc-velnom-modal-layer {
  position: fixed;
  inset: 0;
  z-index: 1150;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.mc-velnom-modal-layer.hidden {
  display: none;
}

.mc-velnom-modal {
  position: relative;
  width: min(400px, 100%);
  background: #fff;
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

.mc-velnom-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 22px;
  line-height: 1;
  padding: 4px 8px;
}

.mc-velnom-modal-title {
  margin: 0 0 8px;
  padding-right: 32px;
  font-size: 18px;
  font-weight: 700;
  color: #111;
}

.mc-velnom-modal-hint {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.45;
  color: #64748b;
}

.mc-velnom-modal-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
}

.mc-velnom-modal-label input {
  width: 100%;
  margin-top: 6px;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
}

.mc-velnom-modal-err {
  min-height: 1.25rem;
  margin: 8px 0 0;
  font-size: 12px;
  color: #b91c1c;
}

.mc-velnom-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.mc-sensor-block {
  flex: 1;
  margin: 0 0 12px;
  min-height: 0;
}

.mc-sensor-empty {
  margin: 0 0 8px;
  font-size: 13px;
  color: #6b7280;
}

.mc-sensor-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 4px;
}

.mc-sensor-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid #f3f4f6;
}

.mc-sensor-row:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.mc-sensor-row-main {
  min-width: 0;
  width: 100%;
}

.mc-sensor-name {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}

.mc-sensor-name-text {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.mc-sensor-name svg {
  flex-shrink: 0;
  margin-top: 2px;
}

.mc-sensor-name--active {
  color: #2ecc71;
}

.mc-sensor-name--active svg {
  color: #2ecc71;
}

.mc-sensor-name--stale {
  color: #dc2626;
}

.mc-sensor-name--stale svg {
  color: #dc2626;
}

.mc-sensor-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin-top: 6px;
  margin-left: 22px;
  font-size: 11px;
  color: #6b7280;
}

.mc-sensor-dot {
  color: #d1d5db;
}

.mc-sensor-loc {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
  color: #6b7280;
}

.mc-sensor-loc--api {
  color: #2563eb;
}

.mc-sensor-loc--manual {
  color: #6b7280;
}

.mc-wifi-ic {
  flex-shrink: 0;
}

.mc-sensor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
  justify-content: flex-start;
  align-items: center;
}

.mc-sensor-detail-btn,
.mc-sensor-manual-btn {
  font-size: 11px;
  font-weight: 600;
  padding: 6px 10px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background: #f3f4f6;
  color: #1f2937;
  font-family: inherit;
  transition: background 0.15s ease;
}

.mc-sensor-detail-btn:hover,
.mc-sensor-manual-btn:hover {
  background: #e5e7eb;
}

.mc-sensor-api-btn {
  font-size: 11px;
  font-weight: 600;
  padding: 6px 10px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background: #eff6ff;
  color: #1d4ed8;
  font-family: inherit;
  transition: background 0.15s ease;
}

.mc-sensor-api-btn:hover {
  background: #dbeafe;
}

.mc-api-modal-layer {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.mc-api-modal-layer.hidden {
  display: none;
}

.mc-api-modal {
  position: relative;
  width: min(520px, 100%);
  max-height: min(90vh, 720px);
  overflow-y: auto;
  background: #fff;
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

.mc-api-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 22px;
  line-height: 1;
  padding: 4px 8px;
}

.mc-api-modal-title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
  color: #111;
  padding-right: 36px;
}

.mc-api-modal-intro {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.45;
  color: #4b5563;
}

.mc-api-modal-name {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
  color: #111;
}

.mc-api-modal-no-token {
  margin: 0 0 14px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.45;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
}

.mc-api-modal-no-token code {
  font-size: 11px;
  word-break: break-all;
}

.mc-api-modal-section {
  margin-bottom: 16px;
}

.mc-api-modal-section-title {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #1e293b;
  margin-bottom: 4px;
}

.mc-api-modal-help {
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.45;
  color: #64748b;
}

.mc-api-modal-help code {
  font-size: 11px;
  background: #f1f5f9;
  padding: 1px 5px;
  border-radius: 4px;
}

.mc-api-modal-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.mc-api-modal-row .mc-api-modal-input {
  flex: 1;
  min-width: 0;
}

.mc-api-modal-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 4px;
}

.mc-api-modal-input {
  width: 100%;
  box-sizing: border-box;
  font-size: 12px;
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 0;
  font-family: ui-monospace, monospace;
  background: #f9fafb;
}

.mc-api-modal-input::placeholder {
  color: #94a3b8;
  font-family: "Poppins", var(--sans);
}

.mc-api-modal-copy {
  flex-shrink: 0;
  align-self: stretch;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #2563eb;
  cursor: pointer;
  font-family: "Poppins", var(--sans);
}

.mc-api-modal-copy:hover:not(:disabled) {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.mc-api-modal-copy:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.mc-api-modal-copy--wide {
  width: 100%;
  margin-top: 8px;
  padding: 8px 12px;
}

.mc-api-modal-token-msg {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: #15803d;
}

.mc-api-modal-token-msg--error {
  color: #b91c1c;
}

.mc-api-modal-regenerate {
  margin-top: 10px;
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  font-family: "Poppins", var(--sans);
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #0f172a;
  cursor: pointer;
}

.mc-api-modal-regenerate:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.mc-api-modal-regenerate:disabled {
  opacity: 0.65;
  cursor: wait;
}

.mc-api-modal-curl {
  margin: 0;
  padding: 12px;
  font-size: 11px;
  line-height: 1.5;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 8px;
  overflow-x: auto;
  border: 1px solid #1e293b;
}

.mc-api-modal-curl code {
  font-family: ui-monospace, monospace;
  white-space: pre;
  word-break: normal;
}

.mc-api-modal-last {
  margin: 16px 0 0;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
  font-size: 12px;
  color: #4b5563;
  line-height: 1.4;
}

.mc-api-modal-last-value {
  font-weight: 500;
  color: #111;
}

/* Modal agregar sensor — mismo formulario / botón primario que login */
/* Variables de login (en app autenticada no existe .login-overlay; sin esto los inputs quedan sin estilo) */
.mc-add-sensor-modal-layer,
.login-card.mc-add-sensor-modal {
  --login-ink: #1a120e;
  --login-primary: #ff6038;
  --login-field-bg: #f5f5f0;
  --login-field-border: #e4e4e4;
  --login-ui-font: "Inter", var(--sans);
}

.mc-add-sensor-modal-layer {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.mc-add-sensor-modal-layer.hidden {
  display: none;
}

.mc-add-sensor-modal.login-card {
  position: relative;
  width: min(420px, 100%);
  max-width: 100%;
  max-height: min(90vh, 640px);
  min-height: 0 !important;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
  padding: 24px;
  overflow-x: hidden;
  overflow-y: auto;
}

@media (min-width: 901px) {
  .login-card.mc-add-sensor-modal {
    min-height: auto !important;
  }
}

.mc-add-sensor-modal-title {
  margin: 0 32px 0 0;
  font-family: "Byotone", var(--login-ui-font);
  font-size: 16px;
  font-weight: 500;
  color: #000;
}

.mc-add-sensor-modal-machine {
  margin: 0 0 8px;
  color: var(--muted);
  font-family: "Poppins", var(--sans);
  font-size: 13px;
  line-height: 1.4;
}

.mc-add-sensor-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 22px;
  line-height: 1;
  padding: 4px 8px;
}

.login-card.mc-add-sensor-modal .mc-add-sensor-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  min-width: 0;
}

.login-card.mc-add-sensor-modal .mc-add-sensor-field {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  min-width: 0;
  margin: 0;
  white-space: normal;
  font-family: "Byotone", var(--login-ui-font);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.3;
  color: #000;
}

.login-card.mc-add-sensor-modal .mc-add-sensor-field input,
.login-card.mc-add-sensor-modal .mc-add-sensor-field select {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1.5px solid var(--login-field-border);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--login-field-bg);
  color: var(--login-ink);
  font-family: "Byotone", var(--login-ui-font);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.25;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.login-card.mc-add-sensor-modal .mc-add-sensor-field input {
  cursor: text;
}

.login-card.mc-add-sensor-modal .mc-add-sensor-field input::placeholder {
  color: #808191;
}

.login-card.mc-add-sensor-modal .mc-add-sensor-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

.login-card.mc-add-sensor-modal .mc-add-sensor-field input:focus,
.login-card.mc-add-sensor-modal .mc-add-sensor-field select:focus {
  outline: none;
  border-color: var(--login-primary);
  box-shadow: 0 0 0 3px rgba(255, 96, 56, 0.2);
}

.login-card.mc-add-sensor-modal .mc-add-sensor-form .login-submit-btn {
  margin-top: 4px;
}

.machines-view .mc-add-sensor-btn.login-submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  margin-top: auto;
}

.machines-view .machines-detail-panel .mc-add-sensor-btn--panel {
  width: 100%;
}

.machines-view .mc-add-sensor-btn svg {
  flex-shrink: 0;
}

/* ── Detail Panel ── */

.machines-detail-panel {
  width: 380px;
  min-width: 380px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 24px;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  position: sticky;
  top: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.machines-detail-panel.hidden {
  display: none;
}

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

.detail-header h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #111;
}

.detail-close-btn {
  font-size: 20px;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 8px;
  color: #9ca3af;
  flex-shrink: 0;
}

.detail-close-btn:hover {
  color: #374151;
}

/* ── Sensor List ── */

.machine-workstations {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.machine-workstations__head h4 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

.machine-workstations__list {
  display: grid;
  gap: 12px;
}

.machine-workstation-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f8fafc;
  padding: 14px;
}

.machine-workstation-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.machine-workstation-card__top h5 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 700;
  color: #111827;
}

.machine-workstation-workers {
  display: grid;
  gap: 10px;
}

.machine-workstation-worker {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
}

.machine-workstation-worker strong {
  display: block;
  margin-bottom: 2px;
  font-size: 13px;
  color: #111827;
}

.machine-workstation-worker__meta {
  display: grid;
  justify-items: end;
  gap: 4px;
  text-align: right;
}

.sensor-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sensor-item {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.sensor-item:hover {
  border-color: #bfdbfe;
  background: rgba(59, 130, 246, 0.02);
}

.sensor-item-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.sensor-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sensor-item-left svg {
  color: #10b981;
  flex-shrink: 0;
}

.sensor-item-name {
  font-weight: 600;
  font-size: 13px;
  color: #111;
}

.sensor-item-type {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 5px;
  background: #f3f4f6;
  color: #6b7280;
}

.sensor-reading-form {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
}

.sensor-reading-form input[type="number"] {
  flex: 1;
  padding: 6px 10px;
  font-size: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f9fafb;
  color: #111;
  font-family: inherit;
}

.sensor-reading-form button {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 8px;
}

/* ── Sensor Form ── */

.sensor-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sensor-form.hidden {
  display: none;
}

.sensor-form label {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  margin-bottom: -6px;
}

.sensor-form input,
.sensor-form select {
  padding: 10px 12px;
  font-size: 13px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  color: #111;
  font-family: inherit;
}

.sensor-form input:focus,
.sensor-form select:focus {
  outline: none;
  border-color: #4d7cff;
  box-shadow: 0 0 0 3px rgba(77, 124, 255, 0.12);
}

.sensor-form button[type="submit"] {
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  background: #4d7cff;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease;
  margin-top: 4px;
  font-family: inherit;
}

.sensor-form button[type="submit"]:hover {
  background: #3d65de;
}

.sensor-form button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* —— Machines filters (barra compacta, planta multiselect + autocompletar) —— */
.machines-filters--compact {
  display: grid;
  grid-template-columns: minmax(200px, 1.4fr) minmax(120px, 0.55fr) minmax(160px, 1fr);
  gap: 10px 14px;
  align-items: end;
  padding: 10px 0 12px;
  margin-bottom: 6px;
  border-bottom: 1px solid #e2e8f0;
}

@media (max-width: 960px) {
  .machines-filters--compact {
    grid-template-columns: 1fr;
  }
}

.machines-filter-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.machines-filter-field-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.machines-filter-sensors,
.machines-filter-search {
  height: 34px;
  padding: 0 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  background: #fff;
  box-sizing: border-box;
}

.machines-filter-search {
  width: 100%;
  min-width: 0;
}

.machines-filter-sensors {
  width: 100%;
  cursor: pointer;
}

.machines-filter-search:focus,
.machines-filter-sensors:focus {
  outline: none;
  border-color: #cbd5e1;
  box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.25);
}

.machines-plant-combo {
  position: relative;
  min-width: 0;
}

.machines-plant-input-row {
  display: flex;
  align-items: stretch;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  min-height: 34px;
}

.machines-plant-input-row:focus-within {
  border-color: #cbd5e1;
  box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.25);
}

.machines-plant-search {
  flex: 1;
  min-width: 0;
  border: none;
  padding: 6px 10px;
  font-size: 13px;
  font-family: "Poppins", var(--sans);
  background: transparent;
  color: var(--ink);
}

.machines-plant-search::placeholder {
  color: #94a3b8;
}

.machines-plant-search:focus {
  outline: none;
}

.machines-plant-toggle {
  flex-shrink: 0;
  width: 36px;
  border: none;
  border-left: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.machines-plant-toggle:hover {
  background: #f1f5f9;
  color: var(--ink);
}

.machines-plant-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 40;
  max-height: 220px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
  padding: 6px 0;
}

.machines-plant-dropdown.hidden {
  display: none;
}

.machines-plant-opt {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink);
  margin: 0;
}

.machines-plant-opt:hover {
  background: #f8fafc;
}

.machines-plant-opt input {
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: #2563eb;
}

.machines-plant-opt span {
  flex: 1;
  min-width: 0;
  line-height: 1.35;
  word-break: break-word;
}

.machines-plant-empty {
  padding: 12px;
  font-size: 12px;
  color: #94a3b8;
  text-align: center;
}

.machines-plant-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 0;
  min-height: 0;
}

.machines-plant-chips:not(:empty) {
  margin-top: 6px;
  min-height: 22px;
}

.machines-plant-clear-all {
  border: none;
  background: none;
  padding: 0;
  font-size: 11px;
  font-weight: 600;
  color: #2563eb;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.machines-plant-clear-all:hover {
  color: #1d4ed8;
}

.machines-plant-chips-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.machines-plant-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 2px 4px 2px 8px;
  border-radius: 6px;
  background: #eef4ff;
  border: 1px solid #dbeafe;
  font-size: 11px;
  color: #1e40af;
}

.machines-plant-chip-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 160px;
}

.machines-plant-chip-remove {
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 4px;
  border-radius: 4px;
}

.machines-plant-chip-remove:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--ink);
}

.sensor-item-actions {
  margin-top: 10px;
}

.sensor-detail-btn {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
  cursor: pointer;
  font-family: inherit;
}

.sensor-detail-btn:hover {
  background: #dbeafe;
}

body.layout-sensor-detail .module-root {
  max-width: 100%;
}

.sensor-detail-page--full {
  width: 100%;
  max-width: none;
  margin: 0;
  min-width: 0;
  box-sizing: border-box;
}

.sensor-detail-back-row {
  margin-bottom: 12px;
}

.sensor-detail-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  font-family: inherit;
}

.sensor-detail-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
}

.sensor-detail-card--wide {
  width: 100%;
}

.sensor-detail-card-head {
  padding: 20px 20px 0;
}

.sensor-detail-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
}

.sensor-detail-sub {
  margin: 6px 0 0;
  font-size: 13px;
  color: #64748b;
}

.sensor-detail-card-body {
  padding: 16px 20px 24px;
}

.sensor-detail-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.sensor-detail-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  font-family: inherit;
}

.sensor-detail-tab--active {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
}

.sensor-detail-tab-ic {
  flex-shrink: 0;
}

.sensor-detail-panel.hidden {
  display: none;
}

.sdp-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  margin-bottom: 16px;
}

.sdp-strip--ok {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.sdp-strip--warn {
  background: #fffbeb;
  border-color: #fde68a;
}

.sdp-pulse {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
  animation: sdp-pulse 1.8s ease-in-out infinite;
}

.sdp-strip--warn .sdp-pulse {
  background: #eab308;
  animation: none;
}

@keyframes sdp-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.65;
    transform: scale(1.15);
  }
}

.sdp-strip-name {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
}

.sdp-strip-type {
  margin: 2px 0 0;
  font-size: 12px;
  color: #64748b;
}

.sdp-last-box {
  margin-bottom: 16px;
}

.sdp-last-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  margin-bottom: 8px;
}

.sdp-last-inner {
  padding: 12px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.sdp-muted {
  color: #64748b;
  font-weight: 500;
}

.sdp-date-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 12px;
}

.sdp-date-row--ind .sdp-btn-primary {
  margin-top: 24px;
}

.sdp-date-label {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sdp-date-input,
.sdp-date-input-ind,
.sdp-date-input-det,
.sdp-shift-select {
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-family: inherit;
}

.sdp-shift-select {
  min-width: 12rem;
  background: #fff;
  cursor: pointer;
}

/* Mismo primario que «Iniciar sesión» (.login-submit-btn): #ff6038 */
.sdp-btn-primary {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  background: #ff6038;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  box-sizing: border-box;
}

.sdp-btn-primary:hover {
  filter: brightness(1.04);
}

.sdp-btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  filter: none;
}

.sdp-kpi-grid--six {
  /* Compatibilidad: mismo criterio que --responsive */
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.sdp-kpi-grid--responsive {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

@media (min-width: 420px) {
  .sdp-kpi-grid--six,
  .sdp-kpi-grid--responsive {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .sdp-kpi-grid--six,
  .sdp-kpi-grid--responsive {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1280px) {
  .sdp-kpi-grid--responsive {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

.sdp-kpi-card {
  min-width: 0;
  padding: 14px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.sdp-kpi-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.sdp-kpi-card-head .sdp-kpi-card-label {
  margin: 0;
  flex: 1;
  min-width: 0;
}

.sdp-kpi-help {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #fff;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}

.sdp-kpi-help:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #cbd5e1;
}

.sdp-kpi-card-label {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.sdp-kpi-card-value {
  margin: 0;
  font-size: clamp(1.1rem, 2.8vw, 1.35rem);
  font-weight: 700;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  word-break: break-word;
}

.sdp-kpi-help-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.sdp-kpi-help-modal.hidden {
  display: none;
}

.sdp-kpi-help-modal__panel {
  position: relative;
  width: min(440px, 100%);
  max-height: min(80vh, 640px);
  overflow: auto;
  background: #fff;
  border-radius: 14px;
  padding: 20px 20px 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

.sdp-kpi-help-modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 10px;
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
  border-radius: 8px;
  font-family: inherit;
}

.sdp-kpi-help-modal__close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.sdp-kpi-help-modal__title {
  margin: 0 0 12px;
  padding-right: 36px;
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
}

.sdp-kpi-help-modal__body {
  font-size: 13px;
  line-height: 1.5;
  color: #475569;
}

.sdp-kpi-help-prose p {
  margin: 0 0 12px;
}

.sdp-kpi-help-prose p:last-child {
  margin-bottom: 0;
}

.sdp-kpi-help-note {
  margin-top: 12px !important;
  font-size: 12px !important;
  color: #64748b !important;
}

.sdp-kpi-help-dl {
  margin: 12px 0 0;
  padding: 0;
}

.sdp-kpi-help-dl > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
  align-items: flex-start;
}

.sdp-kpi-help-dl > div:last-child {
  border-bottom: none;
}

.sdp-kpi-help-dl dt {
  margin: 0;
  font-weight: 500;
  color: #64748b;
  max-width: 55%;
}

.sdp-kpi-help-dl dd {
  margin: 0;
  font-weight: 600;
  color: #0f172a;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.sdp-kpi-help-dt-sub {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: #94a3b8;
  margin-top: 4px;
}

.sdp-kpi-card-value--ink {
  color: #0f172a;
}
.sdp-kpi-card-value--orange {
  color: #ea580c;
}
.sdp-kpi-card-value--green {
  color: #059669;
}
.sdp-kpi-card-value--blue {
  color: #2563eb;
}
.sdp-kpi-card-value--violet {
  color: #7c3aed;
}
.sdp-kpi-card-value--amber {
  color: #d97706;
}
.sdp-kpi-card-value--muted {
  color: #94a3b8;
}

.sdp-kpi-card-sub {
  margin: 6px 0 0;
  font-size: 11px;
  color: #94a3b8;
}

.sdp-kpi-card-micro {
  margin: 8px 0 0;
  font-size: 10px;
  color: #94a3b8;
}

.sdp-avail-block {
  margin-top: 8px;
  padding: 20px;
  background: #fff;
  border: 1px solid #f1f5f9;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.sdp-avail-title {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
}

.sdp-avail-desc {
  margin: 0 0 16px;
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.45;
  max-width: none;
}

.sdp-avail-chart-host {
  width: 100%;
  min-height: 220px;
  position: relative;
}

.sdp-avail-chart-host canvas {
  display: block;
  width: 100% !important;
  max-height: 280px;
}

.sdp-avail-axis-caption {
  margin: 8px 0 0;
  text-align: right;
  font-size: 11px;
  color: #94a3b8;
}

.sdp-chart-hint {
  font-size: 12px;
  color: #94a3b8;
  margin: 0 0 8px;
}

.sdp-chart-title {
  margin: 16px 0 10px;
  font-size: 14px;
  font-weight: 700;
  color: #334155;
}

.sdp-minute-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

.sdp-interval {
  font-size: 12px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sdp-interval-select {
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  font-family: inherit;
}

.sdp-chart {
  display: block;
  min-height: 160px;
  padding: 12px 8px;
  background: #fafafa;
  border: 1px solid #f1f5f9;
  border-radius: 12px;
  overflow-x: auto;
}

.sdp-chart--hours canvas,
.sdp-chart--minutes canvas {
  display: block;
  width: 100% !important;
  max-height: 280px;
}

.sdp-chart--minutes {
  min-height: 140px;
}

.sd-table-wrap {
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.sd-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.sd-table th,
.sd-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #f1f5f9;
}

.sd-table th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
  background: #f8fafc;
}

.sd-num {
  font-variant-numeric: tabular-nums;
}

.sd-mono {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  word-break: break-all;
}

.sd-empty {
  color: #94a3b8;
  text-align: center;
  padding: 16px;
}

@media (max-width: 768px) {
  .machines-layout {
    flex-direction: column;
  }

  .machines-detail-panel {
    width: 100%;
    min-width: 0;
    position: static;
  }

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

/* Catálogo de detenciones (consola) */
.dc-catalog {
  min-width: 0;
}

.dc-catalog-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dc-header .dc-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--ink, #0f172a);
}

.dc-header .dc-subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  color: #64748b;
  line-height: 1.4;
}

.dc-muted {
  color: #64748b;
  font-size: 13px;
}

.dc-banner {
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
}

.dc-banner--ok {
  border: 1px solid #a7f3d0;
  background: #ecfdf5;
  color: #047857;
}

.dc-banner--err {
  border: 1px solid #fecdd3;
  background: #fff1f2;
  color: #be123c;
}

.dc-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line, #e2e8f0);
}

.dc-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dc-tab {
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.dc-tab:hover {
  background: #f8fafc;
}

.dc-tab--active {
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 500;
}

.dc-btn {
  border-radius: 8px;
  font-size: 13px;
  padding: 6px 12px;
  cursor: pointer;
  border: 1px solid var(--line, #e2e8f0);
  background: #fff;
  color: #334155;
}

.dc-btn--primary {
  background: var(--color-primary, #2563eb);
  border-color: var(--color-primary, #2563eb);
  color: #fff;
  font-weight: 500;
}

.dc-btn--primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.dc-btn-add {
  background: #ea580c;
  border-color: #c2410c;
  color: #fff;
}

.dc-btn-add:hover:not(:disabled) {
  background: #c2410c;
  border-color: #9a3412;
}

.dc-btn-add:focus-visible {
  outline: 2px solid #ea580c;
  outline-offset: 2px;
}

.dc-btn--ghost {
  background: #fff;
}

.dc-btn--danger {
  border-color: #fecdd3;
  color: #be123c;
}

.dc-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 12px;
  background: #fff;
}

.dc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.dc-table th,
.dc-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #f1f5f9;
}

.dc-table thead th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #64748b;
  background: #f8fafc;
}

.dc-th-actions,
.dc-td-actions {
  text-align: right;
  white-space: nowrap;
}

.dc-td-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.dc-empty {
  text-align: center;
  color: #94a3b8;
  padding: 28px 12px;
}

.dc-color-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dc-swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  flex-shrink: 0;
}

.dc-modal-layer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.45);
}

.dc-modal {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.dc-modal-title {
  margin: 0 0 12px;
  font-size: 1.05rem;
  font-weight: 600;
  color: #0f172a;
}

.dc-modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dc-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #64748b;
}

.dc-input {
  width: 100%;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
}

.dc-color-row {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 8px;
  align-items: center;
}

.dc-color-native {
  width: 56px;
  height: 40px;
  padding: 2px;
  border-radius: 8px;
  border: 1px solid var(--line, #e2e8f0);
  cursor: pointer;
}

.dc-subsection {
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 10px;
  padding: 10px 12px;
}

.dc-subsection-title {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.dc-check-grid {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.dc-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: #334155;
}

.dc-check input {
  margin-top: 2px;
}

.dc-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
}

/* Catálogo de indicadores (paridad con Next.js / manufacturing/indicator-catalog) */
.ic-header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.ic-modal-wide {
  max-width: 42rem;
}

.ic-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.ic-modal-close {
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
}

.ic-modal-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.ic-modal-scroll {
  max-height: min(70vh, 520px);
  overflow-y: auto;
  padding-right: 4px;
}

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

.ic-inline-actions .dc-input {
  flex: 1 1 200px;
}

.ic-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ic-chip {
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  background: #fff;
  color: #334155;
}

.ic-chip:hover {
  border-color: #cbd5e1;
}

.ic-chip--on {
  border-color: var(--color-primary, #2563eb);
  background: #eff6ff;
  color: #1e3a8a;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-primary, #2563eb) 25%, transparent);
}

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

.ic-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
}

.ic-tag-system {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  background: #fef3c7;
  color: #92400e;
  vertical-align: middle;
}

.ic-delete-layer {
  z-index: 60;
}

.ic-section-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.ic-section-kicker {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--color-primary, #2563eb);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.ic-section-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink, #0f172a);
}

.ic-section-lead {
  margin: 4px 0 0;
  font-size: 12px;
  color: #64748b;
  line-height: 1.45;
  max-width: 36rem;
}

.ic-field-block {
  margin-bottom: 14px;
}

.ic-field-block:last-child {
  margin-bottom: 0;
}

.ic-field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.ic-field-intro {
  margin: 0 0 6px;
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
}

.ic-field-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
}

/* --- Product catalog (pc-*) — reuses the dc-catalog shell --- */
.pc-modal-panel {
  max-width: 46rem;
}

.pc-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.pc-modal-close {
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
}

.pc-modal-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.pc-modal-scroll {
  max-height: min(70vh, 520px);
  overflow-y: auto;
  padding-right: 4px;
}

.pc-section-title {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink, #0f172a);
}

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

.pc-field-block {
  display: flex;
  flex-direction: column;
}

.pc-field-block--full {
  grid-column: 1 / -1;
}

.pc-field-label {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.pc-field-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
}

.pc-field-intro {
  margin: 0 0 10px;
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
}

.pc-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
}

.pc-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line, #e2e8f0);
  flex-wrap: wrap;
}

.pc-search {
  flex: 1 1 260px;
}

.pc-inactive-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #475569;
  cursor: pointer;
  white-space: nowrap;
}

.pc-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.pc-status--on {
  background: #dcfce7;
  color: #166534;
}

.pc-status--off {
  background: #f1f5f9;
  color: #64748b;
}

.pc-tag-derived {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  background: #fef3c7;
  color: #92400e;
  vertical-align: middle;
}

.pc-row--inactive {
  opacity: 0.6;
}

.pc-plants-cell {
  max-width: 220px;
}

.pc-plant-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pc-plant-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  background: #fff;
  color: #334155;
}

.pc-plant-chip input {
  margin: 0;
}

.pc-plant-chip--on {
  border-color: var(--color-primary, #2563eb);
  background: #eff6ff;
  color: #1e3a8a;
}

/* Asignación / clasificación de detenciones */
.dm-assignment {
  min-width: 0;
}

.dm-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dm-header .dm-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--ink, #0f172a);
}

.dm-header .dm-subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  color: #64748b;
  line-height: 1.4;
}

.dm-muted {
  color: #64748b;
  font-size: 13px;
}

.dm-banner {
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
}

.dm-banner--ok {
  border: 1px solid #a7f3d0;
  background: #ecfdf5;
  color: #047857;
}

.dm-banner--err {
  border: 1px solid #fecdd3;
  background: #fff1f2;
  color: #be123c;
}

.dm-filters {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 12px;
  background: #fff;
}

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

.dm-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #64748b;
}

.dm-field--machine {
  grid-column: span 1;
  position: relative;
}

.dm-machine-dd {
  position: relative;
}

.dm-machine-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.dm-dd-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dm-caret {
  color: #94a3b8;
  flex-shrink: 0;
}

.dm-dd-panel {
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  margin-top: 6px;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid var(--line, #e2e8f0);
  background: #fff;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
}

.dm-dd-list {
  max-height: 14rem;
  overflow: auto;
  margin-top: 8px;
  border-radius: 8px;
  border: 1px solid #f1f5f9;
}

.dm-dd-item {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: none;
  background: transparent;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  color: #334155;
}

.dm-dd-item:hover {
  background: #f8fafc;
}

.dm-dd-item--active {
  background: #eff6ff;
  color: #1d4ed8;
}

.dm-dd-nores {
  padding: 8px 10px;
  font-size: 13px;
  color: #94a3b8;
}

.dm-input {
  width: 100%;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
}

.dm-btn {
  border-radius: 8px;
  font-size: 13px;
  padding: 8px 12px;
  cursor: pointer;
  border: 1px solid var(--line, #e2e8f0);
  background: #fff;
  color: #334155;
}

/* Mismo naranja que «Iniciar sesión» (.login-submit-btn): #ff6038 */
.dm-btn--primary {
  border: none;
  background: #ff6038;
  color: #fff;
  font-weight: 600;
}

.dm-btn--primary:hover:not(:disabled) {
  filter: brightness(1.04);
}

.dm-btn--primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  filter: none;
}

.dm-btn--ghost {
  background: #fff;
}

.dm-btn--action {
  border: none;
  background: #ff6038;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
}

.dm-btn--action:hover:not(:disabled) {
  filter: brightness(1.04);
}

.dm-btn--action:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  filter: none;
}

.dm-table-section {
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.dm-table-meta {
  padding: 10px 14px;
  font-size: 13px;
  color: #64748b;
  border-bottom: 1px solid #f1f5f9;
}

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

.dm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.dm-table th,
.dm-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
}

.dm-table thead th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #64748b;
  background: #f8fafc;
}

.dm-th-actions,
.dm-td-actions {
  text-align: right;
  white-space: nowrap;
}

.dm-num {
  font-variant-numeric: tabular-nums;
}

.dm-empty {
  text-align: center;
  color: #94a3b8;
  padding: 28px 12px;
}

.dm-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
}

.dm-chip--reason {
  background: #d1fae5;
  color: #065f46;
}

.dm-chip--type {
  background: #cffafe;
  color: #155e75;
}

.dm-chip--group {
  background: #ccfbf1;
  color: #115e59;
}

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

.dm-modal-layer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.45);
}

.dm-modal {
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow: visible;
  background: #fff;
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.dm-modal-title {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 600;
  color: #0f172a;
}

.dm-modal-hint {
  margin: 0 0 12px;
  font-size: 13px;
  color: #64748b;
  line-height: 1.4;
}

.dm-modal-hint--minor {
  margin: -4px 0 12px;
  font-size: 12px;
  color: #94a3b8;
}

.dm-modal-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dm-modal-fields--cascade {
  gap: 14px;
}

/* Modal catálogo: mismo patrón que filtro máquina + chips de color */
.dm-modal-catalog-dd .dm-dd-panel {
  z-index: 65;
}

.dm-modal-catalog-dd .dm-dd-panel--catalog input.dm-input {
  margin-bottom: 8px;
}

.dm-modal .dm-catalog-trigger-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.dm-modal .dm-machine-trigger:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.dm-assignment .dm-dd-item--catalog {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
}

.dm-color-swatch-cell {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.dm-color-swatch-cell--pair {
  gap: 3px;
}

.dm-color-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-sizing: border-box;
  vertical-align: middle;
}

.dm-color-swatch--empty {
  background: linear-gradient(135deg, #e2e8f0 50%, #f1f5f9 50%);
  border-color: #cbd5e1;
}

.dm-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
}

/* Filtro máquina: sin degradado naranjo del `button` global */
.dm-assignment button.dm-machine-trigger {
  background: #fff;
  background-image: none;
  color: var(--ink, #0f172a);
  font-weight: 500;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
}

.dm-assignment .dm-dd-item {
  background: #fff;
  background-image: none;
  color: #334155;
  font-weight: 400;
  border: none;
  border-radius: 8px;
  padding: 8px 10px;
}

.dm-assignment .dm-dd-item:hover {
  background: #f8fafc;
}

.dm-assignment .dm-dd-item--active {
  background: #eff6ff;
  color: #1d4ed8;
}

.dm-assignment .dm-dd-item--machine {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  cursor: pointer;
  font-weight: 400;
  text-align: left;
}

.dm-assignment .dm-dd-item--machine .dm-machine-cb {
  flex-shrink: 0;
  margin: 0;
  cursor: pointer;
}

.dm-bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
  background: #f8fafc;
  font-size: 13px;
  color: #334155;
}

.dm-th-check,
.dm-td-check {
  width: 40px;
  text-align: center;
  vertical-align: middle;
}

.dm-td-check input[type="checkbox"],
.dm-th-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--color-primary, #2563eb);
}

  text-wrap: balance;
}

.dcs-banner {
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
}

.dcs-banner--error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.dcs-banner--muted {
  background: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.dcs-footer-totals {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #ece7df;
  font-size: 12px;
  color: #64748b;
}

.dcs-footer-totals strong {
  color: #361e1c;
}

.dcs-layout {
  flex: 1;
  min-height: 0;
  min-width: 0;
  width: 100%;
  --dcs-left-col: 580px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  overflow: hidden;
}

/* Hidden on narrow viewports; desktop rules below must come AFTER this */
.dcs-layout-splitter {
  display: none;
}

@media (min-width: 1201px) {
  .dcs-layout {
    flex-direction: row;
  }

  .dcs-left {
    flex: 0 0 auto;
    width: var(--dcs-left-col, 580px);
    min-width: 340px;
    max-width: 960px;
    border-right: none;
  }

  .dcs-layout-splitter {
    display: flex;
    flex: 0 0 14px;
    width: 14px;
    min-width: 14px;
    max-width: 14px;
    margin: 0 -4px;
    padding: 0;
    touch-action: none;
    cursor: ew-resize;
    background: transparent;
    align-self: stretch;
    position: relative;
    z-index: 5;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
  }

  .dcs-layout-splitter-grip {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 26px;
    pointer-events: none;
    opacity: 0.88;
    transition: opacity 0.15s ease, transform 0.15s ease;
    background: center / contain no-repeat
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='26' viewBox='0 0 16 26'%3E%3Cpath fill='%23334155' d='M2 13 L7 6 L7 20 Z'/%3E%3Cpath fill='%23334155' d='M14 13 L9 6 L9 20 Z'/%3E%3C/svg%3E");
  }

  /* Center track (subtle line) */
  .dcs-layout-splitter::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 8%;
    bottom: 8%;
    width: 3px;
    transform: translateX(-50%);
    border-radius: 99px;
    background: linear-gradient(
      180deg,
      rgba(148, 163, 184, 0) 0%,
      rgba(148, 163, 184, 0.6) 18%,
      rgba(148, 163, 184, 0.6) 82%,
      rgba(148, 163, 184, 0) 100%
    );
    pointer-events: none;
    transition: background 0.15s ease, opacity 0.15s ease;
  }

  .dcs-layout-splitter:hover,
  .dcs-layout-splitter:focus-visible {
    outline: none;
    background: rgba(148, 163, 184, 0.22);
  }

  .dcs-layout-splitter:hover::before,
  .dcs-layout-splitter:focus-visible::before {
    background: linear-gradient(
      180deg,
      rgba(51, 65, 85, 0) 0%,
      rgba(51, 65, 85, 0.8) 15%,
      rgba(51, 65, 85, 0.8) 85%,
      rgba(51, 65, 85, 0) 100%
    );
  }

  .dcs-layout-splitter:hover .dcs-layout-splitter-grip,
  .dcs-layout-splitter:focus-visible .dcs-layout-splitter-grip {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.08);
  }
}

.dcs-left {
  min-height: 0;
  overflow-y: auto;
  background: #fafaf8;
  border-right: 1px solid #ece7df;
  padding: 20px 22px;
  container-type: inline-size;
  container-name: dcs-left;
}

.dcs-right {
  flex: 1 1 0%;
  min-height: 0;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  background: #fff;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dcs-breadcrumb {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 12px;
}

.dcs-eyebrow {
  margin: 0;
  font-family: 'Byotone', var(--sans);
  font-size: 20px;
  color: #4a2e2a;
  text-transform: uppercase;
}

.dcs-title {
  margin: 4px 0 10px;
  font-family: 'Mortend', var(--sans);
  font-size: 40px;
  line-height: 1.04;
  color: #361e1c;
  text-transform: uppercase;
}

.dcs-subtitle {
  margin: 0 0 16px;
  font-size: 15px;
  color: #4b5563;
  line-height: 1.4;
}

.dcs-search-box h3 {
  margin: 0 0 4px;
  font-family: 'Byotone', var(--sans);
  font-size: 20px;
  color: #361e1c;
}

.dcs-search-box p {
  margin: 0 0 8px;
  font-size: 13px;
  color: #64748b;
}

.dcs-search-input {
  width: 100%;
  height: 44px;
  border: 1px solid #dbd7cf;
  border-radius: 12px;
  padding: 0 14px;
  background: #fff;
  margin-bottom: 10px;
}

.dcs-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.dcs-actions button {
  flex: 1;
  height: 40px;
  border: 1px solid #7f9293;
  border-radius: 10px;
  background: #fff;
  color: #4a2e2a;
  font-family: 'Byotone', var(--sans);
  font-size: 14px;
  cursor: pointer;
}

@container dcs-left (max-width: 520px) {
  .dcs-actions {
    flex-direction: column;
  }

  .dcs-actions button {
    flex: none;
    width: 100%;
  }
}

.dcs-card {
  border: 1px solid #c5dad3;
  background: #f5f5ed;
  border-radius: 14px;
  padding: 12px 14px;
}

.dcs-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dcs-section-head h3 {
  margin: 0;
  font-family: 'Byotone', var(--sans);
  text-transform: uppercase;
  letter-spacing: .03em;
  font-size: 16px;
  color: #361e1c;
}

.dcs-calendar-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #64748b;
}

.dcs-calendar-nav .dcs-nav-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid #d3d3c7;
  background: #fff;
  background-image: none;
  color: #1e293b;
  font-weight: 500;
  cursor: pointer;
}

.dcs-calendar-nav .dcs-nav-btn:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

.dcs-calendar-nav .dcs-nav-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.dcs-nav-btn-icon {
  display: block;
  flex-shrink: 0;
  pointer-events: none;
}

.dcs-calendar-groups {
  margin-top: 12px;
  margin-bottom: 4px;
}

.dcs-calendar-groups-head {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin-bottom: 8px;
}

.dcs-calendar-groups-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dcs-calendar-group-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #e2e8f0;
  font-size: 11px;
  color: #334155;
  max-width: 100%;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--group-pill, #94a3b8) 22%, transparent);
}

.dcs-calendar-group-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dcs-calendar-group-pill-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 14rem;
}

.dcs-calendar-groups-empty {
  margin: 0;
  font-size: 12px;
}

.dcs-grid-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.dcs-weekday {
  text-align: center;
  font-size: 11px;
  color: #7f7469;
}

.dcs-grid-days {
  margin-top: 4px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.dcs-day {
  min-height: 72px;
  border: 1px solid #d7d9cf;
  border-radius: 10px;
  background: #f8f9f6;
  padding: 6px 6px 5px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.dcs-day--muted {
  opacity: .5;
}

.dcs-day-num {
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
  margin: 0 0 5px;
  text-align: center;
  width: 100%;
}

.dcs-day-chips {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-height: 0;
}

.dcs-day-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-width: 0;
  padding: 4px 8px 4px 6px;
  border-radius: 999px;
  border: 1px solid #e2e8e0;
  background: #fff;
  font-size: 10px;
  line-height: 1.25;
  color: #334155;
  cursor: default;
  box-sizing: border-box;
}

.dcs-view .rsv-md-chart-heatmap-tooltip {
  pointer-events: none;
}

.dcs-day-chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #94a3b8;
}

.dcs-day-chip-label {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  word-break: break-word;
}

.dcs-day-chip[data-chip-color] .dcs-day-chip-dot {
  background-color: var(--chip-accent);
}

.dcs-day-more {
  border-radius: 999px;
  padding: 1px 6px;
  font-size: 10px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: #f1f5f9;
  color: #64748b;
}

.dcs-day-chip[data-chip-color] {
  --chip-accent: #5b8f7a;
  border-color: color-mix(in srgb, var(--chip-accent) 35%, #e2e8e0);
}

.dcs-anomalies-view .dcs-anomaly-inner {
  width: 100%;
  max-width: none;
  min-width: 0;
  box-sizing: border-box;
  padding: 16px clamp(14px, 2vw, 28px) 28px;
}

.dcs-anomaly-list-head-actions {
  display: inline-flex;
  align-items: stretch;
  gap: 10px;
  flex-wrap: wrap;
}

.dcs-anomaly-list-head-actions .dcs-anomaly-btn-new,
.dcs-anomaly-list-head-actions .dcs-anomaly-btn-refresh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  font-size: 13px;
  box-sizing: border-box;
  width: auto;
  margin-top: 0;
}

.dcs-anomaly-list-head-actions .dcs-anomaly-btn-new {
  flex: 0 0 auto;
}

.dcs-anomaly-list-card {
  margin-top: 16px;
  padding: clamp(14px, 1.5vw, 20px) clamp(14px, 1.8vw, 22px);
  background: linear-gradient(180deg, #fafbf7 0%, #f3f5ef 100%);
  border: 1px solid #b8cfc6;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.75) inset;
}

.dcs-anomaly-list-card .dcs-section-head {
  padding-bottom: 12px;
  margin-bottom: 0;
  border-bottom: 1px solid rgba(54, 30, 28, 0.12);
}

.dcs-anomaly-data-panel {
  margin-top: 14px;
  border: 1px solid #c9ddd4;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 8px 24px rgba(54, 30, 28, 0.04);
}

.dcs-anomaly-data-panel__toolbar {
  padding: 14px 16px;
  background: linear-gradient(180deg, #f8fbf9 0%, #f3f7f4 100%);
  border-bottom: 1px solid #e8ebe6;
}

.dcs-anomaly-data-panel__meta {
  padding: 8px 16px;
  background: #fff;
  border-bottom: 1px solid #eef2ef;
}

.dcs-anomaly-data-panel__meta .dcs-anomaly-list-meta {
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

.dcs-anomaly-data-panel__body {
  background: #fff;
  min-height: 120px;
}

.dcs-anomaly-data-panel__footer {
  padding: 10px 16px;
  background: linear-gradient(180deg, #f3f7f4 0%, #f8fbf9 100%);
  border-top: 1px solid #e8ebe6;
}

.dcs-anomaly-data-panel__footer .dcs-anomaly-pager {
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.dcs-anomaly-data-panel__footer .dcs-anomaly-pager__nav .ghost,
.dcs-anomaly-toolbar__actions .ghost {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #c5d5cd;
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}

.dcs-anomaly-data-panel__footer .dcs-anomaly-pager__nav .ghost:hover:not(:disabled),
.dcs-anomaly-toolbar__actions .ghost:hover:not(:disabled) {
  background: #f0f7f3;
  border-color: #5a8f7e;
  color: #361e1c;
}

.dcs-anomaly-data-panel__footer .dcs-anomaly-pager__nav .ghost:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.dcs-anomaly-data-panel__fallback {
  margin: 0;
  padding: 24px 16px;
  text-align: center;
}

.dcs-anomaly-toolbar {
  display: grid;
  grid-template-columns: minmax(200px, 1.1fr) minmax(0, 2.4fr) auto;
  gap: 14px 18px;
  align-items: end;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.dcs-anomaly-toolbar__filters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 10px 12px;
  min-width: 0;
}

.dcs-anomaly-toolbar__search .dcs-anomaly-search-input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  height: 40px;
  border-radius: 10px;
  border: 1px solid #c5d5cd;
  padding: 0 12px;
  font-size: 14px;
}

.dcs-anomaly-toolbar-label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  letter-spacing: 0.02em;
}

.dcs-anomaly-toolbar-label input,
.dcs-anomaly-toolbar-label select {
  font-size: 13px;
  border: 1px solid #c5d5cd;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: #1e293b;
  min-height: 38px;
  box-sizing: border-box;
}

.dcs-anomaly-toolbar-label input:focus,
.dcs-anomaly-toolbar-label select:focus {
  outline: none;
  border-color: #5a8f7e;
  box-shadow: 0 0 0 2px rgba(90, 143, 126, 0.2);
}

.dcs-anomaly-toolbar__actions {
  display: flex;
  justify-content: flex-end;
  align-self: end;
  padding-bottom: 2px;
}

@media (max-width: 960px) {
  .dcs-anomaly-toolbar {
    grid-template-columns: 1fr;
  }

  .dcs-anomaly-toolbar__actions {
    justify-content: flex-start;
    padding-bottom: 0;
  }
}

.dcs-anomaly-pager {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px 16px;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
}

@media (max-width: 640px) {
  .dcs-anomaly-pager {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .dcs-anomaly-pager__summary {
    text-align: center;
    order: 3;
  }

  .dcs-anomaly-pager__size {
    order: 1;
  }

  .dcs-anomaly-pager__nav {
    order: 2;
    justify-content: center;
    justify-self: stretch;
  }
}

.dcs-anomaly-pager__summary {
  margin: 0;
  text-align: center;
  font-size: 12px;
  color: #64748b;
}

.dcs-anomaly-pager__size {
  justify-self: start;
}

.dcs-anomaly-pager__nav {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
}

.dcs-anomaly-pager__page {
  font-size: 12px;
  color: #475569;
  min-width: 7.5em;
  text-align: center;
}

.dcs-anomaly-form--modal {
  margin-top: 4px;
}

.dcs-anomaly-table-wrap {
  overflow-x: auto;
  margin: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.dcs-anomaly-list-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  letter-spacing: 0.01em;
}

.dcs-anomaly-table {
  width: 100%;
  min-width: 860px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.dcs-anomaly-table th,
.dcs-anomaly-table td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid #e8ebe6;
  vertical-align: middle;
}

.dcs-anomaly-table tbody tr:last-child td {
  border-bottom: none;
}

.dcs-anomaly-row {
  transition: background 0.12s ease;
}

.dcs-anomaly-table tbody tr:nth-child(even) {
  background: #fafcfa;
}

.dcs-anomaly-table tbody tr:hover {
  background: #f0f7f3;
}

.dcs-anomaly-table th {
  font-weight: 700;
  color: #361e1c;
  background: linear-gradient(180deg, #f6faf7 0%, #e9f2ec 100%);
  position: sticky;
  top: 0;
  z-index: 1;
  box-shadow: 0 1px 0 #c9ddd4;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.dcs-anomaly-th-title {
  min-width: 240px;
}

.dcs-anomaly-th-actions,
.dcs-anomaly-td-actions {
  white-space: nowrap;
  text-align: right;
}

.dcs-anomaly-td-title {
  max-width: 360px;
}

.dcs-anomaly-cell-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.dcs-anomaly-cell-title__main {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.35;
}

.dcs-anomaly-cell-title__desc {
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dcs-anomaly-badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.3;
  border: 1px solid transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dcs-anomaly-badge--success {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.dcs-anomaly-badge--warning {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}

.dcs-anomaly-badge--info {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.dcs-anomaly-badge--danger {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

.dcs-anomaly-badge--neutral {
  background: #f8fafc;
  color: #475569;
  border-color: #e2e8f0;
}

.dcs-anomaly-badge--muted {
  background: #f1f5f9;
  color: #94a3b8;
  border-color: #e2e8f0;
}

.dcs-anomaly-badge--channel-ui {
  background: #eef2ff;
  color: #4338ca;
  border-color: #c7d2fe;
}

.dcs-anomaly-badge--channel-auto {
  background: #f0fdfa;
  color: #0f766e;
  border-color: #99f6e4;
}

.dcs-anomaly-badge--channel-ext {
  background: #fdf4ff;
  color: #7e22ce;
  border-color: #e9d5ff;
}

.dcs-anomaly-badge--channel-meeting {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fed7aa;
}

.dcs-anomaly-badge--channel-default {
  background: #f8fafc;
  color: #475569;
  border-color: #e2e8f0;
}

.dcs-anomaly-assignee {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.dcs-anomaly-assignee--empty {
  font-size: 12px;
  font-style: italic;
  color: #94a3b8;
}

.dcs-anomaly-assignee-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(180deg, #e8f2ec 0%, #d5e3db 100%);
  color: #361e1c;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.dcs-anomaly-assignee-name {
  font-size: 13px;
  color: #334155;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
}

.dcs-anomaly-date {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  min-width: 5.5rem;
}

.dcs-anomaly-date__day {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.dcs-anomaly-date__time {
  font-size: 11px;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}

.dcs-anomaly-actions-group {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.dcs-anomaly-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid #c5d5cd;
  border-radius: 8px;
  background: #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: #361e1c;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.dcs-anomaly-action-btn:hover {
  background: #f0f7f3;
  border-color: #5a8f7e;
}

.dcs-anomaly-action-btn--danger {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fff;
}

.dcs-anomaly-action-btn--danger:hover {
  background: #fef2f2;
  border-color: #f87171;
}

.dcs-anomaly-action-btn--link {
  width: 100%;
  max-width: 160px;
  justify-content: center;
}

.dcs-anomaly-actions-count {
  font-size: 12px;
  font-weight: 700;
  color: #1d4ed8;
}

.dcs-anomaly-actions-count--empty {
  color: #94a3b8;
  font-weight: 600;
}

.dcs-anomaly-actions-modal {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dcs-anomaly-actions-panel {
  padding: 14px 16px;
  border: 1px solid #d5e3db;
  border-radius: 12px;
  background: #fafcfa;
}

.dcs-anomaly-actions-panel--create {
  background: #fff;
}

.dcs-anomaly-actions-panel-title {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #361e1c;
}

.dcs-anomaly-actions-panel-hint {
  margin: 0 0 10px;
  font-size: 12px;
  color: #64748b;
  line-height: 1.45;
}

.dcs-anomaly-actions-empty {
  margin: 0;
  font-size: 13px;
  color: #64748b;
  font-style: italic;
}

.dcs-anomaly-actions-linked-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dcs-anomaly-actions-linked-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #e8ebe6;
  border-radius: 10px;
  background: #fff;
}

.dcs-anomaly-actions-linked-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.dcs-anomaly-actions-linked-title {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
}

.dcs-anomaly-actions-linked-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.dcs-anomaly-actions-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.dcs-anomaly-actions-link-select {
  flex: 1 1 220px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #c5d5cd;
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
}

.dcs-anomaly-actions-create-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dcs-anomaly-actions-create-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.dcs-anomaly-list-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 40px 24px;
  border: none;
  border-radius: 0;
  background: #fff;
  text-align: center;
}

.dcs-anomaly-list-empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(180deg, #f4faf6 0%, #e8f2ec 100%);
  border: 1px solid #c9ddd4;
  color: #5a8f7e;
  font-size: 18px;
  font-weight: 700;
}

.dcs-anomaly-list-empty-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #334155;
}

.dcs-anomaly-list-empty-hint {
  margin: 0;
  max-width: 36ch;
  font-size: 12px;
  color: #64748b;
  line-height: 1.5;
}

.dcs-anomaly-row-btn {
  margin-left: 6px;
}

.dcs-anomaly-row-btn--danger {
  color: #b91c1c;
}

.dcs-anomaly-list-empty {
  margin: 8px 0 0;
}

@media (max-width: 720px) {
  .dcs-anomaly-table thead {
    display: none;
  }
  .dcs-anomaly-table tr {
    display: grid;
    gap: 8px;
    padding: 14px 0;
    border-bottom: 1px solid #e7e5e0;
  }
  .dcs-anomaly-table td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    border: none;
    padding: 2px 0;
  }
  .dcs-anomaly-td-title {
    flex-direction: column;
    align-items: stretch;
  }
  .dcs-anomaly-td-title::before {
    margin-bottom: 4px;
  }
  .dcs-anomaly-table td::before {
    content: attr(data-label);
    font-weight: 700;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    flex-shrink: 0;
    min-width: 6.5rem;
  }
  .dcs-anomaly-td-actions::before {
    content: "";
    display: none;
  }
  .dcs-anomaly-td-actions {
    justify-content: flex-end;
    padding-top: 6px;
  }
  .dcs-anomaly-actions-group {
    width: 100%;
    justify-content: flex-end;
  }
}

.dcs-flow-config-view .dcs-flow-page-head__sub {
  max-width: 62ch;
}

.dcs-flow-toolbar {
  margin-top: 10px;
  margin-bottom: 2px;
}

.dcs-flow-segment {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 10px;
  background: linear-gradient(180deg, #eef4f0 0%, #e2ebe6 100%);
  border: 1px solid #b8cfc6;
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

@media (max-width: 560px) {
  .dcs-flow-segment {
    grid-template-columns: 1fr;
  }
}

.dcs-flow-segment__btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 11px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.35);
  color: #475569;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    color 0.15s ease;
}

.dcs-flow-segment__btn:hover {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(54, 30, 28, 0.12);
}

.dcs-flow-segment__title {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
}

.dcs-flow-segment__desc {
  font-size: 11px;
  font-weight: 500;
  color: #64748b;
  line-height: 1.35;
}

.dcs-flow-segment__btn--anomaly.is-active {
  background: #fffbf5;
  border-color: color-mix(in srgb, #f59e0b 45%, #c9ddd4);
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.12);
  color: #9a3412;
}

.dcs-flow-segment__btn--anomaly.is-active .dcs-flow-segment__title {
  color: #9a3412;
}

.dcs-flow-segment__btn--action.is-active {
  background: #f4fdf8;
  border-color: color-mix(in srgb, #22c55e 40%, #c9ddd4);
  box-shadow: 0 2px 10px rgba(34, 197, 94, 0.1);
  color: #14532d;
}

.dcs-flow-segment__btn--action.is-active .dcs-flow-segment__title {
  color: #14532d;
}

.dcs-flow-stack {
  margin-top: 18px !important;
}

.dcs-flow-card-intro {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(54, 30, 28, 0.1);
}

.dcs-flow-card-intro__icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  flex-shrink: 0;
}

.dcs-flow-card-intro__icon--setup {
  background: linear-gradient(135deg, #fde68a 0%, #f59e0b 55%, #d97706 100%);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.25);
}

.dcs-flow-card-intro__title {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 700;
  color: #361e1c;
}

.dcs-flow-card-intro__text {
  margin: 0;
  max-width: 56ch;
  line-height: 1.45;
}

.dcs-flow-form-panel {
  background: #fff;
  border: 1px solid #c9ddd4;
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.dcs-flow-form-panel--bordered {
  margin-top: 16px;
  border-style: dashed;
  background: #fafdfb;
}

.dcs-flow-form-panel__title {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #475569;
}

.dcs-flow-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px 16px;
  align-items: start;
}

.dcs-flow-field {
  min-width: 0;
}

.dcs-flow-field--full {
  grid-column: 1 / -1;
}

.dcs-flow-field__label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #475569;
  margin-bottom: 5px;
}

.dcs-flow-field__hint {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  color: #64748b;
  line-height: 1.35;
}

.dcs-flow-input,
.dcs-flow-select {
  width: 100%;
  box-sizing: border-box;
  min-height: 40px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid #c5d5cd;
  font-size: 13px;
  color: #1e293b;
  background: #fff;
  font-family: inherit;
}

.dcs-flow-input:focus,
.dcs-flow-select:focus {
  outline: none;
  border-color: #5a8f7e;
  box-shadow: 0 0 0 2px rgba(90, 143, 126, 0.2);
}

.dcs-flow-field--checks {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
}

.dcs-flow-field--checks .dcs-flow-field__label {
  width: 100%;
  margin-bottom: 2px;
}

.dcs-flow-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #334155;
  cursor: pointer;
}

.dcs-flow-check--block {
  display: flex;
  margin: 12px 0;
}

.dcs-flow-form-actions {
  grid-column: 1 / -1;
  margin-top: 4px;
}

.dcs-flow-form-actions--inline {
  margin-top: 0;
}

.dcs-flow-btn-primary {
  min-height: 44px;
  padding: 0 22px;
  border-radius: 10px;
}

.dcs-flow-def-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px 24px;
  align-items: start;
  padding-top: 6px;
}

.dcs-flow-def-hero--compact {
  padding-top: 0;
}

.dcs-flow-def-card {
  margin-top: 18px !important;
}

@media (max-width: 720px) {
  .dcs-flow-def-hero {
    grid-template-columns: 1fr;
  }

  .dcs-flow-def-hero__aside {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
  }
}

.dcs-flow-def-title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
  color: #361e1c;
  line-height: 1.2;
}

.dcs-flow-def-stats {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 600;
  color: #5a8f7e;
}

.dcs-flow-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px 20px;
  margin: 0;
}

.dcs-flow-meta-item dt {
  margin: 0 0 3px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #94a3b8;
}

.dcs-flow-meta-item dd {
  margin: 0;
  font-size: 13px;
  color: #334155;
}

.dcs-flow-def-hero__aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.dcs-flow-version-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: #1e3a2f;
  background: linear-gradient(180deg, #dcfce7 0%, #bbf7d0 100%);
  border: 1px solid #86efac;
}

.dcs-flow-id-box {
  width: 100%;
  max-width: 280px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.dcs-flow-id-box__label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 6px;
}

.dcs-flow-id-box__value {
  display: block;
  font-size: 11px;
  word-break: break-all;
  line-height: 1.4;
  color: #475569;
}

.dcs-flow-hint-banner {
  margin: 0 0 14px;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.45;
  color: #475569;
  background: #f1f5f9;
  border-left: 4px solid #64748b;
}

.dcs-flow-table-shell {
  margin-bottom: 4px;
}

.dcs-flow-table .dcs-flow-code {
  font-size: 12px;
  padding: 2px 7px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #0f172a;
  border: 1px solid #e2e8f0;
}

.dcs-flow-state-name {
  font-weight: 500;
}

.dcs-flow-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dcs-flow-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.dcs-flow-pill--on {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.dcs-flow-pill--off {
  background: #f1f5f9;
  color: #94a3b8;
  border: 1px solid #e2e8f0;
}

.dcs-flow-pill--warn {
  background: #ffedd5;
  color: #9a3412;
  border: 1px solid #fed7aa;
}

.dcs-flow-pill--muted {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.dcs-flow-order {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #475569;
}

.dcs-flow-edge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dcs-flow-edge__arr {
  font-size: 14px;
  color: #94a3b8;
  font-weight: 700;
}

.dcs-flow-roles-cell {
  font-size: 12px;
  color: #475569;
  max-width: 320px;
  word-break: break-word;
}

.dcs-flow-empty-panel {
  padding: 22px 18px;
  text-align: center;
  border-radius: 12px;
  border: 1px dashed #c5d5cd;
  background: rgba(255, 255, 255, 0.6);
}

.dcs-flow-empty-panel__title {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
  color: #475569;
}

.dcs-flow-empty-panel__text {
  margin: 0;
  font-size: 13px;
  max-width: 44ch;
  margin-inline: auto;
  line-height: 1.45;
}

.dcs-flow-transition-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px 14px;
  align-items: end;
  margin-bottom: 8px;
}

@media (max-width: 600px) {
  .dcs-flow-transition-row {
    grid-template-columns: 1fr;
  }

  .dcs-flow-transition-row__arrow {
    display: none;
  }
}

.dcs-flow-transition-row__arrow {
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  color: #94a3b8;
  padding-bottom: 10px;
}

.dcs-flow-diagram-card {
  overflow: hidden;
}

.dcs-flow-diagram-section-sub {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.5;
  max-width: 62ch;
  color: #64748b;
}

.dcs-flow-details {
  border: 1px solid #c9ddd4;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.dcs-flow-details__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  color: #361e1c;
  list-style: none;
  user-select: none;
}

.dcs-flow-details__summary::-webkit-details-marker {
  display: none;
}

.dcs-flow-details__summary::before {
  content: "▸";
  margin-right: 8px;
  color: #5a8f7e;
  transition: transform 0.15s ease;
}

.dcs-flow-details[open] .dcs-flow-details__summary::before {
  transform: rotate(90deg);
}

.dcs-flow-details__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

.dcs-flow-details__body {
  padding: 0 16px 16px;
  border-top: 1px solid rgba(54, 30, 28, 0.08);
}

.dcs-flow-diagram {
  margin-top: 4px;
  border-radius: 16px;
  border: 1px solid #d5e3dc;
  background: #fff;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 8px 24px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

.dcs-flow-diagram--anomaly {
  border-top: 3px solid #f59e0b;
}

.dcs-flow-diagram--action {
  border-top: 3px solid #22c55e;
}

.dcs-flow-diagram__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding: 14px 18px;
  background: linear-gradient(180deg, #f8fbf9 0%, #f3f7f5 100%);
  border-bottom: 1px solid #e2ebe6;
}

.dcs-flow-diagram__metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dcs-flow-metric {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
  background: #fff;
  border: 1px solid #e2e8f0;
}

.dcs-flow-metric strong {
  font-size: 14px;
  font-weight: 800;
  color: #1e293b;
}

.dcs-flow-metric--path strong {
  color: #5a8f7e;
}

.dcs-flow-diagram__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.dcs-flow-diagram__legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
}

.dcs-flow-diagram__swatch {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  border: 1px solid transparent;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.04);
}

.dcs-flow-diagram__swatch--start {
  background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%);
  border-color: #f59e0b;
}

.dcs-flow-diagram__swatch--end {
  background: linear-gradient(180deg, #f0fdf4 0%, #dcfce7 100%);
  border-color: #22c55e;
}

.dcs-flow-diagram__swatch--step {
  background: #fff;
  border-color: #cbd5e1;
}

.dcs-flow-diagram__path-summary {
  margin: 0;
  padding: 10px 18px;
  font-size: 12px;
  line-height: 1.45;
  color: #475569;
  background: #fafcfb;
  border-bottom: 1px solid #eef3f0;
}

.dcs-flow-diagram__canvas {
  padding: 22px 18px 18px;
  background-color: #fbfcfb;
  background-image:
    radial-gradient(circle, rgba(90, 143, 126, 0.09) 1px, transparent 1px);
  background-size: 18px 18px;
  overflow-x: auto;
}

.dcs-flow-diagram__pipeline {
  display: flex;
  align-items: stretch;
  gap: 0;
  min-width: min-content;
  padding-bottom: 4px;
}

.dcs-flow-diagram__divider {
  flex: 0 0 auto;
  align-self: center;
  padding: 0 10px;
}

.dcs-flow-diagram__divider span {
  display: block;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #94a3b8;
  padding: 8px 0;
  border-left: 2px dashed #cbd5e1;
  padding-left: 10px;
}

.dcs-flow-step {
  flex: 0 0 auto;
  width: 196px;
  display: flex;
  flex-direction: column;
}

.dcs-flow-step__head {
  margin-bottom: 10px;
}

.dcs-flow-step__label {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #64748b;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #e2e8f0;
}

.dcs-flow-step--start .dcs-flow-step__label {
  color: #9a3412;
  background: #fffbeb;
  border-color: #fde68a;
}

.dcs-flow-step--end .dcs-flow-step__label {
  color: #166534;
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.dcs-flow-step--isolated .dcs-flow-step__label {
  color: #475569;
  background: #f8fafc;
  border-style: dashed;
}

.dcs-flow-step__nodes {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.dcs-flow-node {
  position: relative;
  padding: 14px 14px 13px;
  border-radius: 14px;
  border: 1px solid #dbe3ea;
  background: #fff;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.05),
    0 4px 12px rgba(15, 23, 42, 0.04);
}

.dcs-flow-node--initial {
  border-color: #fbbf24;
  box-shadow:
    0 0 0 1px rgba(245, 158, 11, 0.15),
    0 6px 16px rgba(245, 158, 11, 0.12);
}

.dcs-flow-node--terminal {
  border-color: #4ade80;
  box-shadow:
    0 0 0 1px rgba(34, 197, 94, 0.12),
    0 6px 16px rgba(34, 197, 94, 0.1);
}

.dcs-flow-node__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.dcs-flow-node__index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #334155;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

.dcs-flow-node--initial .dcs-flow-node__index {
  color: #9a3412;
  background: #fef3c7;
  border-color: #fde68a;
}

.dcs-flow-node--terminal .dcs-flow-node__index {
  color: #166534;
  background: #dcfce7;
  border-color: #bbf7d0;
}

.dcs-flow-node__role {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #94a3b8;
}

.dcs-flow-node__name {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
}

.dcs-flow-node__code {
  display: inline-block;
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  padding: 3px 8px;
  border-radius: 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
}

.dcs-flow-connector {
  flex: 0 0 auto;
  width: 132px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 6px 0;
  align-self: stretch;
}

.dcs-flow-connector--muted .dcs-flow-connector__rail {
  opacity: 0.35;
  border-style: dashed;
}

.dcs-flow-connector__rail {
  position: relative;
  width: 100%;
  height: 2px;
  margin-bottom: 12px;
  background: linear-gradient(90deg, #94a3b8 0%, #5a8f7e 100%);
  border-radius: 999px;
}

.dcs-flow-connector__arrow {
  position: absolute;
  right: -1px;
  top: 50%;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid #5a8f7e;
  transform: translateY(-50%);
}

.dcs-flow-connector__links {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dcs-flow-connector__link {
  padding: 9px 10px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.dcs-flow-connector__target {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.25;
  margin-bottom: 4px;
}

.dcs-flow-connector__code {
  display: inline-block;
  font-size: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  padding: 1px 6px;
  border-radius: 5px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #64748b;
}

.dcs-flow-connector__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.dcs-flow-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.dcs-flow-tag--comment {
  color: #9a3412;
  background: #ffedd5;
  border: 1px solid #fed7aa;
}

.dcs-flow-tag--roles {
  color: #3730a3;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
}

.dcs-flow-connector__empty {
  margin: 0;
  font-size: 10px;
  font-style: italic;
  text-align: center;
  color: #94a3b8;
}

.dcs-flow-diagram__callout {
  margin: 0;
  padding: 12px 18px;
  font-size: 12px;
  line-height: 1.45;
  color: #475569;
  background: #fffbeb;
  border-top: 1px solid #fde68a;
}

.dcs-flow-diagram--empty {
  text-align: center;
  padding: 36px 22px;
}

.dcs-flow-diagram__empty-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
  color: #cbd5e1;
}

.dcs-flow-diagram__empty-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
  color: #475569;
}

.dcs-flow-diagram__empty-text {
  margin: 0 auto;
  max-width: 36ch;
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
}

@media (max-width: 720px) {
  .dcs-flow-step {
    width: 172px;
  }

  .dcs-flow-connector {
    width: 108px;
  }

  .dcs-flow-diagram__toolbar {
    flex-direction: column;
    align-items: flex-start;
  }
}

.dcs-flow-builder-card {
  margin-top: 18px !important;
}

.dcs-flow-builder-card__sub {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.45;
  max-width: 58ch;
}

.dcs-flow-builder__tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}

.dcs-flow-builder__tab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #c9ddd4;
  background: #fff;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}

.dcs-flow-builder__tab:hover {
  border-color: #94a3b8;
  background: #fafcfb;
}

.dcs-flow-builder__tab.is-active {
  border-color: #5a8f7e;
  background: linear-gradient(180deg, #f4fbf7 0%, #fff 100%);
  box-shadow: 0 2px 10px rgba(90, 143, 126, 0.12);
}

.dcs-flow-builder__tab-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.dcs-flow-builder__tab.is-active .dcs-flow-builder__tab-num {
  color: #fff;
  background: #5a8f7e;
  border-color: #5a8f7e;
}

.dcs-flow-builder__tab-text {
  flex: 1;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
}

.dcs-flow-builder__panel {
  display: none;
}

.dcs-flow-builder__panel.is-active {
  display: block;
}

.dcs-flow-builder__intro {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.5;
  color: #64748b;
}

.dcs-flow-quick-templates {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.dcs-flow-quick-templates__label {
  display: block;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.dcs-flow-quick-templates__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dcs-flow-preset-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  font-family: inherit;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}

.dcs-flow-preset-chip:hover {
  border-color: #5a8f7e;
  background: #f0fdf4;
}

.dcs-flow-preset-chip code {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 5px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #64748b;
}

.dcs-flow-builder-form {
  padding: 16px;
  border-radius: 14px;
  border: 1px solid #c9ddd4;
  background: #fff;
  margin-bottom: 18px;
}

.dcs-flow-builder-form__row {
  display: grid;
  grid-template-columns: minmax(120px, 180px) minmax(0, 1fr);
  gap: 12px 14px;
  margin-bottom: 12px;
}

.dcs-flow-field--grow {
  min-width: 0;
}

.dcs-flow-flag-toggles {
  margin-bottom: 14px;
}

.dcs-flow-flag-toggles__row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 8px 0 6px;
}

.dcs-flow-flag-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0;
  cursor: pointer;
}

.dcs-flow-flag-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.dcs-flow-flag-toggle span {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  transition:
    color 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease;
}

.dcs-flow-flag-toggle input:checked + span {
  color: #166534;
  background: #dcfce7;
  border-color: #86efac;
}

.dcs-flow-transition-builder {
  padding: 16px;
  border-radius: 14px;
  border: 1px solid #dbeafe;
  background: linear-gradient(180deg, #f8fbff 0%, #fff 100%);
  margin-bottom: 12px;
}

.dcs-flow-transition-builder__pickers {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}

.dcs-flow-transition-builder__arrow {
  display: flex;
  align-items: center;
  padding-bottom: 10px;
  min-width: 48px;
}

.dcs-flow-transition-builder__arrow-line {
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, #94a3b8, #5a8f7e);
  border-radius: 999px;
}

.dcs-flow-transition-builder__arrow-head {
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid #5a8f7e;
}

.dcs-flow-transition-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff;
  border: 1px dashed #cbd5e1;
}

.dcs-flow-transition-preview__from,
.dcs-flow-transition-preview__to {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 8px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #0f172a;
}

.dcs-flow-transition-preview__sep {
  font-size: 18px;
  font-weight: 700;
  color: #5a8f7e;
}

.dcs-flow-advanced {
  margin-bottom: 14px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fafafa;
  overflow: hidden;
}

.dcs-flow-advanced summary {
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  list-style: none;
}

.dcs-flow-advanced summary::-webkit-details-marker {
  display: none;
}

.dcs-flow-advanced__body {
  padding: 0 14px 14px;
  border-top: 1px solid #e2e8f0;
}

.dcs-flow-builder__gate {
  padding: 24px 18px;
  text-align: center;
  border-radius: 14px;
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
  margin-bottom: 18px;
}

.dcs-flow-builder__gate-title {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 700;
  color: #475569;
}

.dcs-flow-builder__gate-text {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.45;
  max-width: 40ch;
  margin-inline: auto;
}

.dcs-flow-builder__list-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.dcs-flow-link-btn {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #c9ddd4;
  background: #fff;
  font-size: 11px;
  font-weight: 600;
  color: #5a8f7e;
  font-family: inherit;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}

.dcs-flow-link-btn:hover {
  background: #f0fdf4;
  border-color: #86efac;
}

.dcs-flow-builder-card--action .dcs-flow-builder__tab.is-active {
  border-color: #22c55e;
  background: linear-gradient(180deg, #f4fdf8 0%, #fff 100%);
  box-shadow: 0 2px 10px rgba(34, 197, 94, 0.12);
}

.dcs-flow-builder-card--action .dcs-flow-builder__tab.is-active .dcs-flow-builder__tab-num {
  background: #22c55e;
  border-color: #22c55e;
}

.dcs-flow-builder-card--action .dcs-flow-preset-chip:hover {
  border-color: #22c55e;
  background: #f0fdf4;
}

.dcs-flow-builder-card--action .dcs-flow-link-btn {
  color: #15803d;
}

.dcs-flow-builder-card--action .dcs-flow-transition-builder {
  border-color: #bbf7d0;
  background: linear-gradient(180deg, #f4fdf8 0%, #fff 100%);
}

@media (max-width: 640px) {
  .dcs-flow-builder-form__row,
  .dcs-flow-transition-builder__pickers {
    grid-template-columns: 1fr;
  }

  .dcs-flow-transition-builder__arrow {
    display: none;
  }
}

.dcs-anomaly-form-card {
  margin-top: 14px;
}

.dcs-anomaly-form {
  margin-top: 12px;
}

.dcs-anomaly-form .dcs-anomaly-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: #361e1c;
}

.dcs-anomaly-form .dcs-anomaly-field > span:first-of-type {
  font-weight: 600;
}

.dcs-anomaly-form .span-2 {
  grid-column: 1 / -1;
}

.dcs-anomaly-field-hint {
  font-size: 11px;
  font-weight: 400;
  margin: 0;
}

.dcs-anomaly-form input,
.dcs-anomaly-form select,
.dcs-anomaly-form textarea {
  font-family: var(--sans, inherit);
  font-size: 13px;
  border: 1px solid #d7d9cf;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: #1e293b;
}

.dcs-anomaly-form input:focus,
.dcs-anomaly-form select:focus,
.dcs-anomaly-form textarea:focus {
  outline: none;
  border-color: #94a3b8;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary, #ff6038) 22%, transparent);
}

.dcs-anomaly-actions {
  padding-top: 4px;
}

.dcs-anomaly-actions .login-submit-btn {
  width: fit-content;
}

.dcs-color-picker-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dcs-color-native-wrap {
  width: 100%;
  height: 48px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line, #e2e8f0);
  background: #fff;
}

.dcs-color-native-wrap input[type="color"].dcs-color-native {
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  border: none;
  cursor: pointer;
}

.dcs-color-presets-label {
  font-size: 11px;
  font-weight: 500;
  color: #64748b;
}

.dcs-color-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.rsv-modal button.dcs-color-preset {
  width: 30px;
  height: 30px;
  min-width: 30px;
  padding: 0 !important;
  border-radius: 50% !important;
  border: 2px solid #fff !important;
  box-shadow: 0 0 0 1px #e2e8f0, 0 2px 6px rgba(15, 23, 42, 0.08);
  background: var(--dcs-preset, #94a3b8) !important;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.rsv-modal button.dcs-color-preset:hover {
  transform: scale(1.08);
  box-shadow: 0 0 0 1px #cbd5e1, 0 4px 12px rgba(15, 23, 42, 0.12);
  filter: none !important;
}

.dcs-category-color-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
  border: 1px solid rgba(15, 23, 42, 0.15);
  flex-shrink: 0;
}

.dcs-category-inline {
  display: inline-flex;
  align-items: center;
}

.dcs-participant-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 180px;
  overflow: auto;
  padding: 10px 12px;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 12px;
  background: #fafafa;
}

.dcs-participant-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}

.dcs-participant-item input {
  flex-shrink: 0;
}

.dcs-recurrence-weekly-wrap,
.dcs-recurrence-custom-wrap {
  margin-top: 4px;
}

.dcs-recurrence-dow-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
}

.dcs-recurrence-dow-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
}

.dcs-recurrence-dow-item input[type="checkbox"] {
  width: auto;
  min-width: 1rem;
  margin: 0;
  accent-color: var(--accent, #2563eb);
}

.dcs-meeting-recurrence-fieldset {
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 12px;
  padding: 12px 14px 14px;
  margin: 0;
}

.dcs-meeting-recurrence-fieldset legend {
  padding: 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.dcs-checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  font-size: 14px;
  cursor: pointer;
}

.dcs-instance-range-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  margin-top: 8px;
}

@media (max-width: 480px) {
  .dcs-instance-range-grid {
    grid-template-columns: 1fr;
  }
}

.dcs-meeting-time-row {
  margin-top: 4px;
}

.dcs-meeting-time-row input[type="time"] {
  max-width: 140px;
}

.dcs-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid #c5dad3;
  border-radius: 14px;
  overflow: hidden;
}

.dcs-kpis > div {
  background: #fff;
  min-height: 88px;
  display: grid;
  place-items: center;
  text-align: center;
  border-right: 1px solid #ece7df;
}

.dcs-kpis > div:last-child {
  border-right: none;
}

.dcs-kpis strong {
  display: block;
  font-size: 38px;
  line-height: 1;
  color: #1a0a00;
}

.dcs-kpis span {
  display: block;
  font-size: 12px;
  color: #4b5563;
}

.dcs-muted {
  margin: 6px 0 10px;
  font-size: 13px;
  color: #64748b;
}

.dcs-list-wrap {
  background: #fff;
}

.dcs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dcs-list-card {
  border: 1px solid #ece7df;
  border-radius: 12px;
  overflow: hidden;
}

.dcs-list-head {
  width: 100%;
  border: none;
  background: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  padding: 10px 12px;
  cursor: pointer;
}

.dcs-list-head strong {
  color: #361e1c;
}

.dcs-list-head span {
  font-size: 12px;
  color: #7f7469;
}

.dcs-list-body {
  display: none;
  border-top: 1px solid #f1ece5;
  background: #f9fafb;
  padding: 10px 12px;
  font-size: 12px;
}

.dcs-list-card--open .dcs-list-body {
  display: grid;
  gap: 8px;
}

.dcs-list-body div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.dcs-list-body span {
  color: #6b7280;
}

.dcs-list-body b {
  color: #1f2937;
}

@media (max-width: 1200px) {
  .dcs-layout {
    flex-direction: column;
  }

  .dcs-left {
    width: auto;
    max-width: none;
    min-width: 0;
    flex: 0 0 auto;
    border-right: none;
  }

  .dcs-layout-splitter {
    display: none !important;
  }
}

/* ============================================================
   RESOURCES VIEW  (rsv-*)
   Matches the "Personas y Maquinarias" Figma design
   ============================================================ */
.resources-view {
  padding: 0;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Remove outer main-content padding only for Resources view */
.main-content:has(.resources-view) {
  padding: 0;
  flex: 1;
  min-height: 0;
}

.main-content:has(.resources-view) .module-root {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* DCS (reuniones) — full-bleed main-content like Resources */
.dcs-view {
  padding: 0;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.main-content:has(.dcs-view) {
  padding: 0;
  flex: 1;
  min-height: 0;
}

.main-content:has(.dcs-view) .module-root {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.dcs-view > .dcs-inner {
  flex: 1;
  min-height: 0;
  min-width: 0;
}

.resources-view > .rsv-layout {
  flex: 1;
  min-height: 0;
}

/* Two-column split layout */
.rsv-layout {
  display: grid;
  grid-template-columns: 480px 1fr;
  grid-template-rows: minmax(0, 1fr);
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ---- LEFT PANEL ---- */
.rsv-left {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line, #e2e8f0);
  background: #fafaf8;
  padding: 20px 24px;
  gap: 0;
  min-height: 0;
  overflow-y: auto;
}

.rsv-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}

.rsv-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #64748b;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-weight: 500;
}

.rsv-back-btn:hover { color: #0f172a; }

.rsv-more-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  border-radius: 6px;
}

.rsv-more-btn:hover { background: #f1f5f9; color: #0f172a; }

/* Header area */
.rsv-left-header {
  margin-bottom: 18px;
}

.rsv-eyebrow {
  font-family: 'Byotone', var(--sans);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1;
  color: #4a2e2a;
  text-transform: uppercase;
  margin: 0 0 4px;
}

.rsv-main-title {
  font-family: 'Mortend', var(--sans);
  font-size: 36px;
  font-style: normal;
  font-weight: 700;
  color: #361E1C;
  letter-spacing: 0;
  line-height: 115%;
  margin: 0 0 8px;
  text-transform: uppercase;
  -webkit-text-stroke-width: 1px;
  -webkit-text-stroke-color: #F5F5ED;
}

.rsv-path {
  font-size: 12px;
  color: #94a3b8;
  margin: 0 0 8px;
}

.rsv-id-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  color: #64748b;
  background: #f1f5f9;
  border-radius: 6px;
  padding: 3px 8px;
}

/* Action bar */
.rsv-action-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.rsv-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1;
  height: 44px;
  border: 1px solid #7f9293;
  background: #fff;
  border-radius: 12px;
  padding: 0 14px;
  font-family: 'Byotone', var(--sans);
  font-size: 14px;
  font-weight: 500;
  font-style: normal;
  line-height: 20px;
  letter-spacing: 0;
  color: #4a2e2a;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.rsv-action-btn:hover {
  background: #fff2ef;
  border-color: #4a2e2a;
  color: #4a2e2a;
}

.rsv-divider {
  border: none;
  border-top: 1px solid #e2e8f0;
  margin: 0 0 20px;
}

/* Stats bar */
.rsv-stats-bar {
  display: flex;
  align-items: center;
  gap: 0;
}

.rsv-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0 16px 0 0;
}

.rsv-stat-value {
  font-size: 2.2rem;
  font-weight: 700;
  color: #1a0a00;
  line-height: 1;
}

.rsv-stat-label {
  font-size: 11px;
  color: #64748b;
  margin-top: 4px;
  line-height: 1.3;
}

.rsv-stat-divider {
  width: 1px;
  height: 48px;
  background: #e2e8f0;
  margin: 0 16px;
  flex-shrink: 0;
}

/* ---- RIGHT PANEL ---- */
.rsv-right {
  display: flex;
  flex-direction: column;
  background: #fff;
  overflow: hidden;
  border-left: 1px solid #ece7df;
  padding: 0 0 8px;
  min-height: 0;
}

/* Plant header (top input) */
.rsv-plant-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid #ece7df;
  background: #fff;
}

.rsv-plant-input {
  width: 100%;
  height: 56px;
  border: 1px solid #dbd7cf;
  border-radius: 16px;
  padding: 8px 20px;
  font-family: "Mortend", var(--sans);
  font-size: 17px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.44;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #361e1c;
  background: #ecebe6;
  outline: none;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  background-image:
    linear-gradient(45deg, transparent 50%, #7f7469 50%),
    linear-gradient(135deg, #7f7469 50%, transparent 50%);
  background-position:
    calc(100% - 22px) calc(50% - 3px),
    calc(100% - 16px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.rsv-plant-input:focus {
  border-color: #c7b9a6;
  box-shadow: 0 0 0 3px rgba(199, 185, 166, 0.28);
}

/* Tabs */
.rsv-right-shell {
  margin: 0 20px 0;
  border: 1px solid #7f9293;
  border-radius: 16px;
  overflow: hidden;
  background: #f5f5ed;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.rsv-tabs {
  display: flex;
  gap: 0;
  padding: 0;
  border-bottom: 1px solid #7f9293;
  background: #ebecdc;
}

.rsv-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-right: 1px solid #7f9293;
  background: #ebecdc;
  border-radius: 0;
  padding: 16px 20px;
  font-family: "Byotone", var(--sans);
  font-size: 14px;
  font-weight: 400;
  font-style: normal;
  line-height: normal;
  letter-spacing: normal;
  color: #000000;
  cursor: pointer;
  text-transform: uppercase;
  transition: color 0.15s, background 0.15s;
}

.rsv-tab:last-child {
  border-right: none;
}

.rsv-tab:not(.rsv-tab--active):hover {
  background: #e5e6d8;
  color: #000000;
}

.rsv-tab--active {
  font-family: "Mortend", var(--sans);
  font-size: 17px;
  font-weight: 700;
  font-style: normal;
  line-height: 1.44;
  letter-spacing: 0.1em;
  color: #361e1c;
  background: #f5f5ed;
}

.rsv-tab--active:hover {
  background: #f5f5ed;
  color: #361e1c;
}

/* Modals — add person / machine */
.rsv-modal-layer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.45);
}

.rsv-modal-layer.hidden {
  display: none;
}

.rsv-modal {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border-radius: 12px;
  padding: 18px 20px 20px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.rsv-modal--wide {
  max-width: min(640px, 96vw);
}

.rsv-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 22px;
  line-height: 1;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  color: #64748b;
  background: transparent !important;
  border: none !important;
  border-radius: 10px;
  font-weight: 400;
  box-shadow: none !important;
}

.rsv-modal-close:hover {
  color: #0f172a;
  background: rgba(15, 23, 42, 0.07) !important;
  filter: none !important;
}

.rsv-modal-title {
  margin: 0 32px 14px 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: #0f172a;
}

.rsv-modal-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rsv-modal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
}

.rsv-modal-field input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
.rsv-modal-field select,
.rsv-modal-field textarea {
  width: 100%;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  color: #0f172a;
  box-sizing: border-box;
}

.rsv-modal-field input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):focus,
.rsv-modal-field select:focus,
.rsv-modal-field textarea:focus {
  outline: none;
  border-color: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.25);
}

.rsv-modal-field .dcs-participant-item input[type="checkbox"] {
  width: auto;
  min-width: 1rem;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 4px;
  box-shadow: none;
  accent-color: var(--accent, #2563eb);
}

.rsv-modal-field-hint {
  font-size: 11px;
  font-weight: 400;
  color: #94a3b8;
  line-height: 1.35;
}

.rsv-modal-err {
  margin: 0;
  font-size: 13px;
  color: #b91c1c;
}

.rsv-modal-err.hidden {
  display: none;
}

.rsv-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.rsv-modal-actions .login-submit-btn {
  min-width: 110px;
}

.rsv-modal-subtitle {
  margin: -4px 0 16px;
  font-size: 13px;
  color: #6b5a52;
}

.rsv-modal-fieldset {
  margin: 0 0 18px;
  padding: 0;
  border: 0;
}

.rsv-modal-fieldset-legend {
  margin: 0 0 12px;
  padding: 0;
  font-family: "Byotone", var(--sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #361e1c;
}

.rsv-modal-fieldset-hint {
  margin: 0 0 12px;
  font-size: 13px;
  color: #6b5a52;
}

.rsv-modal-fieldset--sensors {
  padding-top: 16px;
  border-top: 1px solid #ece7df;
}

.rsv-machine-edit-sensors-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.rsv-machine-edit-sensors-head .rsv-modal-fieldset-legend {
  margin: 0;
}

.rsv-machine-edit-sensors-count {
  font-size: 12px;
  font-weight: 600;
  color: #6b5a52;
  white-space: nowrap;
}

.rsv-machine-edit-sensors-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.rsv-machine-edit-sensors-empty {
  margin: 0;
  padding: 14px 12px;
  font-size: 13px;
  color: #6b5a52;
  border: 1px dashed #d7c8b4;
  border-radius: 10px;
  background: #faf8f4;
  text-align: center;
}

.rsv-machine-edit-sensor-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #ece7df;
  border-radius: 12px;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.rsv-machine-edit-sensor-card--active {
  border-color: #7f9293;
  box-shadow: 0 0 0 1px rgba(127, 146, 147, 0.25);
  background: #faf8f4;
}

.rsv-machine-edit-sensor-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.rsv-machine-edit-sensor-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.rsv-machine-edit-sensor-name {
  font-size: 14px;
  font-weight: 600;
  color: #361e1c;
}

.rsv-machine-edit-sensor-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
}

.rsv-machine-edit-sensor-badge--api {
  background: #e8f4ef;
  color: #2d6a4f;
}

.rsv-machine-edit-sensor-badge--manual {
  background: #f3eee6;
  color: #6b5a52;
}

.rsv-machine-edit-sensor-meta {
  font-size: 12px;
  color: #6b5a52;
}

.rsv-machine-edit-sensor-id {
  font-size: 11px;
  color: #8b735a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  word-break: break-all;
}

.rsv-machine-edit-sensor-actions {
  flex-shrink: 0;
}

.rsv-machine-edit-sensor-connect {
  padding: 8px 12px;
  border: 1px solid #7f9293;
  border-radius: 10px;
  background: #fff;
  font-family: "Byotone", var(--sans);
  font-size: 12px;
  font-weight: 600;
  color: #361e1c;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}

.rsv-machine-edit-sensor-connect:hover {
  background: #f5f5ed;
  border-color: #5f7273;
}

.rsv-sensor-connect-panel {
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid #c5dad3;
  border-radius: 14px;
  background: #f8fbf9;
}

.rsv-sensor-connect-panel.hidden {
  display: none;
}

.rsv-sensor-connect-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.rsv-sensor-connect-title {
  margin: 0;
  font-family: "Byotone", var(--sans);
  font-size: 15px;
  font-weight: 700;
  color: #361e1c;
}

.rsv-sensor-connect-close {
  font-size: 13px;
  font-weight: 600;
  color: #6b5a52;
}

.rsv-sensor-connect-manual {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.rsv-sensor-connect-manual.hidden {
  display: none;
}

.rsv-sensor-connect-manual-text {
  margin: 0;
  font-size: 13px;
  color: #4a2e2a;
  line-height: 1.5;
}

.rsv-sensor-connect-api.hidden {
  display: none;
}

.rsv-sensor-connect-api .mc-api-modal-intro {
  margin-top: 0;
}

.rsv-machine-edit-add-wrap {
  padding-top: 8px;
  border-top: 1px dashed #ece7df;
}

.rsv-machine-edit-toggle-add {
  width: 100%;
  padding: 12px 14px;
  border: 1px dashed #7f9293;
  border-radius: 12px;
  background: #fff;
  font-family: "Byotone", var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: #361e1c;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.rsv-machine-edit-toggle-add:hover,
.rsv-machine-edit-toggle-add--open {
  background: #f5f5ed;
  border-color: #5f7273;
  border-style: solid;
}

.rsv-machine-edit-add-sensor {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
  padding: 16px;
  border: 1px solid #7f9293;
  border-radius: 12px;
  background: #faf8f4;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.rsv-machine-edit-add-sensor.hidden {
  display: none;
}

.rsv-machine-edit-add-sensor-btn {
  align-self: flex-start;
}

@media (max-width: 640px) {
  .rsv-machine-edit-sensor-card {
    flex-direction: column;
    align-items: stretch;
  }

  .rsv-machine-edit-sensor-actions {
    width: 100%;
  }

  .rsv-machine-edit-sensor-connect {
    width: 100%;
  }
}

/* Sensors list (top rows with "Detalle" link) */
.rsv-sensors-list {
  border-bottom: 1px solid #ece7df;
  background: #fff;
}

.rsv-sensor-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  border-bottom: 1px solid #f3eee6;
  font-size: 13px;
  color: #4a2e2a;
}

.rsv-sensor-row:last-child { border-bottom: none; }

.rsv-detail-link {
  font-size: 12px;
  font-weight: 600;
  color: #8b735a;
  text-decoration: none;
  border-bottom: 1px dashed #d7c8b4;
  padding-bottom: 1px;
  transition: color 0.15s;
}

.rsv-detail-link:hover { color: #4a2e2a; border-color: #a58667; }

/* Tab content below pills — matches Figma 1475:19251 (stacked cards on translucent strip) */
.rsv-tab-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.rsv-tab-body > .rsv-sensors-list {
  flex-shrink: 0;
}

.rsv-tab-panel {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.88);
  border-top: 1px solid #c5dad3;
}

.rsv-tab-panel-empty {
  padding: 20px 16px;
  text-align: center;
  font-size: 13px;
  color: #94a3b8;
}

.rsv-plain-stack-card {
  background: #fff;
  border-radius: 8px;
  border: 1px solid #c5dad3;
  overflow: hidden;
}

/* Area rows — card = beige rounded shell per area */
.rsv-area-block {
  border-bottom: none;
}

.rsv-area-block--card {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px 4px;
  background: #f5f5ed;
  border: 1px solid #c5dad3;
  border-radius: 12px;
}

.rsv-area-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  background: transparent;
  font-size: 13px;
  color: #4a2e2a;
}

.rsv-area-block--card > .rsv-area-children {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 4px 2px;
}

.rsv-area-type-label {
  font-size: 10px;
  color: #7f9293;
  font-weight: 400;
  letter-spacing: 0.05em;
  margin-left: 0;
  margin-right: 0;
}

.rsv-area-block--card .rsv-area-row .rsv-row-name {
  font-size: 18px;
  letter-spacing: 0.03em;
  color: #361e1c;
}

.rsv-area-block--card .rsv-area-row .rsv-row-icon {
  box-sizing: border-box;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  background: #fff;
  border: 1px solid #ebedf0;
  border-radius: 6px;
}

.rsv-area-block--card .rsv-area-row .rsv-area-code {
  margin-left: 0;
  padding: 4px 8px;
  background: #ebecdc;
  border: 1px solid #ebecdc;
  border-radius: 6px;
  font-size: 14px;
  font-family: "Byotone", var(--sans), ui-monospace, monospace;
  color: #7f9293;
}

.rsv-area-block--card .rsv-area-row .rsv-count-badge {
  margin-left: auto;
  gap: 2px;
  padding: 2px 4px;
  font-family: "Byotone", var(--sans);
  font-size: 14px;
  font-weight: 500;
  color: #361e1c;
  background: transparent;
}

/* Toggle button (chevron) */
.rsv-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  color: #64748b;
  transition: transform 0.18s;
  flex-shrink: 0;
  border-radius: 4px;
}

.rsv-toggle-btn:hover { background: #e2e8f0; color: #0f172a; }

.rsv-chevron { transform: rotate(0deg); }
.rsv-chevron--open { transform: rotate(90deg); }

/* Workstation / subgroup card — white block inside area card */
.rsv-workstation-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px 8px 8px;
  background: #fff;
  border-radius: 8px;
}

.rsv-workstation-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 6px 4px;
  border-bottom: none;
  font-size: 13px;
  color: #334155;
  font-weight: 500;
}

.rsv-workstation-row .rsv-row-name {
  font-size: 18px;
  letter-spacing: 0.03em;
  color: #361e1c;
}

.rsv-workstation-row .rsv-row-type-label {
  font-size: 14px;
  color: #7f9293;
}

.rsv-workstation-row .rsv-row-icon {
  box-sizing: border-box;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  background: #fff;
  border: 1px solid #ebedf0;
  border-radius: 6px;
}

.rsv-workstation-row .rsv-count-badge {
  margin-left: auto;
  gap: 2px;
  padding: 4px 8px;
  font-size: 14px;
  font-weight: 400;
  color: #7f9293;
  background: #ebecdc;
  border: 1px solid #ebecdc;
}

/* Nested person/machine stack — bordered beige inner panel */
.rsv-nested-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
  background: rgba(245, 245, 237, 0.35);
  border: 1px solid #c5dad3;
  border-radius: 8px;
}

/* Person rows */
.rsv-person-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px;
  border-bottom: 1px solid rgba(197, 218, 211, 0.65);
  font-size: 13px;
  color: #334155;
  background: transparent;
}

.rsv-person-row:last-child {
  border-bottom: none;
}

.rsv-nested-stack .rsv-person-row .rsv-row-name,
.rsv-nested-stack .rsv-machine-row .rsv-row-name {
  font-size: 18px;
  letter-spacing: 0.03em;
  color: #361e1c;
}

.rsv-nested-stack .rsv-person-row .rsv-row-type-label,
.rsv-nested-stack .rsv-machine-row .rsv-row-type-label {
  font-size: 14px;
  color: #7f9293;
}

.rsv-nested-stack .rsv-person-row .rsv-row-icon,
.rsv-nested-stack .rsv-machine-row .rsv-row-icon {
  box-sizing: border-box;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  background: #fff;
  border: 1px solid #ebedf0;
  border-radius: 6px;
}

/* Shared row elements */
.rsv-row-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rsv-row-icon {
  color: #7f9293;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.rsv-row-type-label {
  font-size: 11px;
  color: #94a3b8;
  white-space: nowrap;
}

.rsv-indent-icon {
  color: #cbd5e1;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

/* Nested rows (persons + machines): right-arrow.svg (13×11) */
.rsv-indent-icon--branch {
  width: 16px;
  justify-content: center;
}

.rsv-hierarchy-branch-img {
  display: block;
  flex-shrink: 0;
}

.rsv-area-code {
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, monospace;
  color: #94a3b8;
  margin-left: 2px;
}

/* Count badges */
.rsv-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  background: #f1f5f9;
  border-radius: 6px;
  padding: 2px 6px;
  margin-left: auto;
}

/* Shift / assign badges */
.rsv-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 20px;
  padding: 3px 9px;
  white-space: nowrap;
  flex-shrink: 0;
}

.rsv-badge--shift {
  background: #e0f2fe;
  color: #0369a1;
}

.rsv-badge--nominal {
  background: #ebecdc;
  color: #7f9293;
  font-size: 12px;
}

.rsv-badge--assign {
  background: #fef3c7;
  color: #92400e;
  cursor: pointer;
}

.rsv-badge--assign:hover {
  background: #fde68a;
}

/* Three-dot menu button */
.rsv-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: none;
  border: none;
  cursor: pointer;
  color: #cbd5e1;
  border-radius: 4px;
  flex-shrink: 0;
  transition: background 0.12s, color 0.12s;
}

.rsv-menu-btn:hover { background: #f1f5f9; color: #64748b; }

/* Panel footer */
.rsv-panel-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 20px;
  border-top: 1px solid #ece7df;
  background: #fff;
  font-size: 12px;
  color: #7f7469;
}

.rsv-footer-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
}

/* ---- Resources / machine detail — loading skeletons (rsv-skel-*) ---- */
@keyframes rsv-skel-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

.rsv-skel-root {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
  min-height: 0;
}

.rsv-skel-root--left {
  gap: 14px;
}

.rsv-skel-root--right {
  flex: 1;
  min-height: 0;
}

.rsv-skel-line,
.rsv-skel-breadcrumb,
.rsv-skel-pill,
.rsv-skel-tab,
.rsv-skel-photo,
.rsv-md-states-skel-chart,
.rsv-skel-dot {
  background: linear-gradient(
    110deg,
    #ecebe6 0%,
    #f5f5ed 42%,
    #ecebe6 84%
  );
  background-size: 220% 100%;
  animation: rsv-skel-shimmer 1.35s ease-in-out infinite;
  border-radius: 8px;
}

.rsv-skel-line {
  display: block;
  height: 12px;
  max-width: 100%;
}

.rsv-skel-breadcrumb {
  width: 52%;
  height: 14px;
  border-radius: 6px;
  margin-bottom: 0;
}

.rsv-skel-line--eyebrow {
  width: 38%;
  height: 10px;
}

.rsv-skel-line--title {
  width: 72%;
  height: 26px;
  border-radius: 10px;
}

.rsv-action-bar--skel {
  margin-bottom: 0;
}

.rsv-skel-pill {
  flex: 1;
  height: 44px;
  border-radius: 12px;
}

.rsv-skel-pill--narrow {
  flex: 0 0 auto;
  width: 132px;
  height: 36px;
}

.rsv-stats-bar--skel {
  padding-top: 6px;
  border-top: 1px solid #ece7df;
  margin-top: 4px;
}

.rsv-skel-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 12px;
}

.rsv-stats-bar--skel .rsv-skel-stat + .rsv-skel-stat {
  border-left: 1px solid #ece7df;
  padding-left: 16px;
}

.rsv-skel-line--stat-num {
  width: 48%;
  height: 28px;
}

.rsv-skel-line--stat-label {
  width: 70%;
  height: 10px;
}

.rsv-skel-line--plant {
  width: 100%;
  height: 56px;
  border-radius: 16px;
}

.rsv-tabs--skel {
  pointer-events: none;
}

.rsv-skel-tab {
  flex: 1;
  height: 52px;
  border-radius: 0;
  border-right: 1px solid rgba(127, 146, 147, 0.35);
}

.rsv-skel-tab:last-child {
  border-right: none;
}

.rsv-tab-body--skel {
  flex: 1;
  min-height: 260px;
}

.rsv-sensors-list--skel {
  border-bottom: 1px solid #ece7df;
}

.rsv-skel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  border-bottom: 1px solid #f3eee6;
}

.rsv-skel-row:last-child {
  border-bottom: none;
}

.rsv-skel-line--row-name {
  flex: 1;
  max-width: 62%;
  height: 14px;
}

.rsv-skel-line--row-action {
  width: 72px;
  height: 12px;
}

.rsv-tab-panel--skel {
  gap: 8px;
  padding: 10px 8px;
}

.rsv-skel-area {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 8px;
  background: #f5f5ed;
  border: 1px solid #c5dad3;
  border-radius: 12px;
}

.rsv-skel-line--area-head {
  width: 55%;
  height: 14px;
}

.rsv-skel-line--area-sub {
  width: 88%;
  height: 11px;
}

.rsv-panel-footer--skel {
  justify-content: center;
}

.rsv-skel-line--footer {
  width: 40%;
  height: 12px;
}

/* Machine detail — Estados / Detenciones inline skeletons */
.rsv-md-states-skel {
  padding: 16px 18px 18px;
}

.rsv-md-states-skel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 160px);
  gap: 20px;
  align-items: center;
  margin-bottom: 18px;
}

.rsv-md-states-skel-chart {
  width: 100%;
  max-width: 240px;
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 50%;
}

.rsv-md-states-skel-legend {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rsv-md-states-skel-legend-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rsv-skel-dot {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.rsv-skel-line--legend {
  flex: 1;
  height: 12px;
}

.rsv-md-states-skel-top {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.rsv-md-states-skel-card {
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid #c5dad3;
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rsv-skel-line--card-a {
  width: 55%;
  height: 13px;
}

.rsv-skel-line--card-b {
  width: 38%;
  height: 11px;
}

.rsv-md-downtimes-skel {
  padding: 14px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rsv-skel-line--meta {
  width: 220px;
  height: 13px;
}

.rsv-md-downtimes-skel-table-wrap {
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid #c5dad3;
}

.rsv-md-downtimes-skel-table {
  background: rgba(255, 255, 255, 0.85);
}

.rsv-md-downtimes-skel-head,
.rsv-md-downtimes-skel-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.9fr 0.9fr 0.85fr 0.85fr;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
}

.rsv-md-downtimes-skel-head {
  background: #f5f5ed;
  border-bottom: 1px solid #c5dad3;
}

.rsv-md-downtimes-skel-row:nth-child(even) {
  background: rgba(245, 245, 237, 0.45);
}

.rsv-skel-line--th {
  height: 11px;
}

.rsv-skel-line--td {
  height: 13px;
}

/* Machine detail — full layout before hierarchy/data */
.rsv-md-layout--skeleton {
  pointer-events: none;
}

.rsv-md-layout--skeleton .rsv-md-back {
  pointer-events: auto;
}

.rsv-md-hero--skel {
  align-items: stretch;
}

.rsv-skel-photo {
  flex-shrink: 0;
  width: 161px;
  min-height: 200px;
  border-radius: 12px;
}

.rsv-skel-line--hero-label {
  width: 28%;
  height: 11px;
}

.rsv-skel-line--hero-title {
  width: 92%;
  height: 24px;
}

.rsv-skel-line--hero-crumb {
  width: 75%;
  height: 12px;
}

.rsv-md-section .rsv-skel-line--section-title {
  width: 44%;
  height: 13px;
  margin-bottom: 14px;
}

.rsv-skel-dl-row {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
}

.rsv-skel-line--dt {
  height: 11px;
}

.rsv-skel-line--dd {
  height: 13px;
}

.rsv-skel-line--ws {
  width: 100%;
  height: 72px;
  border-radius: 12px;
}

.rsv-md-card--skel-block {
  overflow: hidden;
}

.rsv-md-card-skel-body {
  padding: 16px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rsv-skel-line--card-head {
  width: 42%;
  height: 15px;
}

.rsv-skel-line--block-a {
  width: 100%;
  height: 14px;
}

.rsv-skel-line--block-b {
  width: 88%;
  height: 12px;
}

.rsv-skel-line--block-c {
  width: 62%;
  height: 12px;
}

@media (prefers-reduced-motion: reduce) {
  .rsv-skel-line,
  .rsv-skel-breadcrumb,
  .rsv-skel-pill,
  .rsv-skel-tab,
  .rsv-skel-photo,
  .rsv-md-states-skel-chart,
  .rsv-skel-dot {
    animation: none;
    background: #ecebe6;
  }
}

@media (max-width: 900px) {
  .rsv-md-states-skel-grid {
    grid-template-columns: 1fr;
  }

  .rsv-md-states-skel-top {
    grid-template-columns: 1fr;
  }
}

body.layout-resource-machine-detail .module-root {
  max-width: 100%;
}

.resources-view .rsv-layout.hidden {
  display: none !important;
}

.rsv-machine-row {
  cursor: pointer;
}

.rsv-machine-row:hover {
  background: rgba(255, 255, 255, 0.45);
}

/* Resources — machine detail (two-column, mock-aligned) */
.rsv-md-layer {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fafaf8;
}

.rsv-md-layer.hidden {
  display: none !important;
}

/*
 * Figma: node 1447:14379 — "Volver atrás"
 * Byotone Medium 14px / line-height 20 / letter-spacing 0 / #361e1c
 */
.rsv-md-layer .rsv-back-btn.rsv-md-back {
  font-family: "Byotone", var(--sans);
  font-size: 14px;
  font-weight: 500;
  font-style: normal;
  line-height: 20px;
  letter-spacing: 0;
  color: #361e1c;
  white-space: nowrap;
}

.rsv-md-layer .rsv-back-btn.rsv-md-back:hover {
  color: #2c1816;
}

.rsv-md-layer .rsv-back-btn.rsv-md-back:focus-visible {
  outline: 2px solid rgba(54, 30, 28, 0.35);
  outline-offset: 3px;
}

/* wordpress:chevron-left-small (path inlined in JS) — inherits button color #361e1c */
.rsv-md-layer .rsv-md-back-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  color: inherit;
}

.rsv-md-layer .rsv-md-back-svg {
  display: block;
  width: 24px;
  height: 24px;
  color: inherit;
}

.rsv-md-layout {
  display: grid;
  grid-template-columns: minmax(380px, 620px) 1fr;
  grid-template-rows: 1fr;
  align-items: stretch;
  flex: 1;
  min-height: 0;
  gap: 0;
}

.rsv-md-layout--empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  padding: 24px;
}

.rsv-md-error {
  margin: 0;
  color: #991b1b;
  font-size: 14px;
}

.rsv-md-aside {
  background: #fff;
  border-right: 1px solid #ece7df;
  padding: 20px 22px 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
}

/* Figma 1447:14382 — machine hero row (image + title block + edit outline button) */
.rsv-md-hero {
  display: flex;
  align-items: stretch;
  gap: 16px;
  box-sizing: border-box;
}

.rsv-md-hero-photo-card {
  flex-shrink: 0;
  width: 161px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 8px -2px rgba(16, 24, 40, 0.1);
  background: #f8fafc;
}

.rsv-md-hero-photo {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 200px;
  object-fit: cover;
}

.rsv-md-hero-meta {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  justify-content: center;
}

/* Figma 1447:14385 — Enunciado: Byotone Regular 20px, line-height 100%, letter-spacing 0, #361e1c */
.rsv-md-hero-label {
  font-family: "Byotone", var(--sans);
  font-size: 20px;
  font-weight: 400;
  font-style: normal;
  line-height: 1;
  letter-spacing: 0;
  color: #361e1c;
  text-transform: uppercase;
  margin: 0;
  padding: 0;
  width: 100%;
  font-synthesis: none;
}

/* Figma 1447:14386 — Mortend Bold 36px, line-height 1.15, uppercase, #361e1c */
.rsv-md-hero-title {
  font-family: "Mortend", var(--sans);
  font-size: 36px;
  font-weight: 700;
  font-style: normal;
  line-height: 1.15;
  letter-spacing: 0;
  color: #361e1c;
  text-transform: uppercase;
  margin: 0;
  width: 100%;
  word-break: break-word;
  font-synthesis: none;
}

.rsv-md-hero-meta-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 20px;
  width: 100%;
}

.rsv-md-hero-breadcrumb {
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
  font-family: "Byotone", var(--sans);
  font-size: 16px;
  font-weight: 500;
  font-style: normal;
  line-height: 16px;
  letter-spacing: 0;
  color: #361e1c;
  word-break: break-word;
}

.rsv-md-hero-id {
  flex-shrink: 0;
  margin: 0;
  white-space: nowrap;
  font-family: "Byotone", var(--sans);
  font-size: 16px;
  font-weight: 500;
  font-style: normal;
  line-height: 16px;
  letter-spacing: 0;
  color: #361e1c;
}

.rsv-md-hero-edit {
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: 12px 16px;
  border: 1px solid #7f9293;
  border-radius: 12px;
  background: #fff;
  font-family: "Byotone", var(--sans);
  font-size: 14px;
  font-weight: 500;
  font-style: normal;
  line-height: 20px;
  letter-spacing: 0;
  color: #361e1c;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.rsv-md-hero-edit:hover {
  background: #f5f5ed;
  border-color: #5f7273;
}

.rsv-md-hero-edit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.rsv-md-section {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid #ece7df;
}

.rsv-md-section-title {
  font-family: "Byotone", var(--sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #361e1c;
  margin: 0 0 12px;
  text-transform: uppercase;
}

/* Figma Titulo 5 (e.g. 1447:14396, 1613:1637): Mortend Bold 17px, lh 1.44, tracking 1.7px */
.rsv-md-section-title.rsv-md-section-title--headline {
  font-family: "Mortend", var(--sans);
  font-size: 17px;
  font-weight: 700;
  font-style: normal;
  line-height: 1.44;
  letter-spacing: 1.7px;
  color: #361e1c;
  font-synthesis: none;
}

.rsv-md-dl {
  margin: 0;
}

.rsv-md-dl-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
}

.rsv-md-dl-row:last-child {
  border-bottom: none;
}

.rsv-md-dl-row dt {
  margin: 0;
  font-family: "Byotone", var(--sans);
  font-size: 14px;
  font-weight: 400;
  font-style: normal;
  line-height: 16px;
  letter-spacing: 0;
  color: #361e1c;
}

.rsv-md-dl-row dd {
  margin: 0;
  font-family: "Byotone", var(--sans);
  font-size: 16px;
  font-weight: 500;
  font-style: normal;
  line-height: 16px;
  letter-spacing: 0;
  text-align: right;
  color: #361e1c;
}

.rsv-md-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rsv-md-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: #ebecdc;
  color: #4a2e2a;
  border: 1px solid #d8dcc4;
}

.rsv-md-tag--muted {
  font-weight: 500;
  opacity: 0.85;
}

/* Figma 1613:1622 + 1613:1624 — product supported chips */
.rsv-md-product-chip-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.rsv-md-product-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #7f9293;
  background: #c5dad3;
  color: #361e1c;
  font-family: "Byotone", var(--sans);
  font-size: 14px;
  font-weight: 400;
  font-style: normal;
  line-height: 16px;
  letter-spacing: 0;
  text-align: right;
  white-space: nowrap;
}

.rsv-md-product-chip--muted {
  opacity: 0.85;
}

.rsv-md-muted {
  margin: 0;
  font-size: 13px;
  color: #94a3b8;
}

.rsv-md-ws-block {
  margin-bottom: 14px;
}

.rsv-md-ws-title {
  font-size: 13px;
  font-weight: 700;
  color: #361e1c;
  margin-bottom: 6px;
}

.rsv-md-main {
  background: #ebecdc;
  padding: 20px 22px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  overflow-y: auto;
}

.rsv-md-card {
  background: #fff;
  border: 1px solid #ece7df;
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.rsv-md-card-title {
  font-family: "Byotone", var(--sans);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #361e1c;
  margin: 0 0 14px;
  text-transform: uppercase;
}

/* Figma 1613:1676 — Sensors area title container */
.rsv-md-card--sensors {
  padding: 0;
  overflow: visible;
}

.rsv-md-sensors-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #f5f5ed;
  padding: 12px 24px;
  margin: 0;
  border-radius: 16px 16px 0 0;
  border: none;
}

.rsv-md-sensors-config-btn {
  flex-shrink: 0;
  padding: 8px 14px;
  border: 1px solid #7f9293;
  border-radius: 10px;
  background: #fff;
  font-family: "Byotone", var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: #361e1c;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.rsv-md-sensors-config-btn:hover {
  background: #faf8f4;
  border-color: #5f7273;
}

.rsv-md-card-title.rsv-md-card-title--sensors {
  margin: 0;
  font-family: "Mortend", var(--sans);
  font-size: 17px;
  font-weight: 700;
  font-style: normal;
  line-height: 1.44;
  letter-spacing: 1.7px;
  color: #361e1c;
  text-transform: uppercase;
  font-synthesis: none;
}

/* Estados: same title band as Sensores (reuse .rsv-md-sensors-head / --sensors title). */
.rsv-md-card--states {
  padding: 0;
  overflow: visible;
}

.rsv-md-states-panel {
  padding: 16px 20px 18px;
  background: rgba(255, 255, 255, 0.88);
  border-top: 1px solid #c5dad3;
}

.rsv-md-states-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 14px;
}

.rsv-md-states-toolbar .rsv-md-chart-date-pill {
  margin-bottom: 0;
}

.rsv-md-downtimes-meta {
  margin: 0 0 12px;
  font-family: "Byotone", var(--sans);
  font-size: 12px;
  font-weight: 500;
  color: #7f9293;
}

.rsv-md-downtimes-wrap {
  overflow-x: auto;
  border: 1px solid #c5dad3;
  border-radius: 12px;
  background: #fff;
}

.rsv-md-downtimes-wrap .dm-table {
  margin: 0;
}

.rsv-md-downtimes-wrap .dm-table thead th {
  font-family: "Byotone", var(--sans);
}

.rsv-md-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.rsv-md-card-head .rsv-md-card-title {
  margin: 0;
}

.rsv-md-date-pill {
  font-size: 12px;
  font-weight: 600;
  color: #7f7469;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #dbd7cf;
  background: #fafaf8;
  white-space: nowrap;
}

.rsv-md-sensor-list {
  background: rgba(255, 255, 255, 0.88);
  border-top: 1px solid #c5dad3;
  border-bottom: 1px solid #c5dad3;
  border-left: none;
  border-right: none;
  border-radius: 16px 16px 0 0;
  padding: 18px 20px;
  margin-bottom: 0;
}

.rsv-md-sensor-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 0 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid #c5dad3;
}

.rsv-md-sensor-row:last-child {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: none;
}

/* Figma 1460:17594 — Titulo 3: Byotone Medium 16 / 16, tracking 0 */
.rsv-md-sensor-name {
  font-family: "Byotone", var(--sans);
  font-size: 16px;
  font-weight: 500;
  font-style: normal;
  line-height: 16px;
  letter-spacing: 0;
  color: #000000;
}

.rsv-md-sensor-row .rsv-detail-link {
  border: none;
  padding: 0;
  margin: 0;
  background: transparent;
  text-decoration: none;
  font-family: "Byotone", var(--sans);
  font-size: 16px;
  font-weight: 500;
  font-style: normal;
  line-height: 16px;
  letter-spacing: 0;
  color: #361e1c;
}

.rsv-md-sensor-row .rsv-detail-link:hover {
  color: #4a2e2a;
}

.rsv-md-sensor-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
  padding: 12px 20px 18px;
  align-items: stretch;
}

.rsv-md-sensor-chart {
  position: relative;
  overflow: visible;
  min-width: 0;
  border: 1px solid #c5dad3;
  border-radius: 12px;
  padding: 10px 14px 14px;
  background: rgba(255, 255, 255, 0.88);
}

.rsv-md-chart-date-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #c5dad3;
  background: #f5f5ed;
  font-family: "Byotone", var(--sans);
  font-size: 12px;
  font-weight: 400;
  line-height: 16px;
  color: #361e1c;
  margin-bottom: 12px;
  cursor: pointer;
}

.rsv-md-chart-date-input {
  width: 92px;
  border: none;
  outline: none;
  background: transparent;
  color: #361e1c;
  font-family: "Byotone", var(--sans);
  font-size: 12px;
  font-weight: 400;
  line-height: 16px;
  letter-spacing: 0;
  padding: 0;
  margin: 0;
  pointer-events: none;
}

.rsv-md-chart-pill-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #4a2e2a;
}

.rsv-md-range-panel {
  /* position/top/left set inline as fixed when open — see positionMdRangePanel */
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 4;
  min-width: 210px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #c5dad3;
  background: #fff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
}

.rsv-md-range-panel.hidden {
  display: none;
}

.rsv-md-range-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
  color: #4a2e2a;
  font-family: "Byotone", var(--sans);
  font-size: 11px;
}

.rsv-md-range-field-input {
  border: 1px solid #d8dcc4;
  border-radius: 6px;
  padding: 6px 8px;
  font-family: inherit;
  font-size: 12px;
}

.rsv-md-range-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.rsv-md-range-cancel,
.rsv-md-range-apply {
  border: 1px solid #c5dad3;
  background: #f5f5ed;
  color: #361e1c;
  border-radius: 6px;
  padding: 4px 8px;
  font-family: "Byotone", var(--sans);
  font-size: 12px;
  cursor: pointer;
}

.rsv-md-range-apply {
  background: #c5dad3;
  border-color: #7f9293;
}

.rsv-md-chart-kpi-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 10px;
}

/* Figma 1460:17594 — Titulo 3 */
.rsv-md-chart-title {
  font-family: "Byotone", var(--sans);
  font-size: 16px;
  font-weight: 500;
  font-style: normal;
  line-height: 16px;
  letter-spacing: 0;
  color: #000000;
}

/* Figma 1460:17777 — KPI “3.000 unidades”: Byotone Light 40/1.4 + Byotone Regular 14/16 */
.rsv-md-kpi {
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 6px;
  color: #000000;
  text-align: right;
  white-space: nowrap;
}

.rsv-md-kpi-number {
  font-family: "Byotone", var(--sans);
  font-size: 40px;
  font-weight: 300;
  font-style: normal;
  line-height: 1.4;
  letter-spacing: 0;
  color: #000000;
}

.rsv-md-kpi-unit {
  font-family: "Byotone", var(--sans);
  font-size: 14px;
  font-weight: 400;
  font-style: normal;
  line-height: 16px;
  letter-spacing: 0;
  color: #000000;
}

.rsv-md-heatmap-grid-wrap {
  display: flex;
  align-items: stretch;
  gap: 4px;
  margin-bottom: 10px;
}

.rsv-md-heatmap-y-axis {
  width: 27px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-bottom: 11px;
  font-family: "Byotone", var(--sans);
  font-size: 10px;
  font-weight: 400;
  line-height: 16px;
  letter-spacing: 0.5px;
  color: #11363e;
}

.rsv-md-heatmap {
  --cols: 7;
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(10px, 1fr));
  gap: 2px;
  align-items: end;
  min-height: 112px;
}

.rsv-md-heatmap-col {
  display: grid;
  grid-template-rows: repeat(9, 12px);
  gap: 2px;
}

.rsv-md-heatmap-slot {
  cursor: crosshair;
}

.rsv-md-chart-heatmap-tooltip {
  position: absolute;
  z-index: 40;
  max-width: 292px;
  padding: 10px 12px;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(17, 54, 62, 0.18);
  background: #fffefb;
  border: 1px solid #c5dad3;
  font-family: "Byotone", var(--sans);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.48;
  color: #11363e;
  pointer-events: none;
}

.rsv-md-chart-heatmap-tooltip.hidden {
  display: none;
}

.rsv-md-chart-heatmap-tooltip-title {
  margin: 0 0 6px;
  font-weight: 600;
  font-size: 12px;
  color: #361e1c;
}

.rsv-md-chart-heatmap-tooltip-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 0;
  padding-top: 4px;
}

.rsv-md-chart-heatmap-tooltip-row:first-of-type {
  padding-top: 0;
}

.rsv-md-chart-heatmap-tooltip-dot {
  width: 8px;
  height: 8px;
  margin-top: 3px;
  border-radius: 2px;
  flex-shrink: 0;
}

.rsv-md-chart-heatmap-tooltip-dot--produced {
  background: #cb4017;
}

.rsv-md-chart-heatmap-tooltip-dot--planned {
  background: #a0c9cb;
}

.rsv-md-chart-heatmap-tooltip-dot--empty {
  background: transparent;
  border: 1px dashed #a0c9cb;
}

.rsv-md-chart-heatmap-tooltip-note {
  color: #5c726f;
}

.rsv-md-chart-heatmap-tooltip-muted {
  margin: 8px 0 0;
  font-size: 10px;
  font-weight: 400;
  line-height: 1.45;
  color: #7f9293;
}

.rsv-md-chart-heatmap-tooltip-hint {
  margin: 6px 0 0;
  font-size: 10px;
  font-weight: 400;
  line-height: 1.45;
  color: #7f9293;
}

.rsv-md-heatmap-cell {
  display: block;
  background: #ebecdc;
}

.rsv-md-heatmap-cell--planned {
  background: #a0c9cb;
}

.rsv-md-heatmap-cell--produced {
  background: #cb4017;
}

.rsv-md-heatmap-x-axis {
  --cols: 7;
  position: relative;
  min-height: 20px;
  display: flex;
  padding-left: 31px;
  font-family: "Byotone", var(--sans);
  font-size: 10px;
  font-weight: 400;
  line-height: 16px;
  letter-spacing: 0.5px;
  color: #7f9293;
}

.rsv-md-heatmap-x-tick {
  position: absolute;
  left: calc((100% - 31px) * ((var(--tick-col) - 0.5) / var(--cols)) + 31px);
  transform: translateX(-50%);
}

.rsv-md-placeholder-note {
  margin: 0;
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.45;
}

.rsv-md-placeholder-note--small {
  margin-top: 10px;
}

.rsv-md-states-data {
  min-height: 120px;
}

.rsv-md-states-degraded {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #fbbf24;
  background: #fffbeb;
  font-family: "Byotone", var(--sans);
  font-size: 12px;
  line-height: 1.45;
  color: #92400e;
}

.rsv-md-states-empty {
  padding: 12px 0;
}

.rsv-md-states-grid {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(240px, 1fr);
  gap: 20px 32px;
  align-items: start;
}

.rsv-md-states-section-label {
  margin: 0 0 12px;
  font-family: "Byotone", var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: #361e1c;
  letter-spacing: 0.02em;
}

.rsv-md-states-donut-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 16px 24px;
}

/* Figma 1460:18483 — half donut + hover tooltip */
.rsv-md-states-chart-shell {
  position: relative;
  flex-shrink: 0;
  width: 270px;
  max-width: 100%;
}

.rsv-md-states-half-svg {
  display: block;
  width: 270px;
  max-width: 100%;
  height: auto;
}

.rsv-md-states-seg {
  cursor: crosshair;
  stroke: transparent;
  stroke-width: 0;
  transition: filter 0.14s ease;
}

.rsv-md-states-seg:hover {
  filter: brightness(0.93);
}

.rsv-md-states-chart-tooltip {
  position: fixed;
  z-index: 4500;
  max-width: 280px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #c5dad3;
  background: #fffefb;
  box-shadow: 0 8px 24px rgba(17, 54, 62, 0.18);
  font-family: "Byotone", var(--sans);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.45;
  color: #11363e;
  pointer-events: none;
}

.rsv-md-states-chart-tooltip.hidden {
  display: none;
}

.rsv-md-states-tip-title {
  margin: 0 0 6px;
  font-weight: 600;
  font-size: 12px;
  color: #361e1c;
}

.rsv-md-states-tip-line {
  margin: 4px 0 0;
}

.rsv-md-states-tip-line:first-of-type {
  margin-top: 0;
}

.rsv-md-states-tip-muted {
  color: #7f9293;
  font-weight: 400;
}

.rsv-md-states-type-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1 1 160px;
  min-width: 140px;
  font-family: "Byotone", var(--sans);
  font-size: 12px;
  color: #361e1c;
}

.rsv-md-states-type-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}

.rsv-md-states-type-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex-shrink: 0;
  margin-top: 4px;
}

.rsv-md-states-type-label {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.35;
}

.rsv-md-states-type-min {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  color: #11363e;
}

.rsv-md-states-type-row--unassigned .rsv-md-states-type-label {
  color: #64748b;
}

.rsv-md-states-type-row--unassigned .rsv-md-states-type-min {
  color: #94a3b8;
}

.rsv-md-states-top-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rsv-md-states-top-item {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #c5dad3;
  background: rgba(255, 255, 255, 0.95);
}

.rsv-md-states-top-line1 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-family: "Byotone", var(--sans);
  font-size: 13px;
  color: #361e1c;
}

.rsv-md-states-top-line1 strong {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.rsv-md-states-top-type--unassigned {
  color: #64748b;
  font-weight: 600;
}

.rsv-md-states-top-line2 {
  margin-top: 6px;
  font-family: "Byotone", var(--sans);
  font-size: 11px;
  line-height: 1.4;
  color: #7f9293;
}

@media (max-width: 640px) {
  .rsv-md-sensor-charts {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px 16px 16px;
  }

  .rsv-md-states-grid {
    grid-template-columns: 1fr;
  }
}

/* Responsive: stack on narrow viewports */
@media (max-width: 900px) {
  .rsv-md-layout {
    grid-template-columns: 1fr;
  }

  .rsv-md-aside {
    border-right: none;
    border-bottom: 1px solid #ece7df;
  }

  .rsv-md-hero {
    flex-direction: column;
    align-items: stretch;
  }

  .rsv-md-hero-photo-card {
    width: 100%;
    max-width: 220px;
    align-self: center;
  }

  .rsv-md-hero-photo {
    min-height: 180px;
  }

  .rsv-md-hero-meta-row {
    flex-wrap: wrap;
  }

  .rsv-md-hero-id {
    white-space: normal;
  }

  .rsv-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .rsv-left {
    border-right: none;
    border-bottom: 1px solid #e2e8f0;
    max-height: 320px;
    overflow-y: auto;
  }
}

/* —— Plant status (Figma 2261:1488, shell aligned with org-structure) —— */
.plant-status-view {
  --ps-good: #14ae5c;
  --ps-warn: #e5a000;
  --ps-bad: #ec221f;
  --ps-brown: #8b6f4e;
  --ps-oee-good-bg: #cff7d3;
  --ps-oee-warn-bg: #fff1c2;
  --ps-oee-bad-bg: #fdd3d0;
  --org-split-left: 544px;
}

.main-content:has(.plant-status-view) {
  padding: 0;
  flex: 1;
  min-height: 0;
}

.main-content:has(.plant-status-view) .module-root {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.plant-status-view > .ps-layout {
  flex: 1;
  min-height: 0;
}

.plant-status-view .ps-layout {
  display: grid;
  grid-template-columns: var(--org-split-left) 6px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  background: var(--org-surface);
  overflow: hidden;
  min-height: 0;
}

.plant-status-view .ps-layout.ps-layout--with-ai {
  grid-template-columns: var(--org-split-left) 6px minmax(280px, 1fr) minmax(240px, 298px);
}

.plant-status-view .ps-main {
  grid-column: 1;
  grid-row: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0;
  background: var(--org-panel);
  border-right: 1px solid var(--org-border-strong);
  box-sizing: border-box;
}

.plant-status-view .ps-main-inner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 30px;
  padding: 20px 1px;
  box-sizing: border-box;
}

.plant-status-view .org-splitter {
  grid-column: 2;
  grid-row: 1;
  align-self: stretch;
  width: 6px;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: col-resize;
  touch-action: none;
  position: relative;
  z-index: 4;
  flex-shrink: 0;
  color: var(--org-border-strong);
}

.plant-status-view .org-splitter:hover,
.plant-status-view .org-splitter:focus-visible {
  background: rgba(103, 197, 201, 0.12);
}

.plant-status-view .org-splitter:focus-visible {
  outline: none;
}

.plant-status-view .org-splitter:focus-visible::after {
  content: "";
  position: absolute;
  inset: 0;
  outline: 2px solid var(--org-teal);
  outline-offset: 2px;
  pointer-events: none;
}

.plant-status-view .ps-line-panel {
  grid-column: 3;
  grid-row: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 17px 25px 24px;
  background: var(--org-sage-2);
  border-left: 1px solid var(--org-border);
  box-sizing: border-box;
}

.plant-status-view .ps-line-panel-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.plant-status-view .ps-line-panel .org-detail-close-row {
  margin: 0;
  min-height: 16px;
}

.plant-status-view .ps-ai-panel {
  grid-column: 4;
  grid-row: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 17px 25px;
  background: #361e1c;
  color: #fff;
  box-sizing: border-box;
}

.ps-ai-panel-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  min-height: 0;
  flex: 1;
}

.plant-status-view .ps-ai-panel .org-detail-close-row {
  margin: 0;
  min-height: 16px;
}

.plant-status-view .ps-ai-panel .org-detail-close {
  color: #fff;
}

.plant-status-view .ps-ai-panel .org-detail-close:hover {
  opacity: 0.75;
}

.plant-status-view .ps-side-panel--hidden {
  display: none;
}

.plant-status-view.plant-status-view--resizing,
.plant-status-view.plant-status-view--resizing * {
  cursor: col-resize !important;
  user-select: none;
}

.ps-panel-toolbar {
  display: flex;
  align-items: center;
  min-height: var(--org-hero-kicker-height);
  margin-bottom: 12px;
}

.ps-panel-toolbar--ai {
  justify-content: flex-end;
}

.ps-main-empty {
  margin: 24px 16px 0;
}

.ps-main-top {
  padding: 0 16px 0 18px;
  width: 100%;
  box-sizing: border-box;
}

.ps-plant-filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 100%;
}

.ps-plant-filter-label {
  font-family: "Byotone", var(--sans);
  font-size: 10px;
  font-weight: 400;
  line-height: 16px;
  letter-spacing: 0.5px;
  text-transform: capitalize;
  color: #808191;
}

.ps-plant-filter-control {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 36px;
  padding: 0 10px 0 12px;
  border: 1px solid var(--org-border);
  border-radius: 8px;
  background: var(--org-surface);
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ps-plant-filter-control:hover:not(.ps-plant-filter-control--disabled) {
  border-color: var(--org-border-strong);
}

.ps-plant-filter-control:focus-within:not(.ps-plant-filter-control--disabled) {
  border-color: var(--org-teal);
  box-shadow: 0 0 0 2px rgba(103, 197, 201, 0.25);
}

.ps-plant-filter-control--disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.ps-plant-filter-ic {
  display: inline-flex;
  flex-shrink: 0;
  color: var(--org-ink-deep);
}

.ps-plant-filter-ic .org-ic {
  display: block;
}

.ps-plant-filter {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  border: none;
  background: transparent;
  font-family: "Byotone", var(--sans);
  font-size: 14px;
  font-weight: 400;
  line-height: 16px;
  color: var(--org-ink);
  cursor: pointer;
  appearance: none;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  padding: 8px 0;
  outline: none;
}

.ps-plant-filter:focus,
.ps-plant-filter:focus-visible {
  outline: none;
}

.ps-plant-filter:disabled {
  cursor: not-allowed;
  color: #808191;
}

.ps-plant-filter-chev {
  display: inline-flex;
  flex-shrink: 0;
  color: var(--org-ink);
  pointer-events: none;
}

.ps-plant-filter option {
  font-family: "Byotone", var(--sans);
  font-size: 14px;
  color: var(--org-ink);
  background: #fff;
}

/* Figma 2261:1649 — titulo block (gap 18px, px 16) */
.ps-main-hero {
  display: flex;
  flex-direction: column;
  gap: 18px;
  justify-content: center;
  padding: 0 16px;
  width: 100%;
  box-sizing: border-box;
}

/* Figma 2261:1654 — operaciones (Enunciado / rsv-md-hero-label) */
.plant-status-view .ps-hero-kicker {
  white-space: nowrap;
}

/* Figma 2261:1655 — estado de planta (Mortend Bold / rsv-md-hero-title) */
.plant-status-view .ps-hero-title {
  width: 100%;
  min-width: 0;
}

.ps-shift-row {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: center;
  width: 100%;
}

.ps-shift-card {
  flex: 1 1 0;
  min-width: 0;
  min-height: 148px;
  padding: 12px 6px;
  border-right: 1px solid var(--org-border);
  background: transparent;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
  height: 100%;
}

.ps-shift-card:last-child {
  border-right: none;
}

/* Figma 2261:1750 — turno en curso */
.ps-shift-card--current {
  background: var(--org-sage-2);
}

.ps-shift-card-head {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  width: 100%;
  min-height: 24px;
  flex-shrink: 0;
}

.ps-shift-name {
  flex: 0 0 85px;
  width: 85px;
  min-height: 16px;
  font-family: "Byotone", var(--sans);
  font-size: 14px;
  font-weight: 400;
  line-height: 16px;
  color: var(--org-ink-deep);
  word-break: break-word;
}

/* Figma 2261:1754 — pill ACTIVO con borde + overlay + glow verde interno */
.ps-shift-active {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 4px 8px;
  border: 1px solid rgba(217, 217, 217, 0.2);
  border-radius: 6px;
  overflow: hidden;
  min-height: 24px;
  box-sizing: border-box;
}

.ps-shift-active--placeholder {
  visibility: hidden;
  pointer-events: none;
}

.ps-shift-active::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.1);
  pointer-events: none;
}

.ps-shift-active::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 10.2px 0 #34c759;
  pointer-events: none;
}

.ps-shift-active--placeholder::before,
.ps-shift-active--placeholder::after {
  display: none;
}

.ps-shift-active-text {
  position: relative;
  z-index: 1;
  font-family: "Byotone", var(--sans);
  font-size: 10px;
  font-weight: 400;
  line-height: 16px;
  letter-spacing: 0.5px;
  color: var(--org-ink-deep);
  white-space: nowrap;
}

.ps-shift-oee-block {
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: flex-start;
  flex-shrink: 0;
}

.ps-shift-oee {
  margin: 0;
  font-family: "Byotone", var(--sans);
  font-size: 26px;
  font-weight: 300;
  line-height: 1;
  flex-shrink: 0;
}

/* Figma 2261:1719 — OEE por umbral */
.ps-shift-oee--good { color: var(--ps-good); }
.ps-shift-oee--warn { color: var(--ps-warn); }
.ps-shift-oee--bad { color: var(--ps-bad); }
.ps-shift-oee--neutral { color: var(--org-ink-deep); }

.ps-shift-oee-label {
  margin: 0;
  font-family: "Byotone", var(--sans);
  font-size: 10px;
  font-weight: 400;
  line-height: 16px;
  letter-spacing: 0.5px;
  color: var(--org-ink-deep);
  flex-shrink: 0;
}

.ps-shift-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  width: 100%;
  min-height: 24px;
  align-items: flex-end;
  font-family: "Byotone", var(--sans);
  font-size: 10px;
  line-height: 16px;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.ps-shift-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px 0;
  border-radius: 6px;
}

.ps-shift-meta-val {
  color: var(--org-ink);
}

.ps-shift-meta-unit {
  color: #808191;
}

.ps-filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 0 9px;
  width: 100%;
  box-sizing: border-box;
}

.ps-filter-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1 1 0;
  min-width: 0;
  max-width: 100%;
  padding: 8px;
  border: 1px solid var(--org-border);
  border-radius: 6px;
  background: var(--org-surface);
  font-family: "Byotone", var(--sans);
  font-size: 12px;
  font-weight: 400;
  line-height: 16px;
  color: var(--org-ink);
  cursor: pointer;
  box-sizing: border-box;
}

.ps-filter-chip:not(:first-child) {
  flex: 0 1 auto;
}

.ps-filter-chip--control {
  cursor: default;
  gap: 4px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ps-filter-chip--control:hover {
  filter: none;
  border-color: var(--org-border-strong);
}

.ps-filter-chip--control:focus-within {
  border-color: var(--org-teal);
  box-shadow: 0 0 0 2px rgba(103, 197, 201, 0.25);
}

.ps-filter-select,
.ps-filter-date {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  background: transparent;
  font: inherit;
  color: inherit;
  cursor: pointer;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
}

.ps-filter-select:focus,
.ps-filter-select:focus-visible,
.ps-filter-date:focus,
.ps-filter-date:focus-visible {
  outline: none;
}

.ps-filter-select {
  padding-right: 2px;
}

.ps-filter-date {
  width: auto;
}

.ps-filter-date::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.7;
}

.ps-filter-chip--date {
  flex: 0 1 auto;
}

.ps-filter-chip:hover {
  filter: brightness(0.98);
}

.ps-kpi-row {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: center;
  width: 100%;
}

.ps-kpi-card {
  flex: 1 1 0;
  min-width: 0;
  padding: 21px 6px;
  border-right: 1px solid var(--org-border);
  background: transparent;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ps-kpi-card:last-child {
  border-right: none;
}

.ps-kpi-label {
  margin: 0;
  font-family: "Byotone", var(--sans);
  font-size: 12px;
  font-weight: 400;
  line-height: 16px;
  color: var(--org-ink-deep);
}

.ps-kpi-value {
  margin: 0;
  font-family: "Byotone", var(--sans);
  font-size: 26px;
  font-weight: 300;
  line-height: 1.4;
  color: var(--org-ink-deep);
}

.ps-kpi-value--bad { color: var(--ps-bad); }

.ps-kpi-sub {
  margin: 0;
  font-family: "Byotone", var(--sans);
  font-size: 10px;
  font-weight: 400;
  line-height: 16px;
  letter-spacing: 0.5px;
  color: var(--org-ink-deep);
}

.ps-table-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  border-top: 1px solid var(--org-border);
  border-bottom: 1px solid var(--org-border);
  padding: 18px 20px;
  box-sizing: border-box;
  gap: 11px;
}

.ps-table-head,
.ps-line-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 100px 50px 50px 50px 50px;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.ps-table-head {
  font-family: "Byotone", var(--sans);
}

.ps-th {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}

.ps-th-btn {
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: inherit;
  width: 100%;
  box-sizing: border-box;
}

.ps-th-btn:hover .ps-th-label,
.ps-th-btn:focus-visible .ps-th-label {
  color: var(--org-ink);
}

.ps-th-btn:focus-visible {
  outline: 2px solid var(--org-teal);
  outline-offset: 2px;
  border-radius: 4px;
}

.ps-th--line {
  flex: 1 1 auto;
}

.ps-th--sorted .ps-th-label {
  color: var(--org-ink-deep);
}

.ps-th--status {
  width: 100px;
  justify-content: space-between;
}

.ps-th--num,
.ps-th--oee {
  width: 50px;
  justify-content: space-between;
}

.ps-th-label {
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  color: #7f9293;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ps-th-sort {
  display: inline-flex;
  flex-shrink: 0;
  color: #7f9293;
}

.ps-th--sorted .ps-th-sort {
  color: var(--org-ink-deep);
}

.ps-th-sort--desc .ps-th-sort-ic {
  transform: rotate(180deg);
}

.ps-th-sort-ic {
  display: block;
}

.ps-table-divider {
  width: 100%;
  margin: 0;
  border: none;
  border-top: 1px solid var(--org-border);
  opacity: 0.65;
}

.ps-table-divider--head {
  margin-top: 0;
}

.ps-table-rows {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
}

.ps-table-rows .ps-table-divider:last-child {
  display: none;
}

.ps-table-empty {
  padding: 12px 0;
  width: 100%;
}

.ps-line-row {
  width: 100%;
  min-height: 0;
  padding: 2px 0;
  border: none;
  background: transparent;
  font-family: "Byotone", var(--sans);
  font-size: 14px;
  font-weight: 400;
  line-height: 16px;
  color: var(--org-ink);
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
}

.ps-line-row:hover,
.ps-line-row--selected {
  background: rgba(103, 197, 201, 0.08);
}

.ps-line-col--name {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  text-align: left;
}

.ps-line-col--status {
  display: flex;
  justify-content: center;
  width: 100px;
}

.ps-line-col--num,
.ps-line-col--oee {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.ps-line-col--num {
  width: 50px;
}

.ps-line-col--oee {
  width: 50px;
}

.ps-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100px;
  padding: 4px 8px;
  border: 1px solid rgba(217, 217, 217, 0.2);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 400;
  line-height: 16px;
  color: var(--org-ink);
  box-sizing: border-box;
}

.ps-status-badge--active {
  background: var(--ps-good);
}

.ps-status-badge--stopped {
  background: var(--ps-warn);
}

.ps-status-badge--stopped_idle {
  background: #d9d9d9;
}

.ps-status-badge--slow {
  background: #e8b931;
}

.ps-oee-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  padding: 4px 8px;
  border: 1px solid rgba(217, 217, 217, 0.2);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 400;
  line-height: 16px;
  color: var(--org-ink);
  box-sizing: border-box;
}

.ps-oee-pill--good {
  background: var(--ps-oee-good-bg);
}

.ps-oee-pill--warn {
  background: var(--ps-oee-warn-bg);
}

.ps-oee-pill--bad {
  background: var(--ps-oee-bad-bg);
}

.ps-oee-pill--neutral {
  background: transparent;
  border-color: var(--org-border);
}

.ps-table-footer {
  width: 100%;
  height: 17px;
  margin-top: auto;
  border-top: 1px solid var(--org-border);
  border-radius: 0 0 16px 16px;
  background: rgba(255, 255, 255, 0.88);
  flex-shrink: 0;
}

.ps-detail-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
}

.ps-detail-header-text {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1 1 0;
  min-width: 0;
}

.ps-detail-kicker {
  margin: 0;
  font-family: "Byotone", var(--sans);
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
  text-transform: uppercase;
  color: #361e1c;
}

.ps-line-detail-title {
  margin: 0;
  font-family: "Byotone", var(--sans);
  font-size: 40px;
  font-weight: 700;
  line-height: 1.4;
  color: #000;
}

.ps-detail-sku-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-family: "Byotone", var(--sans);
  font-size: 14px;
  line-height: 16px;
  color: #000;
}

.ps-detail-sku-row strong {
  font-weight: 700;
}

.ps-detail-sku-name {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 300;
  line-height: 1.43;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ps-detail-sku-empty {
  margin: 0;
  font-size: 12px;
  font-weight: 300;
  color: #7f9293;
}

.plant-status-view .ps-classify-btn {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border: 1px solid #c5dad3;
  border-radius: 12px;
  background: #67c5c9;
  color: #fff;
  font-family: "Byotone", var(--sans);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  box-sizing: border-box;
}

.plant-status-view .ps-classify-btn:hover {
  filter: brightness(1.03);
}

.plant-status-view .ps-classify-btn:focus-visible {
  outline: 2px solid var(--org-teal);
  outline-offset: 2px;
}

.ps-detail-card {
  margin: 0;
  border: 1px solid #7f9293;
  border-radius: 16px;
  overflow: hidden;
  background: var(--org-surface);
}

.ps-card-title {
  margin: 0;
  padding: 18px 20px;
  border-top: 1px solid #c5dad3;
  border-bottom: 1px solid #c5dad3;
  font-family: "Byotone", var(--sans);
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
  text-transform: uppercase;
  color: #361e1c;
}

.ps-detail-card--production {
  width: 100%;
}

.ps-prod-body {
  padding: 15px 11px;
  width: 100%;
  box-sizing: border-box;
}

.ps-prod-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: auto auto;
  row-gap: 14px;
  column-gap: 0;
  width: 100%;
}

.ps-prod-summary-block {
  grid-column: 1 / span 2;
  grid-row: 1;
  justify-self: start;
  max-width: 272px;
  width: 100%;
}

.ps-prod-compliance-bar {
  grid-column: 3 / span 2;
  grid-row: 1;
  align-self: stretch;
  display: flex;
  min-width: 0;
  min-height: 0;
}

.ps-prod-compliance-bar .ps-seg-bar-wrap {
  flex: 1 1 auto;
  justify-content: center;
  min-height: 0;
}

.ps-prod-mix-bar {
  grid-column: 3 / span 2;
  grid-row: 2;
  align-self: start;
  min-width: 0;
}

.ps-prod-product {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.ps-prod-product:nth-child(3) {
  grid-column: 1;
  grid-row: 2;
}

.ps-prod-product:nth-child(4) {
  grid-column: 2;
  grid-row: 2;
}

.ps-prod-summary {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.ps-prod-ic {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 8px;
  border-radius: 20px;
  background: #7f9293;
  color: #fff;
  box-sizing: border-box;
}

.ps-prod-ic .org-ic {
  display: block;
  width: 16px;
  height: 16px;
}

.ps-prod-summary-text {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.ps-prod-values {
  display: flex;
  align-items: baseline;
  gap: 4px;
  color: #11363e;
}

.ps-prod-current {
  font-family: "Byotone", var(--sans);
  font-size: 36px;
  font-weight: 300;
  line-height: 1;
}

.ps-prod-target {
  font-family: "Byotone", var(--sans);
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
  text-transform: uppercase;
  transform: translateY(-0.08em);
}

.ps-prod-label {
  margin: 0;
  font-family: "Byotone", var(--sans);
  font-size: 14px;
  font-weight: 400;
  line-height: 16px;
  color: #11363e;
}

.ps-prod-product-values {
  display: flex;
  align-items: baseline;
  gap: 4px;
  color: #11363e;
}

.ps-prod-product-current {
  font-family: "Byotone", var(--sans);
  font-size: 32px;
  font-weight: 300;
  line-height: 1;
}

.ps-prod-product-target {
  font-family: "Byotone", var(--sans);
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  color: #000;
  transform: translateY(-0.06em);
}

.ps-prod-product-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "Byotone", var(--sans);
  font-size: 14px;
  font-weight: 400;
  line-height: 16px;
  color: #11363e;
  text-transform: uppercase;
}

.ps-prod-product-swatch {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.ps-seg-bar-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
}

.ps-seg-bar {
  display: flex;
  gap: 2px;
  width: 100%;
}

.ps-seg-bar--compliance {
  flex: 1 1 auto;
  min-height: 48px;
}

.ps-seg-bar--mix {
  height: 21px;
  min-height: 21px;
}

.ps-seg {
  flex: 1 1 0;
  min-width: 0;
  background: #c5dad3;
}

.ps-seg--filled {
  background: #67c5c9;
}

.ps-seg--mix {
  background: var(--ps-seg-color, #c5dad3);
}

.ps-seg-axis {
  display: flex;
  justify-content: space-between;
  font-family: "Byotone", var(--sans);
  font-size: 10px;
  font-weight: 400;
  line-height: 16px;
  text-transform: uppercase;
  color: #11363e;
}

.ps-detail-card--oee-eff {
  background: #f5f5ed;
  container-type: inline-size;
  container-name: ps-oee-card;
}

.ps-oee-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(108px, 180px);
  gap: 12px 6px;
  align-items: center;
  width: 100%;
  padding: 12px;
  border: 1px solid #e4e4e4;
  border-top: none;
  box-sizing: border-box;
}

.ps-oee-factors-block {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.ps-oee-factor-row {
  display: grid;
  grid-template-columns: minmax(72px, 120px) minmax(0, 1fr) 36px;
  gap: 6px;
  align-items: center;
  width: 100%;
}

.ps-oee-factor-label {
  min-width: 0;
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  color: #808191;
}

.ps-oee-factor-track {
  height: 10px;
  min-width: 0;
  border-radius: 22px;
  background: #ebedf0;
  overflow: hidden;
}

.ps-oee-factor-fill {
  height: 10px;
  max-width: 100%;
  border-radius: 8px;
  background: #67c5c9;
}

.ps-oee-factor-val {
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  color: #808191;
  text-align: right;
  white-space: nowrap;
}

.ps-oee-formula {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  color: #808191;
  overflow-wrap: anywhere;
}

.ps-oee-gauge-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-width: 0;
}

.ps-oee-gauge {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 180px;
  min-width: 0;
}

.ps-oee-gauge-disk {
  position: relative;
  width: 100%;
  max-width: 138px;
  aspect-ratio: 1;
  container-type: inline-size;
  container-name: ps-oee-gauge;
}

.ps-oee-gauge-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    var(--ps-gauge-arc-color, #ff6b35) 0deg var(--ps-gauge-angle, 0deg),
    #ebedf0 var(--ps-gauge-angle, 0deg) 360deg
  );
  mask: radial-gradient(farthest-side, transparent calc(100% - 12px), #000 calc(100% - 11px));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 12px), #000 calc(100% - 11px));
  transform: rotate(-90deg);
}

.ps-oee-gauge-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  pointer-events: none;
}

.ps-oee-gauge-value {
  font-family: "Byotone", var(--sans);
  font-size: clamp(18px, 19cqw, 26px);
  font-weight: 300;
  line-height: 1.2;
  text-align: center;
  color: var(--ps-gauge-text-color, #ec221f);
}

.ps-oee-gauge--neutral .ps-oee-gauge-value {
  color: #808191;
}

.ps-oee-gauge-caption {
  font-family: "Byotone", var(--sans);
  font-size: 10px;
  line-height: 16px;
  letter-spacing: 0.5px;
  color: #11363e;
  text-align: center;
  white-space: nowrap;
}

@container ps-oee-card (max-width: 380px) {
  .ps-oee-section {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .ps-oee-gauge-wrap {
    justify-content: center;
  }

  .ps-oee-gauge {
    max-width: 160px;
  }

  .ps-oee-gauge-disk {
    max-width: 128px;
  }

  .ps-eff-legend--split {
    flex-direction: column;
    align-items: stretch;
  }

  .ps-eff-legend-group--down {
    justify-content: flex-start;
  }
}

.ps-eff-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border: 1px solid #e4e4e4;
  border-top: none;
  box-sizing: border-box;
}

.ps-eff-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.ps-section-subtitle {
  margin: 0;
  font-family: "Byotone", var(--sans);
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
  text-transform: uppercase;
  color: #361e1c;
}

.ps-eff-stack-wrap {
  width: 100%;
}

.ps-eff-stack {
  display: flex;
  height: 38px;
  border-radius: 22px;
  overflow: hidden;
  background: #ebedf0;
}

.ps-eff-stack-eff {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 100%;
  background: #14ae5c;
  color: #fefefd;
  font-family: "Byotone", var(--sans);
  font-size: 14px;
  font-weight: 400;
  line-height: 16px;
  border-radius: 22px 0 0 22px;
}

.ps-eff-stack-down {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  border-radius: 0 22px 22px 0;
}

.ps-eff-stack--eff-only .ps-eff-stack-eff {
  width: 100% !important;
  border-radius: 22px;
}

.ps-eff-stack--down-only .ps-eff-stack-down {
  width: 100% !important;
  border-radius: 22px;
}

.ps-eff-stack-type {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 100%;
  color: #fefefd;
  font-family: "Byotone", var(--sans);
  font-size: 14px;
  font-weight: 400;
  line-height: 16px;
}

.ps-eff-stack-type--last {
  border-radius: 0 22px 22px 0;
}

.ps-eff-stack-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  font-family: "Byotone", var(--sans);
  font-size: 14px;
  font-weight: 400;
  line-height: 16px;
  color: #fefefd;
}

.ps-eff-stack-seg--good { background: #14ae5c; }
.ps-eff-stack-seg--neutral { background: #7f9293; }
.ps-eff-stack-seg--brown { background: #361e1c; }

.ps-eff-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 25px;
}

.ps-eff-legend--split {
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.ps-eff-legend-group {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 25px;
  min-width: 0;
}

.ps-eff-legend-group--eff {
  flex: 0 1 auto;
}

.ps-eff-legend-group--down {
  flex: 1 1 auto;
  justify-content: flex-end;
}

.ps-eff-legend-dot--eff {
  background: #11363e;
}

.ps-eff-legend-empty {
  font-family: "Byotone", var(--sans);
  font-size: 14px;
  line-height: 16px;
  color: #808191;
}

.ps-eff-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.ps-eff-legend-dot {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  border: 1px solid #ebedf0;
  border-radius: 6px;
}

.ps-eff-legend-label {
  font-family: "Byotone", var(--sans);
  font-size: 14px;
  font-weight: 400;
  line-height: 16px;
  color: #808191;
  white-space: pre-line;
}

.ps-eff-legend-val {
  font-family: "Byotone", var(--sans);
  font-size: 14px;
  font-weight: 400;
  line-height: 16px;
  color: #361e1c;
  white-space: nowrap;
}

.ps-detail-card--trend {
  width: 100%;
}

.ps-trend-tabs {
  display: flex;
  gap: 1px;
  padding: 0 6px;
}

.ps-trend-tab {
  flex: 1 1 0;
  min-width: 0;
  padding: 16px 20px;
  border: none;
  border-radius: 16px 16px 0 0;
  background: transparent;
  cursor: pointer;
  font-family: "Byotone", var(--sans);
  font-size: 14px;
  font-weight: 300;
  line-height: 16px;
  text-align: center;
  text-transform: capitalize;
  color: #11363e;
}

.ps-trend-tab:focus-visible {
  outline: 2px solid var(--org-teal);
  outline-offset: 2px;
}

.ps-trend-tab--active {
  background: #ebecdc;
  font-weight: 700;
  color: #000;
}

.gv-line-modal-pane .ps-trend-tab {
  transition: background 0.15s ease, color 0.15s ease, font-weight 0.15s ease;
}

.gv-line-modal-pane .ps-trend-tab:hover:not(.ps-trend-tab--active) {
  background: rgba(235, 236, 220, 0.75);
  color: #361e1c;
}

.ps-trend-body {
  padding: 12px;
  border: 1px solid #e4e4e4;
  border-top: none;
}

.ps-trend-empty {
  margin: 0;
  padding: 24px 8px;
  font-family: "Byotone", var(--sans);
  font-size: 14px;
  line-height: 16px;
  color: #11363e;
  text-align: center;
}

.ps-trend-chart-wrap--loading {
  min-height: 157px;
}

.ps-trend-chart-wrap {
  width: 100%;
  container-type: inline-size;
}

.ps-trend-chart-row {
  display: grid;
  grid-template-columns: 31px minmax(0, 1fr);
  align-items: stretch;
  width: 100%;
  min-width: 0;
  aspect-ratio: 526 / 157;
  min-height: 157px;
}

.ps-trend-y-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 5.1% 0 15.3%;
  box-sizing: border-box;
}

.ps-trend-chart {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.ps-trend-grid line {
  stroke: #e4e4e4;
  stroke-width: 1;
}

.ps-trend-area {
  fill: rgba(127, 146, 147, 0.18);
}

.ps-trend-line {
  fill: none;
  stroke: #cb4017;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ps-trend-dot {
  fill: #fff;
  stroke: #7f9293;
  stroke-width: 2;
}

.ps-trend-y-label {
  display: block;
  font-family: "Byotone", var(--sans);
  font-size: clamp(10px, 2.2cqi, 13px);
  line-height: 1;
  letter-spacing: 0.5px;
  color: #808191;
  white-space: nowrap;
}

.ps-trend-x-labels {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding-left: 31px;
  box-sizing: border-box;
  margin-top: 4px;
  font-size: clamp(9px, 2cqi, 12px);
  line-height: 16px;
  letter-spacing: 0.5px;
  color: #808191;
}

.ps-ai-head {
  display: flex;
  align-items: flex-start;
  margin: 0;
}

.ps-ai-title {
  margin: 0;
  width: 100%;
  font-family: "Byotone", var(--sans);
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
  text-transform: uppercase;
  color: #fff;
}

.ps-ai-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  margin: 0;
}

.ps-rec-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  border: 1px solid #c5dad3;
  border-radius: 12px;
  overflow: hidden;
  background: conic-gradient(from 90deg, #ebecdc 0%, #a0c9cb 100%);
}

.ps-rec-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
}

.ps-rec-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 8px;
  background: #fff;
}

.ps-rec-title {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-family: "Byotone", var(--sans);
  font-size: 14px;
  font-weight: 400;
  line-height: 16px;
  color: #000;
}

.ps-rec-menu {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: #000;
}

.ps-rec-menu .org-ic {
  display: block;
  width: 16px;
  height: 16px;
}

.ps-rec-body {
  margin: 0;
  font-family: "Byotone", var(--sans);
  font-size: 14px;
  font-weight: 400;
  line-height: 16px;
  color: #000;
}

.ps-rec-impact {
  margin: 0;
  width: 100%;
  font-family: "Byotone", var(--sans);
  font-size: 14px;
  font-weight: 400;
  line-height: 16px;
  text-align: center;
  color: #cb4017;
}

.ps-rec-impact--warn {
  color: #cb4017;
}

.ps-rec-impact--good {
  color: #14ae5c;
}

.ps-btn-simulator {
  width: 100%;
  margin: 0;
  padding: 12px 16px;
  border: 1px solid #c5dad3;
  border-radius: 12px;
  background: #ff6038;
  color: #fff;
  font-family: "Byotone", var(--sans);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  text-align: center;
  cursor: pointer;
  transition: filter 0.15s;
}

.ps-btn-simulator:hover {
  filter: brightness(1.05);
}

.ps-btn-simulator:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

@media (max-width: 1280px) {
  .plant-status-view .ps-layout.ps-layout--with-ai {
    grid-template-columns: var(--org-split-left) 6px minmax(0, 1fr);
  }

  .plant-status-view .ps-ai-panel {
    grid-column: 3;
    grid-row: 2;
    border-left: none;
    border-top: 1px solid var(--org-border);
  }
}

@media (max-width: 960px) {
  .plant-status-view .ps-layout,
  .plant-status-view .ps-layout.ps-layout--with-line,
  .plant-status-view .ps-layout.ps-layout--with-ai {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }

  .plant-status-view .org-splitter {
    display: none;
  }

  .plant-status-view .ps-main,
  .plant-status-view .ps-line-panel,
  .plant-status-view .ps-ai-panel {
    grid-column: 1;
  }

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

  .ps-shift-card,
  .ps-shift-card:first-child,
  .ps-shift-card:last-child {
    border-radius: 12px;
  }

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

  .ps-prod-grid {
    grid-template-columns: 1fr;
  }

  .ps-prod-summary-block,
  .ps-prod-compliance-bar,
  .ps-prod-mix-bar,
  .ps-prod-product:nth-child(3),
  .ps-prod-product:nth-child(4) {
    grid-column: 1;
    grid-row: auto;
    max-width: none;
  }

  .ps-seg-bar--compliance {
    min-height: 21px;
  }
}

/* --- Production Assignment (pa-*) — reuses the plant-status shell --- */
.production-assignment-view .pa-top {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.production-assignment-view .pa-top .ps-plant-filter-field {
  flex: 1 1 220px;
  width: auto;
  max-width: 100%;
}

.production-assignment-view .pa-field--date {
  flex: 0 1 200px;
}

.production-assignment-view .pa-date-input {
  cursor: pointer;
}

.production-assignment-view .pa-date-input::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.7;
}

.production-assignment-view .pa-hero-sub {
  margin: 0;
  font-family: "Byotone", var(--sans);
  font-size: 15px;
  line-height: 1.4;
  color: var(--org-ink-muted, #6b7280);
}

.production-assignment-view .pa-tabs-card {
  /* Align the tabs card to the exact width used by the filters row above,
     which sits inside ps-main-top padding: 0 16px 0 18px. */
  margin: 0 16px 0 18px;
  width: auto;
}

.production-assignment-view .pa-tabs {
  display: flex;
  align-items: stretch;
  height: 56px;
  min-height: 56px;
  background: var(--org-sage-2);
  overflow: clip;
}

.production-assignment-view .pa-tab {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: "Byotone", var(--sans);
  font-size: 16px;
  font-weight: 400;
  color: #000;
}

.production-assignment-view .pa-tab + .pa-tab {
  border-left: 1px solid var(--org-border);
}

.production-assignment-view .pa-tab:hover:not(.pa-tab--active) {
  background-color: #e4e5d4;
}

.production-assignment-view .pa-tab:focus-visible {
  outline: 2px solid var(--org-teal);
  outline-offset: -2px;
}

.production-assignment-view .pa-tab--active {
  background-color: var(--org-surface);
  border-radius: 16px 16px 0 0;
  font-weight: 700;
}

.production-assignment-view .pa-tab-panel {
  background: var(--org-surface);
}

.production-assignment-view .pa-card-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px 18px 20px;
  min-width: 0;
}

.production-assignment-view .pa-card-hint {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--org-ink-muted, #6b7280);
}

.production-assignment-view .pa-card-note {
  margin: 0;
  font-size: 13px;
  color: var(--warn, #b1261e);
}

.production-assignment-view .pa-active-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f5f5ed;
  border: 1px solid #c5dad3;
}

.production-assignment-view .pa-active-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--org-ink-muted, #6b7280);
}

.production-assignment-view .pa-active-value {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--org-ink-deep, #1a1a2e);
}

.production-assignment-view .pa-active-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #14ae5c;
  flex-shrink: 0;
}

.production-assignment-view .pa-active-empty {
  margin: 0;
  font-size: 14px;
  color: var(--org-ink-muted, #6b7280);
}

.production-assignment-view .pa-inline-label {
  font-family: "Byotone", var(--sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--org-ink-muted, #6b7280);
}

.production-assignment-view .pa-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.production-assignment-view .ps-classify-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: none;
}

.production-assignment-view .pa-btn--ghost {
  background: #fff;
  border-color: #c5dad3;
  color: var(--org-ink-deep, #1a1a2e);
}

.production-assignment-view .pa-chart-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.production-assignment-view .pa-chart-total-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--org-ink-muted, #6b7280);
}

.production-assignment-view .pa-chart-total-value {
  font-family: "Byotone", var(--sans);
  font-size: 22px;
  font-weight: 700;
  color: var(--org-ink-deep, #1a1a2e);
}

.production-assignment-view .pa-range {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.production-assignment-view .pa-range-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.production-assignment-view .pa-input {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--org-border, #c5dad3);
  border-radius: 8px;
  background: #fff;
  font-family: "Byotone", var(--sans);
  font-size: 14px;
  color: var(--org-ink-deep, #1a1a2e);
  box-sizing: border-box;
}

.production-assignment-view .pa-input:focus,
.production-assignment-view .pa-input:focus-visible {
  outline: none;
  border-color: var(--org-teal, #67c5c9);
  box-shadow: 0 0 0 2px rgba(103, 197, 201, 0.25);
}

.production-assignment-view .pa-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Chart.js line chart container (24 hourly points).
   Chart.js manages the canvas size via aspectRatio; the wrap only needs a
   constrained width so the canvas never grows past the card. */
.product-catalog-view .pc-chart-canvas-wrap--loading {
  opacity: 0.55;
}

.production-assignment-view .pa-chart-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.production-assignment-view .pa-chart-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.production-assignment-view .pa-chart-legend-title {
  font-family: "Inter", var(--sans);
  font-size: 12px;
  font-weight: 600;
  color: #334155;
}

.production-assignment-view .pa-chart-legend-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.production-assignment-view .pa-chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "Inter", var(--sans);
  font-size: 12px;
  color: #000;
}

.production-assignment-view .pa-chart-legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  flex-shrink: 0;
}

.production-assignment-view .pa-chart-legend-empty {
  margin: 0;
  font-family: "Inter", var(--sans);
  font-size: 12px;
  color: #808191;
}

.production-assignment-view .pa-chart-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.production-assignment-view .pa-chart-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.production-assignment-view .pa-chart-legend-title {
  font-family: "Inter", var(--sans);
  font-size: 12px;
  font-weight: 600;
  color: #334155;
}

.production-assignment-view .pa-chart-legend-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.production-assignment-view .pa-chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "Inter", var(--sans);
  font-size: 12px;
  color: #000;
}

.production-assignment-view .pa-chart-legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  flex-shrink: 0;
}

.production-assignment-view .pa-chart-legend-empty {
  margin: 0;
  font-family: "Inter", var(--sans);
  font-size: 12px;
  color: #808191;
}

.production-assignment-view .pa-chart-canvas-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.production-assignment-view .pa-chart-canvas-wrap--loading {
  opacity: 0.5;
}

/* --- Product catalog (Figma 1847:28846 — resizable split like org-structure) --- */
.product-catalog-view {
  --org-surface: #fffbf8;
  --org-split-left: 676px;
  font-family: "Poppins", var(--sans);
}

.main-content:has(.product-catalog-view) {
  background: #fffbf8;
}

.product-catalog-view > .rsv-layout,
.product-catalog-view > .pc-split-layout {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.product-catalog-view.org-structure-view .rsv-left,
.product-catalog-view .pc-split-left {
  background: #fff;
  border-right: none;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.product-catalog-view.org-structure-view .rsv-right,
.product-catalog-view .pc-split-right {
  background: var(--org-surface, #fffbf8);
  border-left: none;
  padding: 15px 18px 24px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 17px;
  min-width: 0;
  min-height: 0;
}

.product-catalog-view .pc-main-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 16px;
  box-sizing: border-box;
  min-width: 0;
  width: 100%;
  min-height: 100%;
  background: #fff;
}

.product-catalog-view .pc-list-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.product-catalog-view .ps-hero-title {
  width: 100%;
  min-width: 0;
}

.product-catalog-view .pc-right-placeholder {
  margin-top: 8px;
  max-width: 420px;
  font-family: "Byotone", var(--sans);
  font-size: 15px;
  line-height: 1.4;
  color: var(--org-ink-muted, #6b7280);
}

.product-catalog-view .pc-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 4px rgba(16, 24, 40, 0.1);
}

.product-catalog-view .pa-hero-sub {
  margin: 0;
  font-family: "Byotone", var(--sans);
  font-size: 15px;
  line-height: 1.4;
  color: var(--org-ink-muted, #6b7280);
}

.product-catalog-view .pc-page-head {
  padding: 0;
  width: 100%;
  box-sizing: border-box;
}

.product-catalog-view .pc-categories-panel {
  min-width: 0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0;
  background: transparent;
}

.product-catalog-view .pc-categories-panel .pc-side-title {
  margin: 0;
}

.product-catalog-view .pc-rm-panel {
  padding: 24px;
  min-width: 0;
}

.product-catalog-view .pc-back {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  border: none;
  background: transparent;
  color: #000;
  font-family: "Roboto", var(--sans);
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  cursor: pointer;
  padding: 0;
}

.product-catalog-view .pc-catalog-switch {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 320px;
  font-size: 13px;
}

.product-catalog-view .pc-catalog-select {
  min-height: 44px;
}

.product-catalog-view .pc-divider {
  height: 1px;
  background: #e4e4e4;
  width: 100%;
}

.product-catalog-view .pc-section-title {
  margin: 0;
  min-height: 51px;
  display: flex;
  align-items: center;
  font-family: "Roboto", var(--sans);
  font-size: 20px;
  font-weight: 600;
  line-height: 20px;
  letter-spacing: 0.1px;
  color: #000;
}

.product-catalog-view .pc-side-title {
  margin: 0 0 16px;
  font-family: "Inter", var(--sans);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.48px;
  color: #000;
}

.product-catalog-view .pc-list-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
}

.product-catalog-view .pc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  font-family: "Poppins", var(--sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.product-catalog-view .pc-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.product-catalog-view .pc-btn--primary {
  background: #507cff;
  color: #fff;
}

.product-catalog-view .pc-btn--ghost {
  background: #fff;
  border: 1.5px solid #e4e4e4;
  color: #000;
}

.product-catalog-view .pc-btn--danger {
  background: #fff;
  border: 1.5px solid #fecaca;
  color: #b91c1c;
}

.product-catalog-view .pc-search-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 1.5px solid #e4e4e4;
  border-radius: 12px;
  padding: 16px;
  font-family: "Poppins", var(--sans);
  font-size: 14px;
  color: #000;
  background: #fff;
}

.product-catalog-view .pc-search-input::placeholder {
  color: #808191;
}

.product-catalog-view .pc-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border: 1.5px solid #e4e4e4;
  border-radius: 12px;
  padding: 16px;
  background: #fff;
  font-family: "Inter", var(--sans);
  font-size: 12px;
  color: #000;
  cursor: pointer;
  flex-shrink: 0;
}
  flex-shrink: 0;
}

.product-catalog-view .pc-filter-btn--active {
  border-color: #507cff;
  box-shadow: 0 0 0 2px rgba(80, 124, 255, 0.15);
}

.product-catalog-view .pc-filter-panel {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.product-catalog-view .pc-filter-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.product-catalog-view .pc-link-btn {
  border: none;
  background: transparent;
  color: #507cff;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
}

.product-catalog-view .pc-product-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.product-catalog-view .pc-product-row {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 10px 16px;
  background: #fff;
  box-sizing: border-box;
}

.product-catalog-view .pc-product-thumb {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 8px -2px rgba(16, 24, 40, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.product-catalog-view .pc-product-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 8px;
}

.product-catalog-view .pc-product-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.product-catalog-view .pc-product-name {
  margin: 0;
  font-family: "Inter", var(--sans);
  font-size: 16px;
  font-weight: 400;
  color: #000;
}

.product-catalog-view .pc-product-meta {
  display: flex;
  align-items: center;
  gap: 26px;
  width: 100%;
  min-width: 0;
  font-family: "Inter", var(--sans);
  font-size: 12px;
  line-height: normal;
  color: #000;
}

.product-catalog-view .pc-meta-col {
  white-space: nowrap;
}

.product-catalog-view .pc-meta-col--category {
  width: 98px;
  flex-shrink: 0;
}

.product-catalog-view .pc-meta-col--packaging,
.product-catalog-view .pc-meta-col--format,
.product-catalog-view .pc-meta-col--units {
  text-align: center;
}

.product-catalog-view .pc-row-action {
  width: 49px;
  height: 48px;
  border: 1.5px solid #e4e4e4;
  border-radius: 12px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  color: #000;
  padding: 0;
}

.product-catalog-view .pc-row-action svg {
  width: 24px;
  height: 24px;
}

.product-catalog-view .pc-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
}

.product-catalog-view .pc-pagination-left,
.product-catalog-view .pc-pagination-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.product-catalog-view .pc-pagination-left > span {
  font-family: "Poppins", var(--sans);
  font-size: 14px;
  line-height: 16px;
  color: #000;
  white-space: nowrap;
}

.product-catalog-view .pc-pagination-right {
  gap: 2px;
}

.product-catalog-view .pc-page-size,
.product-catalog-view .pc-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 48px;
  padding: 0 16px;
  border: 1.5px solid #e4e4e4;
  border-radius: 12px;
  background: #fff;
  font-family: "Poppins", var(--sans);
  font-size: 14px;
  color: #000;
  cursor: pointer;
}

.product-catalog-view .pc-page-btn--active {
  background: #f0f0f0;
}

.product-catalog-view .pc-category-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
  width: 100%;
}

.product-catalog-view .pc-category-card {
  width: 160px;
  border: 1px solid #e4e4e4;
  border-radius: 16px;
  background: #fff;
  padding: 0;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-items: center;
  flex-shrink: 0;
}

.product-catalog-view .pc-category-card--active {
  border-color: #507cff;
  box-shadow: 0 0 0 2px rgba(80, 124, 255, 0.12);
}

.product-catalog-view .pc-category-card-top {
  width: 100%;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid #e4e4e4;
  border-bottom: none;
  border-radius: 16px 16px 0 0;
  padding: 0 6px;
  box-sizing: border-box;
}

.product-catalog-view .pc-category-card-inner {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
  justify-content: center;
  padding: 8px 6px 2px;
  width: 100%;
  box-sizing: border-box;
}

.product-catalog-view .pc-category-icon {
  width: 32px;
  height: 32px;
  border: 1px solid #ebedf0;
  border-radius: 6px;
  background: #fff;
  flex-shrink: 0;
}

.product-catalog-view .pc-category-text {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  min-width: 0;
}

.product-catalog-view .pc-category-name {
  margin: 0;
  font-family: "Poppins", var(--sans);
  font-size: 16px;
  font-weight: 500;
  line-height: 16px;
  color: #000;
  word-break: break-word;
  width: 100%;
}

.product-catalog-view .pc-category-type {
  margin: 0;
  font-family: "Roboto", var(--sans);
  font-size: 11px;
  font-weight: 500;
  line-height: 16px;
  letter-spacing: 0.5px;
  color: #808191;
  width: 100%;
}

.product-catalog-view .pc-category-card-foot {
  width: 100%;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid #e4e4e4;
  border-top: none;
  border-radius: 0 0 16px 16px;
  padding: 0 6px 7px;
  display: flex;
  gap: 6px;
  align-items: center;
  box-sizing: border-box;
}

.product-catalog-view .pc-category-stat {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px 8px;
  border-radius: 6px;
  font-family: "Roboto", var(--sans);
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  color: #808191;
  white-space: nowrap;
}

.product-catalog-view .pc-category-stat-ic {
  display: block;
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.product-catalog-view .pc-rm-table-wrap {
  overflow-x: auto;
}

.product-catalog-view .pc-rm-table {
  width: 100%;
  border-collapse: collapse;
  font-family: "Inter", var(--sans);
  font-size: 11px;
}

.product-catalog-view .pc-rm-table th,
.product-catalog-view .pc-rm-table td {
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid #e4e4e4;
}

.product-catalog-view .pc-rm-table th {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.product-catalog-view .pc-rm-table td:nth-child(3) {
  text-align: center;
}

.product-catalog-view .pc-rm-table td:nth-child(4) {
  text-align: center;
}

.product-catalog-view .pc-rm-row--highlight {
  background: #f0f0f0;
}

.product-catalog-view .pc-rm-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border: 1px solid #808191;
  border-radius: 16px;
  font-family: "Poppins", var(--sans);
  font-size: 12px;
  font-weight: 600;
  color: #808191;
  white-space: nowrap;
  min-width: 144px;
  box-sizing: border-box;
}

.product-catalog-view .pc-empty {
  margin: 12px 0;
  color: #808191;
  font-size: 14px;
}

.product-catalog-view .pc-picker-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.product-catalog-view .pc-section-label {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
  color: #000;
}

.product-catalog-view .pc-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: #334155;
}

.product-catalog-view .pc-field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.product-catalog-view .pc-input {
  border: 1.5px solid #e4e4e4;
  border-radius: 12px;
  padding: 12px 14px;
  font-family: "Poppins", var(--sans);
  font-size: 14px;
  background: #fff;
}

.product-catalog-view .pc-modal-tabs-card {
  border: 1px solid var(--org-border, #c5dad3);
  border-radius: 16px;
  overflow: hidden;
  background: var(--org-surface, #fffbf8);
  box-shadow: 0 2px 8px rgba(16, 24, 40, 0.06);
}

.product-catalog-view .pc-modal-tabs {
  display: flex;
  align-items: stretch;
  min-height: 52px;
  margin-bottom: 0;
  background: var(--org-sage-2, #ebecdc);
  border-radius: 0;
  border-bottom: 1px solid var(--org-border, #c5dad3);
  overflow: hidden;
}

.product-catalog-view .pc-modal-tab-body {
  background: #fff;
  padding: 16px 18px 18px;
  min-height: 220px;
}

.product-catalog-view .pc-category-combo-wrap {
  position: relative;
}

.product-catalog-view .pc-category-combo-input-row {
  display: flex;
  align-items: stretch;
  gap: 0;
}

.product-catalog-view .pc-category-search {
  flex: 1;
  min-width: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.product-catalog-view .pc-category-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  border: 1.5px solid #e4e4e4;
  border-left: none;
  border-radius: 0 12px 12px 0;
  background: #fff;
  color: #64748b;
  cursor: pointer;
}

.product-catalog-view .pc-category-dropdown {
  position: absolute;
  z-index: 5;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  border: 1.5px solid #e4e4e4;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.product-catalog-view .pc-category-dropdown.hidden {
  display: none;
}

.product-catalog-view .pc-category-option {
  display: block;
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 10px 14px;
  font-family: "Poppins", var(--sans);
  font-size: 14px;
  color: #0f172a;
  cursor: pointer;
}

.product-catalog-view .pc-category-option:hover,
.product-catalog-view .pc-category-option:focus-visible {
  background: #f8fafc;
}

.product-catalog-view .pc-category-option--create {
  color: #507cff;
  font-weight: 600;
  border-top: 1px solid #e4e4e4;
}

.product-catalog-view .pc-category-empty {
  margin: 0;
  padding: 12px 14px;
  font-size: 13px;
  color: #64748b;
}

.product-catalog-view .pc-input[readonly] {
  background: #f8fafc;
  color: #475569;
  cursor: not-allowed;
}

.product-catalog-view .pc-modal-tab {
  flex: 1 1 0;
  min-width: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: "Byotone", var(--sans);
  font-size: 14px;
  color: #000;
  padding: 12px 8px;
}

.product-catalog-view .pc-modal-tab + .pc-modal-tab {
  border-left: 1px solid var(--org-border, #c5dad3);
}

.product-catalog-view .pc-modal-tab--active {
  background: var(--org-surface, #fffbf8);
  border-radius: 16px 16px 0 0;
  font-weight: 700;
}

.product-catalog-view .pc-modal-tab-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.product-catalog-view .pc-mv-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e4e4e4;
}

.product-catalog-view .pc-plant-groups {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.product-catalog-view .pc-plant-group {
  border: 1px solid #e4e4e4;
  border-radius: 12px;
  background: #fafaf8;
  padding: 16px;
}

.product-catalog-view .pc-plant-group-head {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 12px;
}

.product-catalog-view .pc-plant-group-select {
  flex: 1;
  min-width: 0;
}

.product-catalog-view .pc-plant-group-remove {
  flex-shrink: 0;
  margin-bottom: 2px;
}

.product-catalog-view .pc-plant-group-machines {
  padding-top: 12px;
  border-top: 1px solid #e8e8e8;
}

.product-catalog-view .pc-plant-group-add {
  align-self: flex-start;
}

.product-catalog-view .pc-mv-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.product-catalog-view .pc-mv-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  padding: 12px;
  border: 1px solid #e4e4e4;
  border-radius: 12px;
  background: #fff;
}

.product-catalog-view .pc-mv-remove {
  grid-column: 1 / -1;
  justify-self: flex-start;
}

.product-catalog-view .pc-mv-add {
  margin-top: 8px;
}

.product-catalog-view .pc-rm-composition {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.product-catalog-view .pc-rm-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.product-catalog-view .pc-rm-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 12px;
  border: 1px solid #e4e4e4;
  border-radius: 12px;
  background: #fff;
}

.product-catalog-view .pc-rm-row-select {
  min-width: 0;
}

.product-catalog-view .pc-rm-remove {
  margin-bottom: 10px;
}

.product-catalog-view .pc-rm-add {
  align-self: flex-start;
}

.product-catalog-view .pc-modal-layer {
  z-index: 1200;
}

.product-catalog-view .pc-modal-panel {
  width: min(46rem, 100%);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.product-catalog-view .pc-modal-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.product-catalog-view .pc-modal-section {
  margin-bottom: 20px;
}

.product-catalog-view .pc-modal-section-title {
  margin: 0 0 12px;
  font-family: "Roboto", var(--sans);
  font-size: 16px;
  font-weight: 600;
  color: #0f172a;
}

.product-catalog-view .pc-modal-error {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 13px;
}

.product-catalog-view .pc-plant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}

.product-catalog-view .pc-plant-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #334155;
}

.product-catalog-view .pc-field-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.product-catalog-view .pc-field-block--full {
  grid-column: 1 / -1;
}

.product-catalog-view .pc-field-label {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.product-catalog-view .pc-field-hint {
  margin: 4px 0 0;
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
}

.product-catalog-view .pc-field-intro {
  margin: 0 0 10px;
  font-size: 13px;
  color: #64748b;
  line-height: 1.4;
}

.product-catalog-view .pc-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.product-catalog-view .pc-modal-head h2 {
  margin: 0;
  font-size: 20px;
}

.product-catalog-view .pc-modal-close {
  border: none;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: #64748b;
}

.product-catalog-view .pc-modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.product-catalog-view .pc-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

.product-catalog-view .pc-error {
  padding: 24px;
  color: #b91c1c;
}

@media (max-width: 960px) {
  .product-catalog-view.org-structure-view .rsv-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: auto;
  }

  .product-catalog-view .org-splitter {
    display: none;
  }

  .product-catalog-view.org-structure-view .rsv-left {
    max-height: 55vh;
    border-bottom: 1px solid var(--org-border-strong);
  }

  .product-catalog-view.org-structure-view .rsv-right,
  .product-catalog-view .pc-split-right {
    padding: 12px 16px 24px;
  }
}

@media (max-width: 720px) {
  .product-catalog-view .pc-main-panel {
    padding: 16px 12px;
  }

  .product-catalog-view.org-structure-view .rsv-right,
  .product-catalog-view .pc-split-right {
    padding: 12px;
  }

  .product-catalog-view .pc-list-toolbar {
    flex-wrap: wrap;
  }

  .product-catalog-view .pc-mv-row {
    grid-template-columns: 1fr;
  }

  .product-catalog-view .pc-field-grid {
    grid-template-columns: 1fr;
  }

  .product-catalog-view .pc-product-meta {
    flex-wrap: wrap;
    gap: 10px;
  }

  .product-catalog-view .pc-meta-col--category {
    width: auto;
  }
}

/* -------------------------------------------------------------------------- */
/* Visual map (graph module) — Figma Temporis Pro 2026 node canvas            */
/* -------------------------------------------------------------------------- */

.graph-view {
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: calc(100vh - 120px);
  height: 100%;
  background: #f5f5ed;
}

.main-content:has(.graph-view) {
  padding: 0;
}

.main-content:has(.graph-view) .module-root {
  min-height: calc(100vh - 64px);
}

.gv-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid #7f9293;
  background: #f5f5ed;
}

.gv-eyebrow {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #808191;
}

.gv-title {
  margin: 4px 0 0;
  font-size: 20px;
  font-weight: 500;
  color: #111;
}

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

.gv-workspace {
  position: relative;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
}

.gv-workspace:has(.gv-inspector:not(.hidden)),
.gv-workspace:has(.gv-panel:not(.hidden)) {
  grid-template-columns: 1fr minmax(320px, 503px);
}

.gv-viewport {
  position: relative;
  overflow: hidden;
  cursor: grab;
  background: #f5f5ed;
  min-height: 520px;
}

.gv-viewport--panning {
  cursor: grabbing;
}

.gv-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(127, 146, 147, 0.18) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(127, 146, 147, 0.18) 1px, transparent 1px);
  background-size: 66px 66px;
  pointer-events: none;
}

.gv-stage-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.gv-stage {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  will-change: transform;
}

.gv-edges {
  position: absolute;
  inset: 0;
  overflow: visible;
  pointer-events: none;
}

.gv-edge {
  fill: none;
  stroke: #7f9293;
  stroke-width: 1.5;
}

.gv-nodes {
  position: absolute;
  inset: 0;
}

.gv-node {
  position: absolute;
  top: 0;
  left: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  border: 1px solid #7f9293;
  border-radius: 16px;
  background: #f5f5ed;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
  overflow: visible;
}

.gv-node:hover,
.gv-node--selected {
  border-color: #3d5a54;
  box-shadow: 0 0 0 2px rgba(197, 218, 211, 0.8), 0 4px 16px rgba(0, 0, 0, 0.08);
}

.gv-node-body {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px 4px;
}

.gv-node-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid #ebedf0;
  border-radius: 6px;
  background: #fff;
  flex-shrink: 0;
  color: #3d5a54;
}

.gv-node-icon .org-node-ic {
  display: block;
}

.gv-node--company .gv-node-icon {
  background: #eef2f1;
  border-color: #c5dad3;
  color: #2f4843;
}

.gv-node--plant .gv-node-icon {
  background: #f0f6f4;
  border-color: #c5dad3;
}

.gv-node--area .gv-node-icon,
.gv-node--subArea .gv-node-icon {
  background: #fafaf8;
  border-color: #d8dedf;
}

.gv-node--line .gv-node-icon {
  background: #fff;
  border-color: #c5dad3;
  color: #2f4843;
}

.gv-node--workstation .gv-node-icon {
  background: #f8f9fb;
  border-color: #d8dedf;
}

.gv-node--machine .gv-node-icon {
  background: #f5f5ed;
  border-color: #7f9293;
  color: #555;
}

.gv-node-stat .org-node-ic--stat {
  opacity: 0.85;
  flex-shrink: 0;
}

.gv-node-text {
  min-width: 0;
  flex: 1;
}

.gv-node-title {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.1;
  color: #111;
  word-break: break-word;
}

.gv-node-type {
  margin: 5px 0 0;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: #808191;
}

.gv-node-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 15px;
  padding: 4px 10px 8px;
  border-top: 1px solid #c5dad3;
  background: rgba(255, 255, 255, 0.88);
  border-radius: 0 0 16px 16px;
  font-size: 11px;
  color: #3d5a54;
}

.gv-node-stats--empty {
  min-height: 8px;
  padding-bottom: 6px;
}

.gv-node-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.gv-node-handle {
  position: absolute;
  left: 50%;
  bottom: -8px;
  width: 16px;
  height: 16px;
  transform: translateX(-50%);
  border: 2px solid #7f9293;
  border-radius: 50%;
  background: #fff;
  pointer-events: none;
  z-index: 3;
}

.gv-node-alert {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-bottom: 1px solid rgba(251, 188, 9, 0.35);
  background: rgba(251, 188, 9, 0.12);
  border-radius: 16px 16px 0 0;
  font-size: 11px;
  color: #cb4017;
}

.gv-node-alert--compact {
  border-bottom: 1px solid rgba(251, 188, 9, 0.35);
  background: rgba(251, 188, 9, 0.12);
}

.gv-node-alert--stop {
  padding: 8px 12px;
  border: none;
  border-bottom: 1px solid #ff6038;
  border-radius: 0;
  background: #ffc7b9;
  color: #7a5b00;
}

.gv-node-alert-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fbbc09;
  color: #111;
  font-weight: 700;
  flex-shrink: 0;
}

.gv-node-alert--stop .gv-node-alert-icon {
  background: transparent;
  border-radius: 0;
  font-weight: 400;
}

.gv-node-alert--stop .gv-node-alert-icon .org-node-ic {
  display: block;
}

.gv-node-alert-title {
  font-weight: 600;
  flex-shrink: 0;
}

.gv-node-alert--stop .gv-node-alert-title {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 12px;
  line-height: 16px;
  color: #7a5b00;
}

.gv-node-alert-detail {
  color: #555;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gv-node-alert--stop .gv-node-alert-detail {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  line-height: 16px;
  letter-spacing: -0.02em;
  color: #7a5b00;
  opacity: 0.9;
}

.gv-node--stopped-alert {
  border: none;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.gv-node--stopped-alert:hover,
.gv-node--stopped-alert.gv-node--selected {
  border: none;
  box-shadow: none;
}

.gv-node--stopped-alert.gv-node--selected .gv-node-shell {
  box-shadow: 0 0 0 2px rgba(255, 96, 56, 0.35), 0 6px 20px rgba(255, 96, 56, 0.18);
}

.gv-node-shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  box-sizing: border-box;
  border: 1px solid #ff6038;
  border-radius: 16px;
  overflow: hidden;
  background: #ffc7b9;
  animation: gv-node-stop-glow 2.2s ease-in-out infinite;
}

.gv-node-pulse {
  position: absolute;
  inset: -10px;
  pointer-events: none;
  z-index: 0;
}

.gv-node-pulse-ring {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  border: 10px solid rgba(255, 96, 56, 0.42);
  animation: gv-node-radar 2.2s cubic-bezier(0.22, 0.61, 0.36, 1) infinite;
  opacity: 0;
  box-shadow: 0 0 18px rgba(255, 96, 56, 0.22);
}

.gv-node-pulse-ring:nth-child(1) {
  animation-delay: 0s;
}

.gv-node-pulse-ring:nth-child(2) {
  animation-delay: 0.55s;
}

.gv-node-pulse-ring:nth-child(3) {
  animation-delay: 1.1s;
}

.gv-node-pulse-ring:nth-child(4) {
  animation-delay: 1.65s;
}

@keyframes gv-node-radar {
  0% {
    transform: scale(0.96);
    opacity: 0.85;
    border-width: 10px;
    border-color: rgba(255, 96, 56, 0.45);
    box-shadow: 0 0 12px rgba(255, 96, 56, 0.35);
  }

  55% {
    opacity: 0.35;
    border-width: 5px;
    border-color: rgba(255, 96, 56, 0.18);
    box-shadow: 0 0 24px rgba(255, 96, 56, 0.2);
  }

  100% {
    transform: scale(1.32);
    opacity: 0;
    border-width: 2px;
    border-color: rgba(255, 96, 56, 0);
    box-shadow: 0 0 36px rgba(255, 96, 56, 0);
  }
}

@keyframes gv-node-stop-glow {
  0%,
  100% {
    box-shadow:
      0 0 0 0 rgba(255, 96, 56, 0.35),
      0 0 16px rgba(255, 96, 56, 0.18);
  }

  50% {
    box-shadow:
      0 0 0 8px rgba(255, 96, 56, 0.14),
      0 0 28px rgba(255, 96, 56, 0.32);
  }
}

@media (prefers-reduced-motion: reduce) {
  .gv-node-pulse-ring {
    animation: none;
    opacity: 0;
  }

  .gv-node-shell {
    animation: none;
  }

  .gv-node--stopped-alert .gv-node-shell {
    box-shadow: 0 0 0 10px rgba(255, 96, 56, 0.16);
  }
}

.gv-node-body--stop {
  background: #fff2ef;
  border-top: 1px solid #cb4017;
  border-bottom: 1px solid #cb4017;
}

.gv-node-stats--stop {
  background: rgba(255, 255, 255, 0.88);
  border-top: 1px solid #cb4017;
}

.gv-node-handle--stop {
  border-color: #ff6038;
  background: #fff;
  box-shadow:
    0 0 0 4px rgba(255, 96, 56, 0.22),
    0 0 10px rgba(255, 96, 56, 0.35);
}

.gv-node--stopped:not(.gv-node--stopped-alert),
.gv-node--stopped_idle:not(.gv-node--stopped-alert) {
  border-color: #ec221f;
  box-shadow: 0 0 0 2px rgba(236, 34, 31, 0.15), 0 4px 16px rgba(236, 34, 31, 0.12);
}

.gv-node--slow {
  border-color: #fbbc09;
  box-shadow: 0 0 0 2px rgba(251, 188, 9, 0.2), 0 4px 16px rgba(251, 188, 9, 0.1);
}

.gv-node--active.gv-node--line {
  border-color: #7f9293;
}

.gv-node--highlighted {
  border-color: #3d5a54;
  box-shadow: 0 0 0 3px rgba(61, 90, 84, 0.35), 0 6px 20px rgba(0, 0, 0, 0.12);
}

.gv-node-collapse {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border: 1px solid #7f9293;
  border-radius: 6px;
  background: #fff;
  color: #111;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.gv-plant-filter-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #555;
}

.gv-plant-filter {
  min-width: 160px;
  padding: 6px 10px;
  border: 1px solid #7f9293;
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
}

.gv-node-stats--company {
  justify-content: flex-start;
  gap: 8px;
}

.gv-node-stat--labeled {
  gap: 6px;
}

.gv-node-stat-value {
  font-weight: 600;
  font-size: 12px;
}

.gv-node-stat-label {
  font-size: 11px;
  color: #808191;
  letter-spacing: 0.02em;
}

.gv-empty,
.gv-error {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  color: #555;
}

.gv-controls {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: flex;
  gap: 6px;
  z-index: 4;
}

.gv-control-btn {
  min-width: 32px;
  height: 32px;
  border: 1px solid #7f9293;
  border-radius: 8px;
  background: #fff;
  color: #111;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.gv-control-btn--wide {
  min-width: auto;
  padding: 0 12px;
  font-size: 12px;
}

.gv-minimap {
  position: absolute;
  left: 20px;
  bottom: 20px;
  z-index: 5;
  pointer-events: none;
}

.gv-minimap.hidden {
  display: none;
}

.gv-minimap-frame {
  width: 96px;
  height: 88px;
  border: 1px solid #7f9293;
  border-radius: 8px;
  background: #f5f5ed;
  box-shadow: 0 2px 10px rgba(54, 30, 28, 0.12);
  overflow: hidden;
  position: relative;
  pointer-events: auto;
  cursor: crosshair;
}

.gv-minimap-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.gv-minimap-edge {
  fill: none;
  stroke: #9aa3a4;
  stroke-width: 1;
}

.gv-minimap-node {
  fill: #361e1c;
}

.gv-minimap-node--active {
  fill: #f59e0b;
}

.gv-minimap-viewport {
  position: absolute;
  top: 0;
  left: 0;
  border: 1.5px solid #3d5a54;
  background: rgba(245, 245, 237, 0.12);
  border-radius: 3px;
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.gv-minimap-viewport:active {
  cursor: grabbing;
}

.gv-panel {
  border-left: 1px solid #7f9293;
  background: #fff;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-width: 503px;
}

.gv-panel.hidden {
  display: none;
}

.gv-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #ebedf0;
  flex-shrink: 0;
}

.gv-panel-head-title {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #808191;
}

.gv-panel-close {
  font-size: 22px;
  line-height: 1;
}

.gv-panel-content {
  flex: 1;
  overflow: auto;
  padding: 0;
}

.gv-panel-alert {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px;
  background: rgba(251, 188, 9, 0.12);
  border-bottom: 1px solid rgba(251, 188, 9, 0.35);
}

.gv-panel-alert-title {
  font-size: 13px;
  font-weight: 600;
  color: #cb4017;
}

.gv-panel-alert-detail {
  font-size: 12px;
  color: #555;
}

/* Figma 1847:31969 — line detail header in graph panel */
.gv-panel-line-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  min-height: 56px;
  box-sizing: border-box;
  border-bottom: 1px solid #ebedf0;
  background: #f5f5ed;
}

.gv-panel-line-title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-family: "Mortend", var(--sans);
  font-size: 17px;
  font-weight: 700;
  font-style: normal;
  line-height: 1.44;
  letter-spacing: 1.7px;
  text-transform: uppercase;
  color: #361e1c;
  font-synthesis: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gv-panel-line-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.gv-panel-line-stat {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px 8px;
  border: 1px solid rgba(217, 217, 217, 0.2);
  border-radius: 6px;
  background: #fff;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  color: #808191;
  white-space: nowrap;
}

.gv-panel-line-stat .org-node-ic {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: #808191;
}

.gv-panel-line-stat-val {
  font-variant-numeric: tabular-nums;
}

.gv-panel:has(.gv-panel-line-header) .gv-panel-head {
  padding: 8px 12px;
  min-height: 0;
  border-bottom: none;
  justify-content: flex-end;
  background: #f5f5ed;
}

.gv-panel:has(.gv-panel-line-header) .gv-panel-head-title {
  display: none;
}

.gv-panel:has(.gv-panel-line-header) .gv-panel-actions {
  padding: 0 20px 12px;
  background: #f5f5ed;
  border-bottom: 1px solid #ebedf0;
}

/* Figma 1847:31962 — line detail modal */
.gv-line-modal-host {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
}

.gv-line-modal-host:not(.hidden) {
  pointer-events: auto;
}

.gv-line-modal-host.hidden {
  display: none;
}

.gv-line-modal-layer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.45);
}

.gv-line-modal {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(503px, 100%);
  max-height: calc(100vh - 48px);
  border: 1px solid #7f9293;
  border-radius: 6px;
  background: #f5f5ed;
  box-shadow: 0 4px 42.1px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.gv-line-modal--error {
  padding: 48px 20px 20px;
}

button.gv-line-modal-close {
  position: absolute;
  top: 50%;
  right: 12px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  margin: 0;
  border: none !important;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96) !important;
  color: #64748b !important;
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(54, 30, 28, 0.12);
  transform: translateY(-50%);
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.gv-line-modal--error button.gv-line-modal-close {
  top: 12px;
  right: 12px;
  transform: none;
}

button.gv-line-modal-close:hover {
  background: #fff !important;
  color: #361e1c !important;
  box-shadow: 0 2px 8px rgba(54, 30, 28, 0.18);
}

button.gv-line-modal-close:focus-visible {
  outline: 2px solid var(--org-teal);
  outline-offset: 2px;
}

.gv-line-modal-alert {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 8px 12px;
  background: #cb4017;
  color: #fff;
}

.gv-line-modal-alert-icon {
  display: inline-flex;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.gv-line-modal-alert-icon .org-node-ic {
  width: 16px;
  height: 16px;
  color: #fff;
}

.gv-line-modal-alert-title {
  flex-shrink: 0;
  min-width: 56px;
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
}

.gv-line-modal-alert-detail {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  font-family: "Byotone", var(--sans);
  font-size: 14px;
  line-height: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gv-line-modal-header {
  position: relative;
  flex-shrink: 0;
  padding-right: 52px;
  border-bottom: none;
}

.gv-line-modal-header .gv-panel-line-stats {
  margin-right: 0;
}

.gv-line-modal-actions,
.gv-line-actions {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  padding: 0 20px 12px;
  background: #f5f5ed;
}

.gv-panel-actions.gv-line-actions {
  width: 100%;
  padding: 0;
  background: transparent;
}

.gv-line-actions-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: 100%;
}

.gv-line-actions-row .org-btn {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 44px;
  padding: 12px 10px;
  text-align: center;
  white-space: normal;
  line-height: 1.25;
  box-sizing: border-box;
}

.gv-line-actions-row--single .org-btn {
  flex: 1 1 auto;
}

.gv-line-modal-main {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  padding: 6px;
  border-top: 1px solid #c5dad3;
  background: rgba(255, 255, 255, 0.88);
  border-radius: 0 0 16px 16px;
  overflow: hidden;
}

.gv-line-modal-tabs {
  display: flex;
  flex-shrink: 0;
  width: 100%;
}

.gv-line-modal-tab {
  flex: 1 1 0;
  min-width: 0;
  padding: 18px 12px;
  border: 1px solid #c5dad3;
  border-bottom: none;
  border-radius: 16px 16px 0 0;
  background: transparent;
  font-family: "Byotone", var(--sans);
  font-size: 14px;
  font-weight: 400;
  line-height: 16px;
  color: #7f9293;
  text-align: center;
  cursor: pointer;
  position: relative;
  z-index: 1;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, font-weight 0.15s ease;
}

.gv-line-modal-tab:hover:not(.gv-line-modal-tab--active) {
  background: #ebecdc;
  border-color: #7f9293;
  color: #361e1c;
}

.gv-line-modal-tab--active {
  background: #fff;
  border-color: #7f9293;
  border-bottom: 1px solid #fff;
  margin-bottom: -1px;
  font-weight: 700;
  color: #361e1c;
  z-index: 2;
}

.gv-line-modal-tab:focus-visible {
  outline: 2px solid var(--org-teal);
  outline-offset: -2px;
  z-index: 3;
}

.gv-line-modal-pane {
  display: flex;
  flex-direction: column;
  gap: 30px;
  flex: 1 1 auto;
  min-height: 0;
  padding: 12px;
  border: 1px solid #7f9293;
  border-top: none;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  align-items: stretch;
}

.gv-line-modal-pane .ps-detail-card {
  margin: 0;
  background: #f5f5ed;
  flex: 0 0 auto;
  min-height: auto;
  width: 100%;
  overflow: visible;
}

.gv-line-modal-pane .ps-detail-card .ps-card-title:first-child {
  border-top: none;
}

.gv-line-modal-pane .ps-trend-body,
.gv-line-modal-pane .ps-oee-section,
.gv-line-modal-pane .ps-eff-section,
.gv-line-modal-pane .ps-prod-body {
  overflow: visible;
}

.gv-line-modal-loading,
.gv-line-modal-placeholder {
  margin: 0;
  padding: 24px 12px;
  font-size: 14px;
  color: #808191;
  text-align: center;
  flex-shrink: 0;
}

.gv-panel-header,
.gv-panel-hero {
  padding: 18px 16px;
  border-bottom: 1px solid #ebedf0;
  background: linear-gradient(180deg, #fafaf8 0%, #fff 100%);
}

.gv-panel-hero-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.gv-panel-hero-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid #c5dad3;
  border-radius: 10px;
  background: #f0f6f4;
  color: #3d5a54;
  flex-shrink: 0;
}

.gv-panel-hero-icon .org-node-ic {
  width: 20px;
  height: 20px;
}

.gv-panel-hero-text {
  min-width: 0;
  flex: 1;
}

.gv-panel-type-badge {
  display: inline-block;
  margin-bottom: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(197, 218, 211, 0.45);
  border: 1px solid #c5dad3;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #3d5a54;
}

.gv-panel-hero--company .gv-panel-hero-icon {
  background: #eef2f1;
}

.gv-panel-hero--line .gv-panel-hero-icon {
  background: #fff;
}

.gv-panel-title {
  margin: 0;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.2;
  color: #111;
  word-break: break-word;
}

.gv-panel-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.gv-panel-metrics--single {
  grid-template-columns: minmax(0, 160px);
}

.gv-panel-metric {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid #ebedf0;
  border-radius: 10px;
  background: #fff;
  color: #3d5a54;
}

.gv-panel-metric--highlight {
  border-color: #c5dad3;
  background: rgba(197, 218, 211, 0.18);
}

.gv-panel-metric-val {
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  color: #111;
}

.gv-panel-metric-label {
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #808191;
}

.gv-panel-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.gv-panel-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f5f5ed;
  border: 1px solid #c5dad3;
  font-size: 12px;
  color: #3d5a54;
}

.gv-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.gv-panel-actions .org-btn {
  font-family: "Byotone", var(--sans);
}

.gv-panel-link {
  font-size: 12px;
}

.gv-panel-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #fafaf8;
}

.gv-detail-section {
  padding: 14px;
  border: 1px solid #ebedf0;
  border-radius: 12px;
  background: #fff;
}

.gv-detail-section--meta {
  background: #f8f9fb;
}

.gv-detail-section-title {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #808191;
}

.gv-detail-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
}

.gv-detail-metric {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 12px;
  border: 1px solid #ebedf0;
  border-radius: 10px;
  background: #fafaf8;
}

.gv-detail-metric-icon {
  color: #3d5a54;
}

.gv-detail-metric-value {
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
  color: #111;
}

.gv-detail-metric-label {
  font-size: 11px;
  color: #808191;
}

.gv-detail-id {
  margin: 0;
}

.gv-detail-id code {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 8px;
  background: #eef2f1;
  border: 1px solid #d8dedf;
  font-size: 12px;
  color: #333;
  word-break: break-all;
}

.gv-panel-body .ps-detail-card {
  margin: 0;
}

.gv-panel-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gv-panel-section-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #111;
}

.gv-panel-empty {
  margin: 0;
  font-size: 13px;
  color: #808191;
}

.gv-shift-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gv-shift-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  padding: 10px 12px;
  border: 1px solid #ebedf0;
  border-radius: 10px;
  background: #fafaf8;
}

.gv-shift-card--active {
  border-color: #3d5a54;
  background: rgba(197, 218, 211, 0.2);
}

.gv-shift-name {
  font-size: 13px;
  font-weight: 500;
}

.gv-shift-meta {
  grid-column: 1 / -1;
  font-size: 11px;
  color: #808191;
}

.gv-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.gv-kpi-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid #ebedf0;
  border-radius: 10px;
  background: #fafaf8;
}

.gv-kpi-label {
  font-size: 11px;
  color: #808191;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.gv-kpi-value {
  font-size: 18px;
  font-weight: 600;
  color: #111;
}

.gv-kpi-sub {
  font-size: 11px;
  color: #808191;
}

.gv-panel-skeleton {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gv-panel-skel-block {
  height: 48px;
  border-radius: 8px;
  background: linear-gradient(90deg, #ecece4 25%, #f8f8f2 50%, #ecece4 75%);
  background-size: 200% 100%;
  animation: gv-skel-shimmer 1.2s infinite linear;
}

.gv-panel-skel-block--tall {
  height: 160px;
}

.gv-inspector {
  border-left: 1px solid #7f9293;
  background: #fff;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.gv-inspector-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #ebedf0;
}

.gv-inspector-title {
  margin: 0;
  font-size: 16px;
}

.gv-inspector-close {
  font-size: 22px;
  line-height: 1;
}

.gv-inspector-body {
  padding: 16px;
  overflow: auto;
}

.gv-inspector-dl {
  margin: 0;
  display: grid;
  gap: 12px;
}

.gv-inspector-dl div {
  display: grid;
  gap: 4px;
}

.gv-inspector-dl dt {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #808191;
}

.gv-inspector-dl dd {
  margin: 0;
  font-size: 14px;
  color: #111;
}

.gv-skeleton {
  position: absolute;
  inset: 0;
}

.gv-skeleton-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(127, 146, 147, 0.12) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(127, 146, 147, 0.12) 1px, transparent 1px);
  background-size: 66px 66px;
}

.gv-skeleton-card {
  position: absolute;
  top: 80px;
  left: 50%;
  width: 228px;
  height: 72px;
  transform: translateX(-50%);
  border-radius: 16px;
  background: linear-gradient(90deg, #ecece4 25%, #f8f8f2 50%, #ecece4 75%);
  background-size: 200% 100%;
  animation: gv-skel-shimmer 1.2s infinite linear;
}

.gv-skeleton-card--b {
  top: 240px;
  left: 35%;
}

.gv-skeleton-card--c {
  top: 240px;
  left: 65%;
}

@keyframes gv-skel-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

@media (max-width: 960px) {
  .gv-workspace:has(.gv-inspector:not(.hidden)),
  .gv-workspace:has(.gv-panel:not(.hidden)) {
    grid-template-columns: 1fr;
  }

  .gv-inspector,
  .gv-panel {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: min(503px, 92vw);
    z-index: 5;
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.12);
  }
}

