:root {
  --ink: #171717;
  --muted: #737373;
  --line: #e7e7e7;
  --canvas: #f7f7f7;
  --surface: #ffffff;
  --nav: #101010;
  --nav-muted: #a1a1a1;
  --brand: #171717;
  --brand-pale: #f0f0f0;
  --green: #292929;
  --orange: #555555;
  --red: #202020;
  --shadow: 0 3px 14px rgb(0 0 0 / 3%);
  font-family: "Noto Sans SC", sans-serif;
  color: var(--ink);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--canvas); }
button, input, select { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; display: flex; }
.sidebar { width: 280px; flex: 0 0 280px; height: 100vh; position: sticky; top: 0; display: flex; flex-direction: column; background: #fff; color: #111; border-right: 1px solid #e8e8e8; overflow: hidden; z-index: 5; transition: width .2s ease, flex-basis .2s ease, transform .2s ease; }
.brand { height: 76px; display: flex; align-items: center; gap: 10px; padding: 0 24px; border-bottom: 1px solid #ededed; color: #111; font-size: 19px; font-weight: 700; }
.brand small { color: #888; font: 500 10px "DM Mono", monospace; letter-spacing: .8px; padding-top: 3px; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; background: #111; color: #fff; border-radius: 8px; }
.brand-mark svg { width: 17px; }
.nav-list { padding: 14px 0; overflow-y: auto; scrollbar-width: thin; }
.nav-group { margin-top: 4px; }
.nav-item { width: 100%; height: 56px; border: 0; border-radius: 0; display: flex; align-items: center; gap: 15px; padding: 0 34px; color: #111; background: transparent; text-align: left; font-size: 19px; font-weight: 400; transition: .16s ease; }
.nav-item svg { width: 16px; height: 16px; stroke-width: 1.8; }
.nav-item:hover { background: #f6f6f6; }
.nav-item.active { color: #0879ff; background: #e5f2ff; border-radius: 0 8px 8px 0; }
.nav-parent { font-weight: 500; }
.nav-parent .nav-chevron { width: 17px; height: 17px; margin-left: auto; }
.nav-children { display: grid; max-height: 500px; overflow: hidden; transition: max-height .2s ease; }
.nav-child { height: 56px; padding-left: 70px; font-size: 19px; }
.nav-child > svg { width: 20px; height: 20px; margin-left: -32px; margin-right: -3px; }
.nav-child.active { color: #111; background: #f1f1f1; border-radius: 0; }
.nav-group:not(.open) .nav-children { max-height: 0; }
.nav-group:not(.open) .nav-chevron { transform: rotate(180deg); }
.nav-bottom { padding-top: 4px; }
.sidebar.collapsed { width: 76px; flex-basis: 76px; }
.sidebar.collapsed .brand { padding: 0 21px; }
.sidebar.collapsed .brand > span,
.sidebar.collapsed .brand small,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .workspace-switcher > span:nth-child(2),
.sidebar.collapsed .workspace-switcher > svg { display: none; }
.sidebar.collapsed .nav-list { padding-inline: 13px; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 0; }
.sidebar.collapsed .nav-item svg { width: 18px; height: 18px; }
.sidebar.collapsed .nav-parent .nav-chevron { display: none; }
.sidebar.collapsed .nav-child { padding-left: 0; }
.sidebar.collapsed .sidebar-footer { padding-inline: 20px; }
.sidebar.collapsed .workspace-switcher { justify-content: center; padding: 6px 0; }
.sidebar-footer { margin-top: auto; padding: 12px 10px; border-top: 1px solid #ededed; }
.workspace-switcher { border: 0; width: 100%; display: flex; align-items: center; gap: 9px; background: transparent; color: #111; padding: 6px 4px; text-align: left; }
.workspace-switcher > span:nth-child(2) { display: grid; flex: 1; line-height: 1.25; }
.workspace-switcher strong { font-size: 12px; font-weight: 600; }
.workspace-switcher small { color: #94999f; font-size: 11px; }
.workspace-switcher > svg { width: 14px; color: #a2a6ab; }

.main-content { min-width: 0; flex: 1; }
.topbar { height: 76px; padding: 0 32px; display: flex; align-items: center; justify-content: space-between; background: #fff; border-bottom: 1px solid var(--line); }
.breadcrumb { display: flex; align-items: center; gap: 8px; color: #8b95a7; font-size: 13px; }
.breadcrumb svg { width: 14px; }
.breadcrumb strong { color: #27334a; font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.environment { height: 28px; padding: 0 9px; display: inline-flex; align-items: center; gap: 5px; color: #3f3f3f; background: #f2f2f2; border-radius: 5px; font-size: 11px; font-weight: 600; }
.environment svg { width: 13px; }
.icon-button { border: 0; width: 34px; height: 34px; display: grid; place-items: center; background: transparent; border-radius: 6px; color: #59667e; position: relative; }
.icon-button:hover { background: #f2f4f8; color: var(--ink); }
.icon-button svg { width: 18px; }
.notification b { position: absolute; right: 7px; top: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--red); border: 1px solid #fff; }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: #fff; background: #253b63; font: 500 11px "DM Mono", monospace; }
.avatar-small { width: 26px; height: 26px; background: #ae4d33; }
.sidebar-toggle { display: grid; }

.page { max-width: 1480px; margin: 0 auto; padding: 34px 32px 48px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 27px; }
.page-title { margin: 0; font-size: 25px; letter-spacing: 0; }
.page-subtitle { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.button { height: 36px; padding: 0 13px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: #4d4950; font-size: 13px; font-weight: 600; }
.button:hover { background: #f7f7f7; border-color: #d7d7d7; }
.button svg { width: 16px; }
.button.primary { color: #fff; background: #171717; border-color: #171717; box-shadow: 0 3px 8px rgb(0 0 0 / 12%); }
.button.primary:hover { background: #000; }
.button.small { height: 31px; font-size: 12px; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.metric, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.metric { padding: 19px; min-height: 130px; position: relative; overflow: hidden; }
.metric::after { content: ""; position: absolute; top: 0; right: 0; width: 44px; height: 3px; background: #171717; opacity: .7; }
.metric-top { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
.metric-icon { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 7px; color: var(--brand); background: var(--brand-pale); }
.metric-icon.orange, .metric-icon.green, .metric-icon.red { color: #444; background: #f0f0f0; }
.metric-icon svg { width: 16px; }
.metric-value { margin: 15px 0 5px; font: 500 26px "DM Mono", monospace; color: #2b292d; letter-spacing: 0; }
.metric-footer { color: #8390a6; font-size: 11px; }
.metric-footer b { color: #303030; font-weight: 600; }
.metric-footer b.down { color: #303030; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(310px, .9fr); gap: 18px; }
.stack { display: grid; gap: 18px; }
.panel { overflow: hidden; }
.panel-head { min-height: 59px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.panel-title { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 14px; font-weight: 700; }
.panel-title svg { width: 17px; color: #333; }
.panel-note { color: #8792a4; font-size: 11px; }
.chart-wrap { padding: 18px 18px 10px; height: 256px; display: grid; grid-template-columns: 34px 1fr; gap: 7px; }
.y-labels { display: flex; height: 196px; flex-direction: column; justify-content: space-between; color: #a0a9b8; font: 10px "DM Mono", monospace; text-align: right; }
.chart-area { position: relative; display: grid; grid-template-rows: 196px 22px; }
.chart-grid { position: relative; border-bottom: 1px solid #dfe4ec; background: repeating-linear-gradient(to bottom, transparent 0, transparent 48px, #edf0f4 49px); }
.chart-line { width: 100%; height: 100%; position: absolute; inset: 0; overflow: visible; }
.chart-line polyline { fill: none; stroke: #181818; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.chart-line path { fill: rgb(24 24 24 / 7%); stroke: none; }
.chart-dot { fill: #fff; stroke: #181818; stroke-width: 3; }
.x-labels { display: flex; align-items: end; justify-content: space-between; color: #9aa4b5; font: 10px "DM Mono", monospace; }
.chart-summary { padding: 0 18px 16px; display: flex; gap: 20px; }
.summary-mark { color: #71809a; font-size: 11px; }
.summary-mark i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; background: #181818; }
.summary-mark b { color: #344057; margin-left: 4px; font: 500 12px "DM Mono", monospace; }
.summary-mark i.secondary { background: #bbc5d6; }

.connection-body { padding: 14px 18px 17px; }
.connection-row { display: flex; gap: 11px; align-items: center; padding: 10px 0; border-bottom: 1px solid #eef0f4; }
.connection-row:last-child { border-bottom: 0; padding-bottom: 0; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #181818; box-shadow: 0 0 0 4px #ededed; }
.connection-row .details { display: grid; gap: 2px; flex: 1; }
.connection-row strong { font-size: 12px; }
.connection-row span { color: #7c879b; font: 10px "DM Mono", monospace; }
.tag { padding: 3px 6px; border-radius: 4px; color: #363636; background: #eeeeee; font: 500 10px "DM Mono", monospace; }
.connection-type { margin-top: 14px; padding: 10px; display: flex; justify-content: space-between; align-items: center; gap: 10px; border-radius: 6px; background: #f7f9fc; }
.connection-type span { display: grid; gap: 2px; font-size: 11px; color: #68758c; }
.connection-type strong { color: #253149; font-size: 12px; }

.activity-list { list-style: none; padding: 1px 18px 6px; margin: 0; }
.activity-list li { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 13px 0; border-bottom: 1px solid #eef0f4; }
.activity-list li:last-child { border: 0; }
.activity-icon { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 6px; background: #f1f4f9; color: #627087; }
.activity-icon svg { width: 14px; }
.activity-list strong, .activity-list span { display: block; }
.activity-list strong { color: #39455a; font-size: 12px; font-weight: 600; }
.activity-list span { margin-top: 2px; color: #8993a5; font-size: 11px; }
.activity-list time { color: #9da6b5; font: 10px "DM Mono", monospace; white-space: nowrap; }

.wide-panel { margin-top: 18px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 620px; }
th { height: 40px; padding: 0 18px; background: #fbfcfd; color: #8a95a7; font-size: 11px; font-weight: 600; text-align: left; }
td { height: 54px; padding: 0 18px; border-top: 1px solid #edf0f4; color: #465268; font-size: 12px; }
.bot-cell { display: flex; align-items: center; gap: 9px; }
.bot-logo { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 7px; background: #eeeeee; color: #252525; }
.bot-logo svg { width: 14px; }
.mono { font: 11px "DM Mono", monospace; color: #728099; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 4px; font-size: 10px; font-weight: 600; }
.badge::before { content: ""; width: 5px; height: 5px; background: currentColor; border-radius: 50%; }
.badge.online { background: #eeeeee; color: #252525; }
.badge.pending { background: #f4f4f4; color: #656565; }

.section-toolbar { padding: 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.search-field { width: min(320px, 100%); height: 35px; padding: 0 11px; border: 1px solid var(--line); border-radius: 6px; display: flex; gap: 8px; align-items: center; color: #8b96a8; }
.search-field svg { width: 15px; }
.search-field input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 12px; }
.section-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.feature-card { padding: 19px; }
.feature-card .feature-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; color: #2c2c2c; background: #f0f0f0; }
.feature-icon svg { width: 18px; }
.feature-card h3 { margin: 15px 0 5px; font-size: 14px; }
.feature-card p { min-height: 38px; margin: 0 0 16px; color: #778298; font-size: 12px; line-height: 1.6; }
.feature-card .button { margin-top: auto; }

.machine-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(320px, .8fr); gap: 18px; }
.machine-list { padding: 8px 18px 16px; }
.machine-row { padding: 15px 0; display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 11px; border-bottom: 1px solid #edf0f4; }
.machine-row:last-child { border: 0; }
.machine-row h3 { margin: 0 0 3px; font-size: 13px; }
.machine-row p { margin: 0; color: #7e899b; font: 10px "DM Mono", monospace; }
.machine-ops { display: flex; align-items: center; gap: 8px; }
.connection-options { padding: 14px 18px 18px; }
.connection-option { width: 100%; min-height: 102px; padding: 13px; margin-bottom: 10px; display: grid; grid-template-columns: auto 1fr auto; gap: 11px; align-items: start; text-align: left; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: #fff; }
.connection-option.active { border-color: #222; background: #fbfbfb; box-shadow: 0 0 0 3px #ededed; }
.connection-option > i { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 7px; background: #efefef; color: #242424; }
.connection-option svg { width: 16px; }
.connection-option strong, .connection-option span { display: block; }
.connection-option strong { font-size: 13px; }
.connection-option span { margin-top: 4px; color: #78849a; font-size: 11px; line-height: 1.5; }
.connection-option .check { opacity: 0; color: #1c1c1c; }
.connection-option.active .check { opacity: 1; }
.config-box { margin-top: 9px; padding: 14px; border: 1px dashed #cdd7ea; border-radius: 6px; background: #fbfcff; }
.config-box label { display: block; color: #738096; font-size: 11px; margin-bottom: 6px; }
.config-box code { display: block; overflow: hidden; color: #3c4d69; font: 10px "DM Mono", monospace; text-overflow: ellipsis; white-space: nowrap; }

.plugin-toolbar { min-height: 82px; margin-bottom: 12px; padding: 14px 17px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.plugin-bot-picker { position: relative; display: flex; align-items: center; gap: 16px; }
.toolbar-label { color: #858585; font-size: 11px; white-space: nowrap; }
.bot-select { min-width: 220px; padding: 6px 9px; display: flex; align-items: center; gap: 8px; border: 1px solid #dedede; border-radius: 6px; background: #fff; color: #1d1d1d; text-align: left; }
.bot-select:hover { border-color: #aaa; background: #fafafa; }
.bot-select > span:nth-child(2) { display: grid; gap: 2px; flex: 1; }
.bot-select strong { font-size: 12px; font-weight: 600; }
.bot-select small { color: #888; font: 10px "DM Mono", monospace; }
.bot-select > svg { width: 15px; color: #777; }
.bot-menu { position: absolute; z-index: 4; top: 54px; left: 69px; width: 220px; display: none; padding: 4px; border: 1px solid #dedede; border-radius: 6px; background: #fff; box-shadow: 0 8px 24px rgb(0 0 0 / 11%); }
.bot-menu.show { display: grid; }
.bot-menu button { padding: 8px; display: flex; align-items: center; gap: 9px; border: 0; border-radius: 5px; background: #fff; color: #222; text-align: left; }
.bot-menu button:hover { background: #f3f3f3; }
.bot-menu button > span:nth-child(2) { display: grid; gap: 2px; }
.bot-menu strong { font-size: 12px; }
.bot-menu small { color: #888; font: 10px "DM Mono", monospace; }
.plugin-summary { display: flex; align-items: center; }
.plugin-summary > div { min-width: 91px; padding: 0 18px; display: grid; gap: 4px; border-left: 1px solid #ededed; }
.plugin-summary span { color: #858585; font-size: 10px; }
.plugin-summary strong { color: #1c1c1c; font: 500 16px "DM Mono", monospace; }
.plugin-summary .summary-time { font-size: 14px; }
.plugin-notice { margin-bottom: 12px; padding: 10px 13px; display: flex; align-items: flex-start; gap: 9px; color: #555; background: #f5f5f5; border: 1px solid #e7e7e7; border-radius: 6px; }
.notice-icon { flex: 0 0 auto; color: #333; }
.notice-icon svg { width: 16px; }
.plugin-notice p { margin: 0; font-size: 11px; line-height: 1.6; }
.plugin-list-actions { display: flex; align-items: center; gap: 15px; }
.plugin-list { padding: 0 17px; }
.plugin-row { min-height: 72px; display: grid; grid-template-columns: 28px 32px minmax(230px, 1fr) 78px 84px auto; align-items: center; gap: 10px; border-bottom: 1px solid #ededed; }
.plugin-row:last-child { border-bottom: 0; }
.plugin-row.is-disabled { opacity: .58; }
.plugin-order { color: #aaa; font: 11px "DM Mono", monospace; }
.plugin-symbol { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 7px; color: #303030; background: #f0f0f0; }
.plugin-symbol svg { width: 15px; }
.plugin-main { min-width: 0; }
.plugin-name-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.plugin-name-line h3 { margin: 0; font-size: 12px; font-weight: 600; }
.plugin-main p { margin: 4px 0 0; overflow: hidden; color: #858585; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.plugin-type, .global-tag { padding: 3px 6px; border-radius: 4px; color: #777; background: #f1f1f1; font-size: 10px; }
.plugin-type.built-in { color: #444; background: #e8e8e8; }
.global-tag { display: inline-flex; align-items: center; gap: 3px; color: #222; background: #e8e8e8; }
.global-tag svg { width: 11px; }
.plugin-priority { display: grid; gap: 2px; text-align: center; }
.plugin-priority span, .plugin-priority small { color: #999; font-size: 10px; }
.plugin-priority strong { font: 500 13px "DM Mono", monospace; }
.plugin-priority small { color: #555; }
.plugin-status { display: grid; justify-items: center; gap: 6px; }
.status-label { color: #999; font-size: 11px; }
.status-label.active { color: #222; }
.lock-label { display: inline-flex; align-items: center; gap: 3px; color: #999; font-size: 10px; white-space: nowrap; }
.lock-label svg { width: 11px; }
.switch { width: 32px; height: 18px; padding: 2px; border: 0; border-radius: 10px; background: #d5d5d5; }
.switch span { width: 14px; height: 14px; display: block; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 18%); transition: transform .15s ease; }
.switch.on { background: #202020; }
.switch.on span { transform: translateX(14px); }
.plugin-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.danger-action { color: #888; }
.danger-action:hover { color: #222; background: #f1f1f1; }
.plugin-bottom-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.rule-list { padding: 4px 17px 8px; }
.rule-list > div { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid #ededed; }
.rule-list > div:last-child { border-bottom: 0; }
.rule-number { color: #aaa; font: 11px "DM Mono", monospace; }
.rule-list p { margin: 0; display: grid; gap: 3px; }
.rule-list strong { font-size: 12px; font-weight: 600; }
.rule-list span { color: #888; font-size: 11px; }
.reload-panel { align-self: start; }
.reload-state { padding: 17px; display: flex; align-items: center; gap: 10px; }
.reload-check { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #222; }
.reload-check svg { width: 15px; }
.reload-state div { display: grid; gap: 4px; }
.reload-state strong { font-size: 13px; }
.reload-state span { color: #888; font-size: 11px; }
.reload-meta { padding: 10px 17px; display: flex; gap: 15px; color: #888; border-top: 1px solid #ededed; font-size: 10px; }
.reload-meta span { display: inline-flex; align-items: center; gap: 5px; }
.reload-meta svg { width: 13px; }
.code-editor-panel { margin-top: 12px; }
.editor-head-actions { display: flex; align-items: center; gap: 7px; }
.editor-dirty { margin-right: 5px; color: #999; font-size: 10px; }
.editor-dirty.dirty { color: #333; }
.editor-toolbar { min-height: 48px; padding: 0 17px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid #ededed; }
.editor-toolbar label { color: #777; font-size: 11px; }
.editor-toolbar select { min-width: 160px; height: 29px; padding: 0 8px; border: 1px solid #ddd; border-radius: 5px; outline: 0; color: #222; background: #fff; font-size: 11px; }
.editor-toolbar select:focus { border-color: #999; }
.editor-hint { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; color: #999; font-size: 10px; }
.editor-hint svg { width: 13px; }
.code-editor { min-height: 310px; display: grid; grid-template-columns: 45px minmax(0, 1fr); overflow: hidden; background: #171717; }
.line-numbers { padding: 15px 10px 15px 0; overflow: hidden; color: #666; background: #202020; font: 12px/1.7 "DM Mono", monospace; text-align: right; user-select: none; }
.line-numbers span { display: block; height: 20px; }
#pluginCode { width: 100%; min-height: 310px; padding: 15px 17px; resize: vertical; border: 0; outline: 0; overflow: auto; color: #e6e6e6; background: #171717; caret-color: #fff; font: 12px/1.7 "DM Mono", monospace; tab-size: 2; white-space: pre; }
#pluginCode::selection { color: #fff; background: #444; }

.toast { position: fixed; right: 24px; bottom: 24px; z-index: 20; transform: translateY(20px); opacity: 0; pointer-events: none; padding: 11px 14px; display: flex; align-items: center; gap: 8px; color: #fff; background: #20304c; border-radius: 6px; box-shadow: 0 8px 24px rgb(22 32 54 / 22%); font-size: 12px; transition: .2s ease; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast svg { width: 16px; color: #fff; }

@media (max-width: 1120px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid, .machine-grid { grid-template-columns: 1fr; }
  .section-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .sidebar { width: 240px; flex-basis: 240px; position: fixed; transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.collapsed { width: 240px; flex-basis: 240px; }
  .sidebar.collapsed .brand { padding: 0 20px; }
  .sidebar.collapsed .brand > span,
  .sidebar.collapsed .brand small,
  .sidebar.collapsed .nav-label,
  .sidebar.collapsed .nav-item span,
  .sidebar.collapsed .workspace-switcher > span:nth-child(2),
  .sidebar.collapsed .workspace-switcher > svg { display: initial; }
  .sidebar.collapsed .nav-list { padding-inline: 10px; }
  .sidebar.collapsed .nav-item { justify-content: flex-start; padding: 0 10px; }
  .sidebar.collapsed .sidebar-footer { padding-inline: 10px; }
  .sidebar.collapsed .workspace-switcher { justify-content: flex-start; padding: 6px 4px; }
  .sidebar.open { transform: translateX(0); box-shadow: 14px 0 30px rgb(15 24 40 / 25%); }
  .sidebar-toggle { margin-right: 6px; }
  .topbar { height: 60px; padding: 0 16px; justify-content: flex-start; }
  .topbar-actions { margin-left: auto; }
  .topbar-actions .icon-button:first-child { display: none; }
  .environment { display: none; }
  .page { padding: 22px 16px 34px; }
  .page-head { margin-bottom: 18px; display: grid; }
  .head-actions { width: 100%; }
  .head-actions .button { flex: 1; justify-content: center; }
  .metrics, .section-grid { grid-template-columns: 1fr; }
  .metric { min-height: 108px; }
  .chart-wrap { padding-left: 12px; padding-right: 12px; }
  .chart-summary { padding-left: 12px; }
  .section-toolbar { align-items: stretch; flex-direction: column; }
  .search-field { width: 100%; }
  .plugin-toolbar { align-items: stretch; flex-direction: column; }
  .plugin-bot-picker { align-items: flex-start; flex-direction: column; gap: 7px; }
  .bot-select { width: 100%; }
  .bot-menu { top: 68px; left: 0; width: 100%; }
  .plugin-summary { justify-content: space-between; }
  .plugin-summary > div { min-width: 0; flex: 1; padding: 0 10px; }
  .plugin-summary > div:first-child { padding-left: 0; }
  .plugin-row { grid-template-columns: 28px 34px minmax(160px, 1fr) 62px; gap: 8px; }
  .plugin-status, .plugin-actions { grid-column: 3 / -1; justify-items: start; justify-content: flex-start; }
  .plugin-actions { margin-top: -4px; }
  .plugin-bottom-grid { grid-template-columns: 1fr; }
  .editor-head-actions .editor-dirty, .editor-head-actions .restore-code { display: none; }
  .editor-toolbar { align-items: flex-start; flex-direction: column; padding-block: 10px; }
  .editor-hint { margin-left: 0; }
  .code-editor { grid-template-columns: 38px minmax(0, 1fr); }
  #pluginCode { padding-inline: 12px; font-size: 11px; }
}

/* Refined monochrome console layout */
:root {
  --ink: #171717;
  --muted: #777;
  --line: #e5e5e5;
  --canvas: #f5f5f3;
  --surface: #fff;
  --shadow: 0 1px 2px rgb(0 0 0 / 3%), 0 8px 24px rgb(0 0 0 / 2%);
}

body { color: var(--ink); background: var(--canvas); }
.app-shell { min-height: 100dvh; }
.sidebar {
  width: 232px;
  flex-basis: 232px;
  background: #fff;
  border-right-color: #dedede;
}
.brand { height: 64px; padding: 0 20px; gap: 9px; font-size: 16px; }
.brand-mark { width: 30px; height: 30px; border-radius: 7px; }
.brand-mark svg { width: 16px; }
.brand small { font-size: 9px; letter-spacing: .6px; }
.nav-list { padding: 12px 10px; }
.nav-group { margin-top: 7px; }
.nav-item {
  height: 39px;
  gap: 11px;
  padding: 0 11px;
  border-radius: 6px;
  color: #505050;
  font-size: 13px;
  font-weight: 500;
}
.nav-item svg { width: 16px; height: 16px; color: #777; }
.nav-item:hover { background: #f5f5f5; color: #111; }
.nav-item.active { color: #111; background: #ededed; border-radius: 6px; font-weight: 600; }
.nav-item.active svg { color: #111; }
.nav-parent { color: #292929; }
.nav-parent .nav-chevron { width: 14px; height: 14px; color: #999; }
.nav-children { padding: 2px 0 2px 27px; }
.nav-child { height: 34px; padding-left: 12px; border-left: 1px solid #e2e2e2; border-radius: 0 5px 5px 0; font-size: 12px; font-weight: 400; }
.nav-child.active { color: #111; background: #f3f3f3; font-weight: 600; }
.nav-child > svg { width: 15px; height: 15px; margin-left: -25px; margin-right: -1px; }
.sidebar-footer { padding: 10px; border-top-color: #e5e5e5; }
.workspace-switcher { padding: 6px 5px; }
.workspace-switcher strong { font-size: 11px; }
.workspace-switcher small { font-size: 10px; }
.avatar-small { width: 25px; height: 25px; }
.sidebar.collapsed { width: 64px; flex-basis: 64px; }
.sidebar.collapsed .brand { padding: 0 17px; }
.sidebar.collapsed .nav-list { padding-inline: 8px; }
.sidebar.collapsed .sidebar-footer { padding-inline: 16px; }

.main-content { background: var(--canvas); }
.topbar { height: 64px; padding: 0 28px; border-bottom-color: #e2e2e2; }
.sidebar-toggle { color: #444; }
.breadcrumb { font-size: 12px; }
.breadcrumb strong { color: #222; }
.topbar-actions { gap: 8px; }
.environment { height: 26px; color: #555; background: #ededeb; font-size: 10px; }
.icon-button { width: 32px; height: 32px; color: #686868; }
.icon-button:hover { color: #111; background: #ededed; }
.avatar { width: 30px; height: 30px; background: #222; }

.page { max-width: 1380px; padding: 29px 28px 42px; }
.page-head { margin-bottom: 21px; gap: 18px; }
.page-title { font-size: 22px; font-weight: 700; }
.page-subtitle { margin-top: 5px; color: #858585; font-size: 12px; }
.head-actions { gap: 8px; }
.button { height: 34px; padding: 0 11px; border-radius: 5px; color: #454545; font-size: 12px; font-weight: 600; }
.button svg { width: 15px; height: 15px; }
.button.primary { background: #171717; border-color: #171717; box-shadow: none; }
.button.small { height: 29px; padding-inline: 9px; font-size: 11px; }

.metrics { gap: 12px; margin-bottom: 14px; }
.metric, .panel { border-color: #e3e3e3; border-radius: 7px; box-shadow: var(--shadow); }
.metric { min-height: 112px; padding: 16px; }
.metric::after { width: 32px; height: 2px; }
.metric-top { font-size: 11px; }
.metric-icon { width: 28px; height: 28px; border-radius: 6px; background: #f0f0f0; }
.metric-value { margin: 12px 0 4px; font-size: 23px; }
.metric-footer { color: #888; font-size: 10px; }
.dashboard-grid, .machine-grid { gap: 14px; }
.stack { gap: 14px; }
.panel-head { min-height: 52px; padding: 0 16px; }
.panel-title { gap: 8px; font-size: 13px; }
.panel-title svg { width: 16px; }
.panel-note { font-size: 10px; }
.chart-wrap { padding: 15px 16px 8px; height: 235px; }
.connection-body { padding: 11px 16px 14px; }
.connection-row { padding: 9px 0; }
.connection-type { margin-top: 11px; padding: 9px; }
.activity-list { padding-inline: 16px; }
.activity-list li { padding: 11px 0; }
.wide-panel { margin-top: 14px; }
.section-toolbar { padding: 14px 16px; }
.search-field { height: 33px; border-radius: 5px; }
.section-grid { gap: 12px; }
.feature-card { padding: 16px; }
.feature-card h3 { margin-top: 12px; font-size: 13px; }
.feature-card p { margin-bottom: 13px; font-size: 11px; }
th { height: 36px; padding-inline: 16px; font-size: 10px; }
td { height: 49px; padding-inline: 16px; font-size: 11px; }

/* Plugins are a dense work surface, not a collection of oversized cards. */
.plugin-toolbar { min-height: 68px; margin-bottom: 10px; padding: 11px 15px; }
.plugin-bot-picker { gap: 12px; }
.bot-select { min-width: 205px; padding: 5px 8px; }
.bot-select strong { font-size: 11px; }
.bot-select small { font-size: 9px; }
.bot-menu { top: 47px; left: 65px; width: 205px; }
.plugin-summary > div { min-width: 82px; padding-inline: 14px; }
.plugin-summary strong { font-size: 15px; }
.plugin-notice { margin-bottom: 10px; padding: 9px 12px; border-radius: 5px; }
.plugin-notice p { font-size: 10px; line-height: 1.55; }
.plugin-panel .panel-head { min-height: 48px; }
.plugin-list { padding: 0 15px; }
.plugin-row { min-height: 63px; grid-template-columns: 24px 30px minmax(210px, 1fr) 72px 78px auto; gap: 9px; }
.plugin-symbol { width: 28px; height: 28px; border-radius: 6px; }
.plugin-name-line { gap: 6px; }
.plugin-name-line h3 { font-size: 11px; }
.plugin-main p { margin-top: 3px; font-size: 9px; }
.plugin-type, .global-tag { padding: 2px 5px; font-size: 9px; }
.plugin-priority strong { font-size: 12px; }
.plugin-priority span, .plugin-priority small, .status-label { font-size: 9px; }
.lock-label { font-size: 9px; }
.plugin-bottom-grid { gap: 10px; margin-top: 10px; }
.rule-list { padding: 3px 15px 6px; }
.rule-list > div { padding: 8px 0; }
.rule-list strong { font-size: 11px; }
.rule-list span { font-size: 10px; }
.reload-state { padding: 14px 15px; }
.reload-meta { padding: 9px 15px; }
.code-editor-panel { margin-top: 10px; }
.code-editor-panel .panel-head { min-height: 48px; }
.editor-toolbar { min-height: 44px; padding: 0 15px; }
.editor-toolbar select { height: 28px; min-width: 150px; font-size: 10px; }
.code-editor { min-height: 245px; grid-template-columns: 42px minmax(0, 1fr); }
.line-numbers { padding-top: 12px; padding-bottom: 12px; font-size: 11px; }
.line-numbers span { height: 18px; }
#pluginCode { min-height: 245px; padding: 12px 15px; font-size: 11px; line-height: 1.6; }

@media (max-width: 760px) {
  .sidebar { width: 232px; flex-basis: 232px; }
  .sidebar.collapsed { width: 232px; flex-basis: 232px; }
  .sidebar.collapsed .brand { padding: 0 20px; }
  .sidebar.collapsed .nav-list { padding-inline: 10px; }
  .sidebar.collapsed .sidebar-footer { padding-inline: 10px; }
  .topbar { height: 58px; padding: 0 14px; }
  .page { padding: 22px 14px 32px; }
  .page-title { font-size: 20px; }
  .plugin-toolbar { padding: 12px 13px; }
  .plugin-row { grid-template-columns: 24px 30px minmax(130px, 1fr) 54px; gap: 7px; }
  .plugin-list { padding-inline: 13px; }
  .plugin-status, .plugin-actions { grid-column: 3 / -1; }
  .code-editor { min-height: 220px; grid-template-columns: 36px minmax(0, 1fr); }
  #pluginCode { min-height: 220px; padding-inline: 11px; font-size: 10px; }
}

/* Accent palette: blue for actions, green for healthy states, red for attention. */
:root {
  --blue: #2563eb;
  --blue-soft: #eaf2ff;
  --blue-line: #cfe0ff;
  --green: #149447;
  --green-soft: #e9f8ef;
  --red: #dc3d4b;
  --red-soft: #fff0f1;
  --amber: #b97811;
  --amber-soft: #fff7e6;
}

body { background: #f4f7fb; }
.sidebar { border-right-color: #dce4ef; }
.brand-mark { background: var(--blue); box-shadow: 0 5px 12px rgb(37 99 235 / 20%); }
.brand small { color: #8190a5; }
.nav-item { color: #4b5a70; }
.nav-item svg { color: #7c8ba0; }
.nav-item:hover { background: #f1f5fb; color: #1f2937; }
.nav-item:hover svg { color: var(--blue); }
.nav-item.active { color: var(--blue); background: var(--blue-soft); }
.nav-item.active svg { color: var(--blue); }
.nav-parent { color: #25344a; }
.nav-parent.parent-active { color: var(--blue); }
.nav-parent.parent-active svg { color: var(--blue); }
.nav-child.active { color: var(--blue); background: #f2f6ff; border-left-color: var(--blue); }
.nav-child.active > svg { color: var(--blue); }
.topbar { border-bottom-color: #dce4ef; }
.breadcrumb { color: #8291a6; }
.breadcrumb strong { color: #1f3556; }
.environment { color: #275fc8; background: #edf4ff; border: 1px solid #d8e6ff; }
.environment svg { color: var(--blue); }
.icon-button { color: #64748b; }
.icon-button:hover { color: var(--blue); background: #edf4ff; }
.notification b { background: var(--red); }
.avatar { background: #1e3a8a; }
.avatar-small { background: #2563eb; }

.main-content { background: #f4f7fb; }
.page-title { color: #17243a; }
.page-subtitle { color: #718096; }
.button { border-color: #d9e1eb; color: #40516a; }
.button:hover { color: var(--blue); border-color: var(--blue-line); background: #f5f8ff; }
.button.primary { background: var(--blue); border-color: var(--blue); box-shadow: 0 5px 12px rgb(37 99 235 / 17%); }
.button.primary:hover { color: #fff; background: #1d4ed8; border-color: #1d4ed8; }
.metric, .panel { border-color: #dfe6ef; box-shadow: 0 1px 2px rgb(30 55 90 / 3%), 0 10px 28px rgb(30 55 90 / 4%); }
.metric::after { background: var(--blue); opacity: 1; }
.metrics .metric:nth-child(3)::after { background: var(--amber); }
.metrics .metric:nth-child(4)::after { background: var(--red); }
.metric-top { color: #6d7e94; }
.metric-icon { color: var(--blue); background: var(--blue-soft); }
.metric-icon.green { color: var(--green); background: var(--green-soft); }
.metric-icon.orange { color: var(--amber); background: var(--amber-soft); }
.metric-icon.red { color: var(--red); background: var(--red-soft); }
.metric-value { color: #17243a; }
.metric-footer { color: #7b8ba0; }
.metric-footer b { color: var(--green); }
.metric-footer b.down { color: var(--red); }
.panel-head { border-bottom-color: #e4eaf2; }
.panel-title { color: #1d2b40; }
.panel-title svg { color: var(--blue); }
.panel-note { color: #8291a6; }
.chart-grid { background: repeating-linear-gradient(to bottom, transparent 0, transparent 48px, #e8eef7 49px); }
.chart-line polyline { stroke: var(--blue); }
.chart-line path { fill: rgb(37 99 235 / 9%); }
.chart-dot { stroke: var(--blue); }
.summary-mark { color: #6f819b; }
.summary-mark i { background: var(--blue); }
.summary-mark b { color: #26426f; }
.summary-mark i.secondary { background: #cbd5e1; }
.status-dot { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.tag { color: var(--green); background: var(--green-soft); }
.connection-type { background: #f2f6fc; }
.connection-type strong { color: #214e9c; }
.activity-icon { background: #edf4ff; color: var(--blue); }
.activity-list strong { color: #2d4261; }
th { color: #7385a0; background: #f8faff; }
td { border-top-color: #e7edf5; color: #435570; }
.bot-logo { background: #edf4ff; color: var(--blue); }
.mono { color: #6881a8; }
.badge.online { color: var(--green); background: var(--green-soft); }
.badge.pending { color: var(--amber); background: var(--amber-soft); }
.search-field { border-color: #d9e2ee; background: #fff; }
.search-field:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgb(37 99 235 / 10%); }
.feature-card .feature-icon { color: var(--blue); background: var(--blue-soft); }

.connection-option.active { border-color: var(--blue); background: #f7faff; box-shadow: 0 0 0 3px rgb(37 99 235 / 10%); }
.connection-option > i { color: var(--blue); background: var(--blue-soft); }
.connection-option .check { color: var(--blue); }
.config-box { border-color: var(--blue-line); background: #f7faff; }
.config-box label { color: #6c82a4; }
.config-box code { color: #315a9b; }
.plugin-symbol { color: var(--blue); background: var(--blue-soft); }
.plugin-type.built-in { color: #435570; background: #edf1f7; }
.global-tag { color: #245dbd; background: var(--blue-soft); }
.plugin-status .status-label.active { color: var(--green); }
.switch.on { background: var(--green); }
.danger-action:hover { color: var(--red); background: var(--red-soft); }
.reload-check { background: var(--green); box-shadow: 0 4px 10px rgb(20 148 71 / 18%); }
.editor-toolbar select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgb(37 99 235 / 10%); }
.toast { background: #1d4ed8; box-shadow: 0 8px 24px rgb(37 99 235 / 25%); }

/* Dashboard trend chart */
.dashboard-grid > .panel:first-child { align-self: start; }
.chart-wrap { grid-template-columns: 64px 1fr; height: 370px; padding: 18px 18px 9px; gap: 9px; }
.y-labels { height: 320px; color: #9aa8bb; font-size: 10px; }
.chart-area { grid-template-rows: 320px 24px; }
.chart-grid { background: repeating-linear-gradient(to bottom, transparent 0, transparent 79px, #e7edf5 80px); }
.chart-line polyline { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.chart-line .series-send { stroke: #5750e8; }
.chart-line .series-receive { stroke: #1bb889; }
.chart-line .series-dau { stroke: #f39a0b; }
.series-points circle { fill: #fff; stroke-width: 3; }
.receive-points circle { stroke: #1bb889; }
.send-points circle { stroke: #5750e8; }
.dau-points circle { stroke: #f39a0b; }
.chart-summary { justify-content: center; gap: 28px; padding: 0 18px 16px; }
.summary-mark { display: inline-flex; align-items: center; gap: 8px; color: #6d7788; font-size: 12px; }
.summary-mark i { width: 10px; height: 10px; margin: 0; }
.summary-mark b { display: none; }
.send-mark i { background: #5750e8; }
.receive-mark i { background: #1bb889; }
.dau-mark i { background: #f39a0b; }

@media (max-width: 760px) {
  .chart-wrap { grid-template-columns: 48px 1fr; height: 300px; padding-inline: 11px; }
  .y-labels { height: 250px; font-size: 9px; }
  .chart-area { grid-template-rows: 250px 22px; }
  .chart-summary { gap: 17px; padding-inline: 10px; }
  .summary-mark { gap: 6px; font-size: 11px; }
  .page, .dashboard-grid, .dashboard-grid > .panel, .chart-wrap, .chart-area { min-width: 0; }
  .panel-head { min-width: 0; }
  .panel-note { max-width: 42%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .head-actions .button { min-width: 0; padding-inline: 8px; font-size: 11px; white-space: nowrap; }
}

/* Machine directory */
.machine-layout { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
.machine-directory { min-width: 0; }
.machine-directory .section-toolbar { min-height: 62px; }
.section-label { color: #1d2b40; font-size: 13px; }
.section-count { margin-left: 7px; color: #8291a6; font: 10px "DM Mono", monospace; }
.machine-toolbar-actions { display: flex; align-items: center; gap: 8px; }
.machine-toolbar-actions .search-field { width: 210px; }
.machine-table-wrap { overflow-x: auto; }
.machine-table { min-width: 1030px; table-layout: fixed; }
.machine-table th, .machine-table td { padding-inline: 13px; }
.machine-table th:nth-child(1) { width: 190px; }
.machine-table th:nth-child(2) { width: 100px; }
.machine-table th:nth-child(3) { width: 125px; }
.machine-table th:nth-child(4) { width: 200px; }
.machine-table th:nth-child(5) { width: 125px; }
.machine-table th:nth-child(6) { width: 80px; }
.machine-table th:nth-child(7) { width: 95px; }
.machine-table th:nth-child(8) { width: 92px; }
.machine-table .bot-cell { min-width: 0; }
.machine-name { min-width: 0; display: grid; gap: 3px; }
.machine-name strong { overflow: hidden; color: #243a5c; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.machine-name span { overflow: hidden; color: #8a99ad; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.type-label { color: #526983; font-size: 10px; white-space: nowrap; }
.address-cell { display: block; overflow: hidden; color: #6b81a2; font: 9px "DM Mono", monospace; text-overflow: ellipsis; white-space: nowrap; }
.date-cell { font-size: 9px; white-space: nowrap; }
.connection-state { display: inline-flex; align-items: center; gap: 5px; color: #5f7188; font-size: 10px; white-space: nowrap; }
.connection-state i { width: 6px; height: 6px; border-radius: 50%; background: #aeb8c5; }
.connection-state.connected { color: var(--green); }
.connection-state.connected i { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.connection-state.disconnected { color: #a16c13; }
.connection-state.disconnected i { background: var(--amber); }
.machine-more-cell { position: relative; text-align: right; }
.machine-more { gap: 5px; }
.machine-more svg { width: 14px; }
.machine-more-menu { position: absolute; z-index: 8; top: calc(100% - 4px); right: 10px; width: 142px; display: none; padding: 4px; border: 1px solid #dce4ef; border-radius: 6px; background: #fff; box-shadow: 0 10px 26px rgb(30 55 90 / 15%); }
.machine-more-menu.show { display: grid; }
.machine-more-menu button { min-height: 30px; padding: 0 8px; display: flex; align-items: center; gap: 7px; border: 0; border-radius: 4px; color: #40516a; background: #fff; text-align: left; font-size: 11px; }
.machine-more-menu button:hover { color: var(--blue); background: var(--blue-soft); }
.machine-more-menu svg { width: 14px; }

.modal-backdrop { position: fixed; z-index: 30; inset: 0; display: none; place-items: center; padding: 20px; background: rgb(20 35 58 / 28%); backdrop-filter: blur(2px); }
.modal-backdrop.show { display: grid; }
.machine-modal { width: min(580px, 100%); max-height: calc(100vh - 40px); overflow: auto; border: 1px solid #dbe4ef; border-radius: 10px; background: #fff; box-shadow: 0 20px 60px rgb(22 43 72 / 20%); }
.modal-head { padding: 19px 21px 16px; display: flex; align-items: flex-start; justify-content: space-between; border-bottom: 1px solid #e5ebf3; }
.modal-head h2 { margin: 0; color: #17243a; font-size: 17px; }
.modal-head p { margin: 5px 0 0; color: #7b8ba0; font-size: 11px; }
.close-machine-modal { width: 28px; height: 28px; margin: -3px -5px 0 0; }
.close-machine-modal svg { width: 17px; }
.machine-modal form { padding: 18px 21px 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px 14px; }
.form-field { min-width: 0; display: grid; gap: 6px; }
.form-field-wide { grid-column: 1 / -1; }
.form-field > span { color: #52657f; font-size: 11px; font-weight: 600; }
.form-field input, .form-field select { width: 100%; height: 35px; padding: 0 10px; border: 1px solid #d8e1ec; border-radius: 5px; outline: 0; color: #263a59; background: #fff; font-size: 12px; }
.form-field input::placeholder { color: #a5b0be; }
.form-field input:focus, .form-field select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgb(37 99 235 / 10%); }
.modal-foot { margin-top: 22px; padding-top: 15px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid #e9eef4; }
body.modal-open { overflow: hidden; }

@media (max-width: 1120px) {
  .machine-layout { grid-template-columns: minmax(0, 1fr) 300px; }
}
@media (max-width: 760px) {
  .machine-layout { grid-template-columns: 1fr; }
  .machine-toolbar-actions { align-items: stretch; flex-direction: column; }
  .machine-toolbar-actions .search-field { width: 100%; }
  .machine-modal { border-radius: 8px; }
  .modal-head, .machine-modal form { padding-inline: 16px; }
  .form-grid { grid-template-columns: 1fr; gap: 12px; }
  .form-field-wide { grid-column: auto; }
}

/* Shared workspace pages */
.workspace-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.workspace-metric { min-height: 90px; padding: 15px 16px; display: flex; align-items: center; justify-content: space-between; border: 1px solid #dfe6ef; border-radius: 7px; background: #fff; box-shadow: var(--shadow); }
.workspace-metric > div { display: grid; gap: 9px; }
.workspace-metric span { color: #72839b; font-size: 11px; }
.workspace-metric strong { color: #17243a; font: 500 21px "DM Mono", monospace; }
.workspace-metric > i { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 7px; color: var(--blue); background: var(--blue-soft); }
.workspace-metric > i svg { width: 17px; }
.workspace-metric.tone-1 > i { color: var(--green); background: var(--green-soft); }
.workspace-metric.tone-2 > i { color: var(--amber); background: var(--amber-soft); }
.workspace-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; align-items: start; }
.workspace-table-panel { min-width: 0; overflow: hidden; }
.workspace-tabs { min-height: 49px; padding: 0 16px; display: flex; align-items: center; gap: 22px; border-bottom: 1px solid #e4eaf2; }
.workspace-tab { height: 49px; padding: 0; position: relative; border: 0; color: #7789a1; background: transparent; font-size: 12px; font-weight: 500; }
.workspace-tab:hover { color: var(--blue); }
.workspace-tab.active { color: var(--blue); font-weight: 700; }
.workspace-tab.active::after { content: ""; position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: var(--blue); }
.workspace-tab-note { margin-left: auto; color: #9aa8ba; font-size: 10px; }
.workspace-toolbar { min-height: 58px; padding-block: 12px; border-bottom-color: #e9eef5; }
.workspace-toolbar .search-field { width: min(280px, 100%); }
.workspace-toolbar-actions { display: flex; gap: 7px; }
.workspace-table { min-width: 700px; }
.workspace-table th { height: 37px; }
.workspace-table td { height: 55px; }
.workspace-table td strong { color: #2b4266; font-size: 11px; }
.workspace-table td .mono { font-size: 9px; }
.workspace-settings { overflow: hidden; }
.settings-list { padding: 5px 16px; }
.setting-row { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid #edf1f6; }
.setting-row:last-child { border-bottom: 0; }
.setting-row > span:first-child { color: #71839c; font-size: 11px; }
.setting-value { color: #2e466b; font: 10px "DM Mono", monospace; text-align: right; }
.setting-input { width: min(150px, 52%); min-width: 0; height: 28px; padding: 0 7px; border: 1px solid #d8e1ec; border-radius: 4px; outline: 0; color: #2e466b; background: #fff; font: 10px "DM Mono", monospace; text-align: right; }
.setting-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgb(37 99 235 / 10%); }
.workspace-row-actions { white-space: nowrap; text-align: right; }
.workspace-row-actions .icon-button { width: 27px; height: 27px; vertical-align: middle; }
.setting-toggle { min-width: 72px; padding: 0; display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; border: 0; color: #8997aa; background: transparent; font-size: 10px; }
.setting-toggle i { width: 25px; height: 15px; padding: 2px; display: block; border-radius: 10px; background: #cbd5e1; }
.setting-toggle i::after { content: ""; width: 11px; height: 11px; display: block; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / 18%); transition: transform .15s ease; }
.setting-toggle.on { color: var(--green); }
.setting-toggle.on i { background: var(--green); }
.setting-toggle.on i::after { transform: translateX(10px); }
.setting-toggle b { font-weight: 500; white-space: nowrap; }
.settings-footer { min-height: 44px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid #e9eef5; }
.settings-footer > span { display: inline-flex; align-items: center; gap: 5px; color: var(--green); font-size: 10px; }
.settings-footer svg { width: 13px; }
.workspace-modal-backdrop { position: fixed; z-index: 30; inset: 0; display: none; place-items: center; padding: 20px; background: rgb(20 35 58 / 28%); backdrop-filter: blur(2px); }
.workspace-modal-backdrop.show { display: grid; }
.workspace-modal { width: min(520px, 100%); border: 1px solid #dbe4ef; border-radius: 9px; background: #fff; box-shadow: 0 20px 60px rgb(22 43 72 / 20%); }
.workspace-modal .modal-head { padding: 18px 20px 15px; }
.workspace-modal form { padding: 18px 20px 20px; }
.workspace-modal .form-grid { gap: 13px; }

@media (max-width: 1120px) {
  .workspace-layout { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .workspace-metrics { grid-template-columns: 1fr; gap: 8px; }
  .workspace-metric { min-height: 76px; }
  .workspace-tabs { gap: 16px; overflow-x: auto; }
  .workspace-tab { flex: 0 0 auto; }
  .workspace-tab-note { display: none; }
  .workspace-toolbar { align-items: stretch; }
  .workspace-toolbar-actions { justify-content: flex-end; }
}
