:root {
  --ink: #142b26;
  --ink-2: #29433c;
  --muted: #6f7f7a;
  --line: #dce4e0;
  --line-soft: #eaf0ed;
  --surface: #ffffff;
  --canvas: #f3f6f4;
  --navy: #102621;
  --navy-2: #17352e;
  --green: #179a6b;
  --green-dark: #0b7250;
  --green-soft: #e8f5ef;
  --lime: #b8db74;
  --amber: #e4a735;
  --amber-soft: #fff4dc;
  --orange: #d96b2b;
  --red: #cf493f;
  --red-soft: #fcedeb;
  --shadow: 0 10px 30px rgba(20, 43, 38, .06);
  --mono: "DM Mono", "SFMono-Regular", Consolas, monospace;
  --sans: "Manrope", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}

* { box-sizing: border-box; }
html { font-size: 15px; }
body { margin: 0; color: var(--ink); font-family: var(--sans); background: var(--canvas); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.eyebrow { color: var(--green-dark); font: 500 .68rem/1.2 var(--mono); letter-spacing: .13em; text-transform: uppercase; }
.eyebrow.inverse { color: #94b6ab; }
.status-dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; vertical-align: 1px; }
.status-dot.normal { background: #25b77e; box-shadow: 0 0 0 4px rgba(37,183,126,.13); }

/* Shell */
.app-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; display: flex; width: 248px; flex-direction: column; overflow-y: auto; color: #eaf4f0; background: var(--navy); border-right: 1px solid rgba(255,255,255,.04); }
.brand { display: flex; align-items: center; gap: 11px; }
.sidebar > .brand { min-height: 78px; padding: 0 25px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-mark { position: relative; display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; gap: 2px; transform: skew(-8deg); }
.brand-mark span { display: block; width: 5px; background: var(--lime); border-radius: 1px; }
.brand-mark span:nth-child(1) { height: 13px; }
.brand-mark span:nth-child(2) { height: 23px; }
.brand-mark span:nth-child(3) { height: 17px; }
.brand-copy { display: flex; flex-direction: column; }
.brand-copy b { font-size: .93rem; letter-spacing: .09em; }
.brand-copy small { margin-top: 1px; color: #7fa096; font: 500 .54rem var(--mono); letter-spacing: .12em; }
.plant-context { margin: 18px 14px 9px; padding: 14px 13px; border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.035); }
.plant-line { display: flex; margin-top: 7px; align-items: center; justify-content: space-between; }
.plant-line b { font-size: .8rem; font-weight: 700; }
.plant-context small { color: #77998e; font-size: .68rem; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: #2cc887; box-shadow: 0 0 0 4px rgba(44,200,135,.12); }
.primary-nav { padding: 4px 12px 25px; }
.nav-section { margin: 19px 12px 7px; color: #63847a; font: 500 .58rem var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.nav-link { position: relative; display: flex; height: 42px; margin: 2px 0; padding: 0 12px; align-items: center; gap: 11px; color: #a9beb7; border-radius: 5px; font-size: .8rem; font-weight: 600; transition: .16s ease; }
.nav-link .icon { width: 18px; height: 18px; color: #75948a; }
.nav-link:hover { color: white; background: rgba(255,255,255,.055); }
.nav-link.active { color: white; background: #20463c; }
.nav-link.active::before { position: absolute; left: -12px; width: 3px; height: 21px; content: ""; background: var(--lime); border-radius: 0 3px 3px 0; }
.nav-link.active .icon { color: var(--lime); }
.nav-link em { min-width: 20px; margin-left: auto; padding: 2px 5px; color: #0d2c23; font: 600 .58rem var(--mono); text-align: center; background: var(--lime); border-radius: 9px; }
.sidebar-bottom { margin-top: auto; padding: 12px; border-top: 1px solid rgba(255,255,255,.08); }
.user-card { display: grid; grid-template-columns: 34px 1fr 16px; padding: 9px; align-items: center; gap: 9px; border-radius: 5px; }
.user-card:hover { background: rgba(255,255,255,.05); }
.avatar { display: grid; width: 34px; height: 34px; place-items: center; color: #132b25; font-size: .78rem; font-weight: 800; background: #d6e8c4; border-radius: 4px; }
.user-card > span:nth-child(2) { display: flex; min-width: 0; flex-direction: column; }
.user-card b { font-size: .74rem; }
.user-card small { overflow: hidden; margin-top: 2px; color: #718f86; font-size: .6rem; white-space: nowrap; text-overflow: ellipsis; }
.user-card .icon { width: 14px; color: #67877d; }
.logout-button { display: flex; width: 100%; padding: 8px 10px; align-items: center; gap: 9px; color: #6f9187; border: 0; background: transparent; cursor: pointer; font-size: .7rem; }
.logout-button .icon { width: 15px; }
.logout-button:hover { color: white; }
.main-frame { grid-column: 2; display: flex; min-width: 0; min-height: 100vh; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; height: 66px; padding: 0 28px; align-items: center; justify-content: space-between; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.topbar-context, .topbar-status { display: flex; height: 100%; align-items: center; }
.context-item { display: flex; min-width: 150px; height: 100%; padding: 0 22px; flex-direction: column; justify-content: center; border-right: 1px solid var(--line-soft); }
.context-item:first-child { padding-left: 0; }
.context-item span, .update-time span { color: #8a9893; font: 500 .55rem var(--mono); letter-spacing: .09em; }
.context-item strong { margin-top: 3px; font-size: .72rem; letter-spacing: .01em; }
.update-time { display: flex; padding: 0 20px; flex-direction: column; align-items: flex-end; }
.update-time strong { margin-top: 3px; font: 500 .73rem var(--mono); }
.connection-pill { display: flex; height: 33px; padding: 0 11px; align-items: center; gap: 7px; color: var(--green-dark); border: 1px solid #c9dfd6; background: #edf8f3; border-radius: 4px; cursor: default; font-size: .68rem; font-weight: 700; }
.connection-pill i { width: 6px; height: 6px; background: #20ad78; border-radius: 50%; }
.connection-pill small { padding-left: 7px; color: #779088; border-left: 1px solid #cedfd8; font: .56rem var(--mono); }
.icon-button { position: relative; display: grid; width: 36px; height: 36px; margin-left: 10px; place-items: center; color: #557068; border: 1px solid var(--line); background: white; border-radius: 4px; cursor: pointer; }
.icon-button .icon { width: 17px; }
.notification-dot { position: absolute; top: 7px; right: 7px; width: 5px; height: 5px; background: var(--orange); border: 1px solid white; border-radius: 50%; }
.mobile-menu { display: none; margin: 0 12px 0 0; }
.content { width: 100%; max-width: 1640px; margin: 0 auto; padding: 30px 34px 38px; flex: 1; }
.footer { display: flex; min-height: 42px; padding: 0 34px; align-items: center; justify-content: space-between; color: #86948f; border-top: 1px solid var(--line); font: .58rem var(--mono); letter-spacing: .04em; }
.flash { margin-bottom: 18px; padding: 12px 15px; color: #8a2d28; background: var(--red-soft); border-left: 3px solid var(--red); font-size: .78rem; }

/* Common components */
.page-heading { display: flex; margin-bottom: 24px; align-items: flex-end; justify-content: space-between; gap: 24px; }
.page-heading h1 { margin: 7px 0 6px; font-size: clamp(1.65rem, 2vw, 2.25rem); line-height: 1.12; letter-spacing: -.045em; }
.page-heading p { max-width: 720px; margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.65; }
.dashboard-heading { align-items: center; }
.heading-actions { display: flex; gap: 8px; }
.button { display: inline-flex; min-height: 38px; padding: 0 15px; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 4px; cursor: pointer; font-size: .72rem; font-weight: 700; transition: .15s ease; }
.button .icon { width: 15px; }
.button.primary { color: white; background: var(--green-dark); border-color: var(--green-dark); }
.button.primary:hover { background: #075f43; }
.button.secondary { color: var(--ink-2); background: white; border-color: var(--line); }
.button.secondary:hover, .button.tertiary:hover { border-color: #9eb2ab; }
.button.tertiary { min-height: 32px; padding: 0 11px; color: #677a74; background: white; border-color: var(--line); }
.panel { background: var(--surface); border: 1px solid var(--line); box-shadow: 0 1px 0 rgba(15,45,36,.02); }
.panel-header { display: flex; min-height: 70px; padding: 19px 22px 15px; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line-soft); }
.panel-header h2 { margin: 5px 0 0; font-size: .98rem; letter-spacing: -.02em; }
.panel-header a { color: var(--green-dark); font-size: .66rem; font-weight: 700; }
.row-action { display: grid; min-width: 30px; height: 28px; padding: 0 7px; place-items: center; color: #75857f; border: 1px solid var(--line); background: white; border-radius: 4px; cursor: pointer; letter-spacing: 1px; }
.metric-state { display: inline-flex; align-items: center; gap: 6px; color: var(--green-dark); font-size: .62rem; font-weight: 700; }
.metric-state i { width: 6px; height: 6px; background: var(--green); border-radius: 50%; }
.metric-state.watch { color: #a76c09; }
.metric-state.watch i { background: var(--amber); }
.metric-state.warning { color: #996306; }
.metric-state.warning i { background: var(--amber); }
.metric-state.critical { color: #aa3730; }
.metric-state.critical i { background: var(--red); }
.status-tag { display: inline-flex; padding: 4px 7px; align-items: center; font: 600 .58rem var(--mono); letter-spacing: .03em; background: #eff3f1; border-radius: 3px; }
.status-tag.success { color: #09714e; background: #e6f5ee; }
.status-tag.warning { color: #996306; background: #fff1d2; }
.back-link { display: block; margin-bottom: 18px; color: var(--green-dark); font-size: .72rem; font-weight: 700; }

/* Operator */
.shift-chip { display: grid; padding: 10px 14px; grid-template-columns: auto auto; column-gap: 15px; background: white; border: 1px solid var(--line); }
.shift-chip span { grid-row: span 2; align-self: center; color: var(--green-dark); font: 500 .62rem var(--mono); }
.shift-chip b { font: 500 .7rem var(--mono); }
.shift-chip small { margin-top: 3px; color: var(--muted); font-size: .58rem; }
.hero-status { position: relative; display: grid; min-height: 136px; margin-bottom: 16px; padding: 22px 25px; grid-template-columns: 68px 1fr auto; align-items: center; gap: 20px; overflow: hidden; color: white; background: var(--navy-2); border-left: 4px solid var(--amber); }
.hero-status::after { position: absolute; right: 26%; width: 300px; height: 300px; content: ""; border: 1px solid rgba(255,255,255,.035); border-radius: 50%; box-shadow: 0 0 0 45px rgba(255,255,255,.018), 0 0 0 90px rgba(255,255,255,.012); }
.hero-status-icon { position: relative; display: grid; width: 62px; height: 62px; place-items: center; }
.hero-status-icon > i { z-index: 2; width: 18px; height: 18px; background: var(--amber); border: 5px solid #f8cf7e; border-radius: 50%; box-shadow: 0 0 25px rgba(228,167,53,.6); }
.radar-ring { position: absolute; inset: 3px; border: 1px solid rgba(242,194,95,.5); border-radius: 50%; animation: breathe 2.2s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(.82); opacity: .45; } }
.hero-status-copy { z-index: 1; }
.hero-status-copy h2 { margin: 5px 0 3px; font-size: 1.6rem; letter-spacing: -.03em; }
.hero-status-copy p { margin: 0; color: #94afa6; font-size: .72rem; }
.hero-status-meta { z-index: 1; display: flex; height: 63px; }
.hero-status-meta > div { display: flex; min-width: 130px; padding: 2px 24px; flex-direction: column; justify-content: center; border-left: 1px solid rgba(255,255,255,.11); }
.hero-status-meta span { color: #719189; font: 500 .55rem var(--mono); letter-spacing: .1em; }
.hero-status-meta b { margin-top: 7px; font-size: .78rem; }
.hero-status-meta > div:last-child b { color: #d9efc8; font: 500 1.45rem var(--mono); }
.hero-status-meta b span { color: inherit; font-size: .7rem; }
.metric-grid { display: grid; gap: 16px; }
.operator-metrics { grid-template-columns: repeat(3, 1fr); margin-bottom: 16px; }
.metric-card { position: relative; min-height: 152px; padding: 18px 20px; overflow: hidden; background: white; border: 1px solid var(--line); }
.metric-top, .metric-foot { display: flex; align-items: center; justify-content: space-between; }
.metric-top > span:first-child { color: #536a63; font-size: .68rem; font-weight: 700; }
.metric-card > strong { display: block; margin: 14px 0 9px; font: 500 2.25rem/1 var(--mono); letter-spacing: -.06em; }
.metric-foot { color: #7c8c87; font-size: .59rem; }
.metric-foot small { font-size: inherit; }
.trend-down { color: var(--green-dark); }
.micro-bars { position: absolute; right: 18px; bottom: 15px; left: 18px; display: flex; height: 34px; align-items: flex-end; gap: 5px; opacity: .6; }
.micro-bars i { flex: 1; min-height: 4px; background: #c8ded5; }
.micro-bars i:nth-last-child(-n+3) { background: #87b9a7; }
.threshold-track { position: relative; height: 5px; margin-top: 26px; background: #e8eeeb; }
.threshold-track i { display: block; height: 100%; background: #43a983; }
.threshold-track em { position: absolute; top: -4px; width: 2px; height: 13px; background: var(--amber); }
.alarm-metric .metric-top a { color: var(--green-dark); font-size: .6rem; font-weight: 700; }
.alarm-breakdown { display: flex; gap: 18px; font-size: .62rem; }
.alarm-breakdown span { display: flex; align-items: center; gap: 6px; }
.alarm-breakdown i { width: 7px; height: 7px; border-radius: 50%; }
.alarm-breakdown i.critical { background: var(--red); }
.alarm-breakdown i.warning { background: var(--amber); }
.metric-alert-line { position: absolute; right: 0; bottom: 0; left: 0; padding: 7px 20px; color: #9a6a19; background: var(--amber-soft); font: .57rem var(--mono); }
.control-strip { display: grid; min-height: 112px; margin-bottom: 16px; padding: 18px 20px; grid-template-columns: 220px 1fr; align-items: center; gap: 25px; color: white; background: #1c3730; }
.control-copy h3 { margin: 4px 0 3px; font-size: 1rem; }
.control-copy p { margin: 0; color: #87a69c; font-size: .61rem; line-height: 1.5; }
.control-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.control-button { display: flex; min-height: 68px; padding: 10px 14px; align-items: center; gap: 12px; color: white; background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.12); border-radius: 3px; cursor: pointer; text-align: left; }
.control-button:hover { background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.25); }
.control-button > .icon { width: 23px; height: 23px; padding: 4px; color: var(--lime); border: 1px solid rgba(184,219,116,.35); }
.control-button > span { display: flex; flex-direction: column; }
.control-button b { font: 500 .65rem var(--mono); letter-spacing: .06em; }
.control-button small { margin-top: 4px; color: #86a198; font-size: .57rem; }
.control-button.stop > .icon { color: #e4bd72; border-color: rgba(228,189,114,.3); }
.control-button.emergency { color: #ffd8d4; background: rgba(191,62,53,.12); border-color: rgba(219,93,82,.35); }
.control-button.emergency > .icon { color: #ef8179; border-color: rgba(239,129,121,.35); }
.dashboard-columns { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(330px, .9fr); gap: 16px; }
.chart-legend { display: flex; align-items: center; gap: 13px; color: #667a73; font-size: .58rem; }
.chart-legend span { display: flex; align-items: center; gap: 5px; }
.chart-legend i { width: 13px; height: 2px; background: var(--green); }
.chart-legend i.residual { background: var(--amber); }
.chart-legend i.threshold { height: 1px; background: transparent; border-top: 1px dashed #9aa9a4; }
.chart-wrap { position: relative; height: 252px; padding: 20px 18px 14px; }
.alarm-list { padding: 2px 18px 7px; }
.alarm-row { display: grid; grid-template-columns: 34px 1fr auto; padding: 15px 4px; align-items: center; gap: 10px; border-bottom: 1px solid var(--line-soft); }
.alarm-row:last-child { border: 0; }
.severity-icon { display: grid; width: 30px; height: 30px; place-items: center; color: #8b6651; font: 600 .72rem var(--mono); background: #faeee6; border: 1px solid #f0dacd; border-radius: 50%; }
.severity-icon.critical { color: #aa3730; background: var(--red-soft); border-color: #f2c7c3; }
.severity-icon.watch { color: #98700b; background: var(--amber-soft); border-color: #f1dfb4; }
.alarm-copy { display: flex; min-width: 0; flex-direction: column; }
.alarm-copy b { overflow: hidden; font-size: .67rem; white-space: nowrap; text-overflow: ellipsis; }
.alarm-copy small, .alarm-time small { margin-top: 4px; color: #8b9994; font-size: .56rem; }
.alarm-time { display: flex; align-items: flex-end; flex-direction: column; font: 500 .62rem var(--mono); }

/* Engineer */
.health-score, .evidence-chip { display: flex; min-width: 315px; padding: 11px 16px; align-items: center; gap: 13px; background: white; border: 1px solid var(--line); }
.score-ring { --score: 90; display: grid; width: 49px; height: 49px; place-items: center; background: conic-gradient(var(--green) calc(var(--score)*1%), #e2ebe7 0); border-radius: 50%; }
.score-ring::before { position: absolute; width: 39px; height: 39px; content: ""; background: white; border-radius: 50%; }
.score-ring span { z-index: 1; font: 600 .8rem var(--mono); }
.score-ring small { font-size: .5rem; }
.health-score > div:last-child, .evidence-chip > div:last-child { display: flex; flex-direction: column; }
.health-score > div > span, .evidence-chip > div > span { color: #7d8e88; font-size: .58rem; }
.health-score b, .evidence-chip b { margin: 3px 0; font-size: .71rem; }
.health-score small, .evidence-chip small { color: var(--green-dark); font-size: .55rem; }
.health-card-grid { display: grid; margin-bottom: 16px; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.health-card { position: relative; min-height: 143px; padding: 16px; background: white; border: 1px solid var(--line); border-top: 2px solid var(--green); }
.health-card.watch { border-top-color: var(--amber); }
.health-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.health-card-top { display: flex; align-items: center; justify-content: space-between; }
.health-glyph { display: grid; width: 27px; height: 27px; place-items: center; color: var(--green-dark); background: var(--green-soft); font: 500 .8rem var(--mono); }
.health-card.watch .health-glyph { color: #9b6a13; background: var(--amber-soft); }
.health-card > span:nth-child(2) { display: block; margin-top: 13px; color: #758680; font-size: .62rem; }
.health-card > strong { display: block; margin-top: 3px; font: 500 1.18rem var(--mono); letter-spacing: -.04em; }
.health-card > small { color: #82918c; font-size: .56rem; }
.health-card > .icon { position: absolute; right: 14px; bottom: 14px; width: 14px; color: #a6b2ae; }
.engineer-grid { display: grid; margin-bottom: 16px; grid-template-columns: 1.15fr .85fr; gap: 16px; }
.attention-list { padding: 0 20px; }
.count-pill { padding: 4px 7px; color: #a36b0a; font: 600 .55rem var(--mono); background: var(--amber-soft); border-radius: 3px; }
.attention-item { display: grid; min-height: 78px; padding: 13px 2px; grid-template-columns: 4px 1fr auto 30px; align-items: center; gap: 12px; border-bottom: 1px solid var(--line-soft); }
.attention-item:last-child { border: 0; }
.attention-marker { width: 3px; height: 38px; background: var(--green); }
.attention-marker.warning, .attention-marker.watch { background: var(--amber); }
.attention-item > div { display: flex; flex-direction: column; }
.item-tag { color: #87958f; font: 500 .51rem var(--mono); letter-spacing: .08em; }
.attention-item b { margin-top: 3px; font-size: .68rem; }
.attention-item p { margin: 2px 0 0; color: var(--muted); font-size: .58rem; }
.attention-item > small { color: #8a9893; font-size: .55rem; }
.attention-item button { display: grid; width: 27px; height: 27px; place-items: center; color: #758780; border: 1px solid var(--line); background: white; cursor: pointer; }
.attention-item button .icon { width: 13px; }
.system-map { display: flex; padding: 29px 19px; align-items: center; justify-content: center; }
.map-node { display: flex; min-width: 70px; flex-direction: column; align-items: center; text-align: center; }
.map-node span { display: grid; width: 31px; height: 31px; place-items: center; color: var(--green-dark); font: 500 .56rem var(--mono); background: var(--green-soft); border: 1px solid #c6e1d5; border-radius: 50%; }
.map-node.active span { color: white; background: var(--green-dark); box-shadow: 0 0 0 5px var(--green-soft); }
.map-node b { margin-top: 9px; font-size: .59rem; }
.map-node small { margin-top: 2px; color: #83918c; font-size: .51rem; }
.system-map > i { width: clamp(12px, 2vw, 36px); height: 1px; margin-top: -29px; background: #b7d3c8; }
.map-foot { display: grid; margin: 0 20px 17px; padding: 12px 14px; grid-template-columns: 1fr auto; align-items: center; background: #f6f9f7; border-left: 2px solid var(--green); }
.map-foot span { display: flex; align-items: center; gap: 7px; color: #60736c; font-size: .6rem; }
.map-foot span i { width: 6px; height: 6px; background: var(--green); border-radius: 50%; }
.map-foot b { font: 500 .8rem var(--mono); }
.map-foot small { grid-column: 2; color: #8a9993; font-size: .5rem; }
.engineer-bottom { grid-template-columns: 1.35fr .65fr; }
.chart-select { display: flex; }
.chart-select button, .queue-filter button { padding: 5px 8px; color: #768781; border: 0; border-bottom: 1px solid transparent; background: transparent; cursor: pointer; font-size: .56rem; }
.chart-select button.active, .queue-filter button.active { color: var(--green-dark); border-color: var(--green); }
.engineer-chart { height: 230px; }
.timeline { margin: 0; padding: 10px 22px 18px; list-style: none; }
.timeline li { position: relative; display: grid; min-height: 62px; padding: 10px 0; grid-template-columns: 12px 1fr; gap: 11px; }
.timeline li:not(:last-child)::before { position: absolute; top: 28px; bottom: -8px; left: 4px; width: 1px; content: ""; background: #dce7e2; }
.timeline li > span { z-index: 1; width: 9px; height: 9px; margin-top: 4px; background: #96aaa3; border: 2px solid white; border-radius: 50%; box-shadow: 0 0 0 1px #b8c8c2; }
.timeline li > span.success { background: var(--green); }
.timeline li > span.warning { background: var(--amber); }
.timeline b { font-size: .65rem; }
.timeline p { margin: 2px 0; color: #60736c; font-size: .57rem; }
.timeline small { color: #8b9994; font-size: .51rem; }

/* Admin */
.shield-check { display: grid; width: 41px; height: 41px; place-items: center; color: var(--green-dark); background: var(--green-soft); border-radius: 50%; }
.shield-check .icon { width: 21px; }
.evidence-chip { min-width: 245px; }
.evidence-chip b { color: var(--green-dark); font: 600 .7rem var(--mono); letter-spacing: .05em; }
.approval-stats { display: grid; margin-bottom: 16px; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.approval-stats article { display: grid; min-height: 97px; padding: 15px; grid-template-columns: 42px 1fr auto; align-items: center; gap: 12px; background: white; border: 1px solid var(--line); }
.stat-symbol { display: grid; width: 40px; height: 40px; place-items: center; color: var(--green-dark); background: var(--green-soft); font: 500 1rem var(--mono); }
.stat-symbol.tune { color: #aa6f08; background: var(--amber-soft); }
.stat-symbol.exception { color: #6d7c77; background: #edf1ef; }
.approval-stats article > div { display: grid; grid-template-columns: auto auto; align-items: end; column-gap: 8px; }
.approval-stats article div span { grid-column: span 2; color: #697c75; font-size: .62rem; }
.approval-stats strong { font: 500 1.55rem var(--mono); }
.approval-stats small { margin-bottom: 4px; color: #8b9994; font-size: .53rem; }
.approval-stats article > i { align-self: end; color: #84928d; font-size: .51rem; font-style: normal; }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, .65fr); gap: 16px; }
.approval-list { padding: 0 20px; }
.approval-row { display: grid; min-height: 109px; padding: 15px 2px; grid-template-columns: 62px 1fr auto; align-items: center; gap: 14px; border-bottom: 1px solid var(--line-soft); transition: .18s ease; }
.approval-row:last-child { border: 0; }
.approval-row.resolved { opacity: 0; transform: translateX(10px); }
.approval-type { display: flex; align-items: center; flex-direction: column; }
.approval-type span { display: grid; width: 35px; height: 35px; place-items: center; color: var(--green-dark); font: .8rem var(--mono); background: var(--green-soft); }
.approval-type small { margin-top: 5px; color: #74867f; font-size: .5rem; text-align: center; }
.approval-main > div { display: flex; align-items: center; gap: 8px; }
.approval-main b { font-size: .72rem; }
.risk-tag { padding: 3px 5px; color: #8a6b30; background: #f6f1e7; font-size: .49rem; border-radius: 2px; }
.risk-tag.high { color: #a53d36; background: var(--red-soft); }
.approval-main p { margin: 5px 0; color: #63756f; font-size: .59rem; }
.approval-main p i { display: inline-block; width: 2px; height: 2px; margin: 0 7px; vertical-align: middle; background: #96a49f; border-radius: 50%; }
.approval-main small { color: #8c9995; font-size: .53rem; }
.approval-main small em { color: #9a6b18; font-style: normal; }
.approval-actions { display: flex; align-items: center; gap: 6px; }
.button.approve { min-height: 32px; padding: 0 11px; color: white; background: var(--green-dark); border-color: var(--green-dark); }
.button.approve .icon { width: 14px; }
.panel-foot-link { padding: 12px; text-align: center; border-top: 1px solid var(--line-soft); }
.panel-foot-link a { color: var(--green-dark); font-size: .6rem; font-weight: 700; }
.admin-side { display: flex; flex-direction: column; gap: 16px; }
.service-list { padding: 7px 19px; }
.service-list > div { display: grid; min-height: 42px; grid-template-columns: 1fr auto auto; align-items: center; gap: 9px; border-bottom: 1px solid var(--line-soft); }
.service-list > div:last-child { border: 0; }
.service-list span { display: flex; align-items: center; gap: 8px; font-size: .62rem; font-weight: 700; }
.service-list span i { width: 6px; height: 6px; background: var(--green); border-radius: 50%; box-shadow: 0 0 0 3px var(--green-soft); }
.service-list b { font: 500 .58rem var(--mono); }
.service-list small { min-width: 70px; color: var(--green-dark); font: 500 .48rem var(--mono); text-align: right; }
.version-check { display: grid; margin: 0 19px 17px; padding: 10px; grid-template-columns: 20px 1fr auto; align-items: center; gap: 7px; color: var(--green-dark); background: var(--green-soft); }
.version-check .icon { width: 15px; }
.version-check span { font-size: .57rem; }
.version-check b { font: 600 .48rem var(--mono); }
.audit-list { padding: 7px 19px 13px; }
.audit-list > div { display: grid; min-height: 53px; grid-template-columns: 38px 8px 1fr auto; align-items: center; gap: 8px; border-bottom: 1px solid var(--line-soft); }
.audit-list > div:last-child { border: 0; }
.audit-time { color: #6f817a; font: 500 .53rem var(--mono); }
.audit-list div > i { width: 6px; height: 6px; background: #93a59e; border-radius: 50%; }
.audit-list div > i.success { background: var(--green); }
.audit-list div > i.warning { background: var(--amber); }
.audit-list p { display: flex; margin: 0; flex-direction: column; color: #697b74; font-size: .53rem; }
.audit-list p b { color: var(--ink); font-size: .57rem; }
.audit-list small { color: #87958f; font-size: .49rem; }

/* Tables and detail pages */
.stat-strip { display: grid; margin-bottom: 16px; grid-template-columns: repeat(3, 1fr) .8fr; gap: 12px; }
.compact-stat { position: relative; min-height: 88px; padding: 14px 16px; overflow: hidden; background: white; border: 1px solid var(--line); }
.compact-stat > span { color: #71827c; font-size: .62rem; }
.compact-stat > strong { display: block; margin-top: 6px; font: 500 1.35rem var(--mono); }
.tone-bar { position: absolute; top: 0; right: 0; width: 3px; height: 100%; background: #9aacA5; }
.tone-bar.normal { background: var(--green); }
.tone-bar.watch { background: var(--amber); }
.tone-bar.critical { background: var(--red); }
.update-stat small { position: absolute; right: 14px; bottom: 14px; color: var(--green-dark); font: 500 .5rem var(--mono); }
.data-panel { overflow: hidden; }
.table-search { display: flex; width: 220px; height: 33px; padding: 0 9px; align-items: center; gap: 7px; color: #8a9994; border: 1px solid var(--line); background: #fbfcfb; }
.table-search .icon { width: 14px; }
.table-search input { width: 100%; color: var(--ink); border: 0; outline: 0; background: transparent; font-size: .63rem; }
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 11px 16px; color: #7d8c87; background: #f7f9f8; border-bottom: 1px solid var(--line); font: 500 .53rem var(--mono); letter-spacing: .06em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: 15px 16px; color: #5c7069; border-bottom: 1px solid var(--line-soft); font-size: .64rem; white-space: nowrap; }
.data-table td strong { color: var(--ink); font: 600 .63rem var(--mono); }
.data-table tbody tr:hover { background: #fbfdfc; }
.table-footer { display: flex; min-height: 52px; padding: 0 18px; align-items: center; justify-content: space-between; color: #7e8d88; font-size: .56rem; }
.table-footer > div { display: flex; align-items: center; gap: 5px; }
.table-footer button, .table-footer b { display: grid; width: 25px; height: 25px; place-items: center; color: #8d9b96; border: 1px solid var(--line); background: white; font-size: .58rem; }
.table-footer b { color: white; background: var(--green-dark); border-color: var(--green-dark); }
.detail-grid, .profile-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 16px; }
.detail-grid > .panel { padding-bottom: 23px; }
.detail-grid > .panel > h3, .detail-grid > .panel > p, .diagnosis-score, .recommendation, .ack-form { margin-right: 22px; margin-left: 22px; }
.diagnosis-score { display: flex; margin-top: 20px; align-items: flex-end; gap: 10px; }
.diagnosis-score strong { font: 500 2rem var(--mono); }
.diagnosis-score strong small { font-size: .7rem; }
.diagnosis-score span { margin-bottom: 5px; color: var(--muted); font-size: .62rem; }
.detail-grid h3 { margin-top: 20px; font-size: 1rem; }
.detail-grid p { color: var(--muted); font-size: .68rem; line-height: 1.7; }
.recommendation { margin-top: 20px; padding: 15px 17px; background: var(--green-soft); border-left: 3px solid var(--green); }
.recommendation b { font-size: .68rem; }
.recommendation ol { margin: 8px 0 0; padding-left: 18px; color: #4f665e; font-size: .63rem; line-height: 1.9; }
.ack-form { margin-top: 21px; }
.ack-form label, .scenario-form label { display: flex; flex-direction: column; gap: 7px; color: #5f716b; font-size: .64rem; font-weight: 700; }
.ack-form textarea, .scenario-form input, .scenario-form select { width: 100%; padding: 11px 12px; color: var(--ink); border: 1px solid var(--line); outline: 0; background: #fbfcfb; resize: vertical; font-size: .68rem; }
.ack-form textarea:focus, .scenario-form input:focus, .scenario-form select:focus { border-color: #70aa96; box-shadow: 0 0 0 3px var(--green-soft); }
.ack-form .button { width: 100%; margin-top: 12px; }
.large-status { padding: 7px 10px; font: 600 .58rem var(--mono); }
.large-status.critical { color: #a43b34; background: var(--red-soft); border: 1px solid #efc8c4; }
.profile-card, .permission-card { padding: 26px; }
.profile-card { text-align: center; }
.large-avatar { display: grid; width: 72px; height: 72px; margin: 0 auto 15px; place-items: center; color: #12392d; background: #dbecc9; font-size: 1.35rem; font-weight: 800; }
.profile-card h2 { margin: 0; }
.profile-card > p { color: var(--muted); font-size: .7rem; }
.profile-card dl { margin-top: 25px; text-align: left; }
.profile-card dl div { display: flex; padding: 12px 0; justify-content: space-between; border-top: 1px solid var(--line-soft); font-size: .65rem; }
.profile-card dt { color: var(--muted); }
.permission-card h2 { margin-top: 5px; }
.permission-list { display: flex; margin-top: 20px; flex-wrap: wrap; gap: 7px; }
.permission-list code { padding: 6px 8px; color: var(--green-dark); background: var(--green-soft); font: .58rem var(--mono); }
.scenario-form { overflow: hidden; }
.form-section { display: grid; padding: 28px; grid-template-columns: 42px 220px 1fr; gap: 20px; border-bottom: 1px solid var(--line); }
.step-index { color: var(--green-dark); font: 500 .65rem var(--mono); }
.form-section h2 { margin: 0 0 5px; font-size: .9rem; }
.form-section p { margin: 0; color: var(--muted); font-size: .61rem; line-height: 1.6; }
.form-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-fields.full { grid-template-columns: 1fr 1fr; }
.radio-card { padding: 14px; flex-direction: row !important; align-items: flex-start; background: #f8faf9; border: 1px solid var(--line); }
.radio-card span { display: flex; flex-direction: column; }
.radio-card small { margin-top: 3px; color: var(--muted); font-weight: 400; }
.form-submit { display: flex; padding: 18px 28px; align-items: center; justify-content: flex-end; gap: 8px; background: #f8faf9; }
.form-submit > span { margin-right: auto; color: var(--muted); font-size: .61rem; }
.form-submit > span b { color: #a16d10; font: 600 .56rem var(--mono); }

/* Modal and toasts */
.modal-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(6,22,18,.63); backdrop-filter: blur(3px); }
.command-modal { position: fixed; top: 50%; left: 50%; z-index: 100; width: min(520px, calc(100vw - 32px)); padding: 27px; transform: translate(-50%, -50%); background: white; box-shadow: 0 25px 80px rgba(5,25,18,.25); border-top: 4px solid var(--green); }
.command-modal.danger { border-top-color: var(--red); }
.modal-close { position: absolute; top: 12px; right: 13px; width: 28px; height: 28px; color: #7a8a84; border: 0; background: transparent; cursor: pointer; font-size: 1.4rem; }
.modal-icon { display: grid; width: 42px; height: 42px; margin-bottom: 16px; place-items: center; color: var(--green-dark); background: var(--green-soft); }
.command-modal.danger .modal-icon { color: var(--red); background: var(--red-soft); }
.modal-icon .icon { width: 22px; }
.command-modal h2 { margin: 6px 0 5px; font-size: 1.25rem; }
.command-modal > p { margin: 0; color: var(--muted); font-size: .66rem; line-height: 1.6; }
.command-summary { display: grid; margin: 18px 0; grid-template-columns: 1fr 1fr; background: #f5f8f6; border: 1px solid var(--line-soft); }
.command-summary div { display: flex; min-height: 55px; padding: 10px 13px; flex-direction: column; justify-content: center; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.command-summary div:nth-child(even) { border-right: 0; }
.command-summary div:nth-last-child(-n+2) { border-bottom: 0; }
.command-summary span { color: #87958f; font-size: .54rem; }
.command-summary b { margin-top: 3px; font: 500 .65rem var(--mono); }
.reason-field { display: flex; flex-direction: column; gap: 6px; color: #556a62; font-size: .63rem; font-weight: 700; }
.reason-field em { color: var(--red); font-size: .53rem; font-style: normal; }
.reason-field textarea { padding: 10px 11px; color: var(--ink); border: 1px solid var(--line); outline: 0; background: #fbfcfb; resize: none; font-size: .66rem; }
.reason-field textarea:focus { border-color: #75a998; box-shadow: 0 0 0 3px var(--green-soft); }
.field-error { margin-top: 4px !important; color: var(--red) !important; }
.safety-note { display: flex; margin-top: 13px; padding: 9px 10px; align-items: flex-start; gap: 8px; color: #657972; background: #f6f8f7; font-size: .55rem; line-height: 1.5; }
.safety-note .icon { width: 14px; min-width: 14px; color: var(--green-dark); }
.modal-actions { display: flex; margin-top: 18px; justify-content: flex-end; gap: 8px; }
.toast-stack { position: fixed; right: 22px; bottom: 22px; z-index: 120; display: flex; width: min(370px, calc(100vw - 32px)); flex-direction: column; gap: 8px; }
.toast { display: grid; padding: 14px; grid-template-columns: 32px 1fr auto; align-items: center; gap: 10px; color: white; background: var(--navy); box-shadow: 0 12px 35px rgba(8,32,24,.2); animation: toast-in .2s ease-out; border-left: 3px solid var(--lime); }
.toast.warning { border-color: var(--amber); }
.toast.error { border-color: var(--red); }
.toast-icon { display: grid; width: 29px; height: 29px; place-items: center; color: var(--navy); background: var(--lime); border-radius: 50%; font-size: .65rem; font-weight: 800; }
.toast > div { display: flex; flex-direction: column; }
.toast b { font-size: .66rem; }
.toast small { margin-top: 3px; color: #91aaa2; font-size: .54rem; }
.toast code { color: #cce6dc; font: .53rem var(--mono); }
.toast button { color: #9eb2ab; border: 0; background: transparent; cursor: pointer; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* Login */
.login-body { min-height: 100vh; background: #edf2ef; }
.login-shell { display: grid; min-height: 100vh; grid-template-columns: minmax(480px, 1.08fr) minmax(430px, .92fr); }
.login-visual { position: relative; display: flex; padding: 45px clamp(40px, 6vw, 90px); flex-direction: column; overflow: hidden; color: white; background: #102a23; }
.login-visual::before { position: absolute; inset: 0; content: ""; opacity: .32; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 48px 48px; mask-image: linear-gradient(to bottom, black, transparent 80%); }
.login-visual::after { position: absolute; top: 50%; right: -160px; width: 440px; height: 440px; content: ""; border: 1px solid rgba(184,219,116,.12); border-radius: 50%; box-shadow: 0 0 0 80px rgba(184,219,116,.025), 0 0 0 160px rgba(184,219,116,.016); }
.login-brand { z-index: 1; }
.visual-copy { z-index: 1; max-width: 600px; margin-top: auto; margin-bottom: 42px; }
.visual-copy h1 { margin: 15px 0 20px; font-size: clamp(3rem, 5.1vw, 5.6rem); line-height: .98; letter-spacing: -.065em; }
.visual-copy h1 em { color: var(--lime); font-style: normal; }
.visual-copy p { max-width: 490px; margin: 0; color: #9ab4aa; font-size: .85rem; line-height: 1.85; }
.signal-visual { position: relative; z-index: 1; height: 190px; margin: 0 -20px 30px; border-top: 1px solid rgba(255,255,255,.07); border-bottom: 1px solid rgba(255,255,255,.07); }
.signal-visual svg { position: absolute; inset: 20px 0; width: 100%; height: 150px; overflow: visible; }
.signal-visual path { fill: none; stroke: var(--lime); stroke-width: 1.5; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 6px rgba(184,219,116,.25)); }
.servo-core { position: absolute; top: 50%; left: 52%; z-index: 2; display: grid; width: 72px; height: 72px; place-items: center; transform: translate(-50%,-50%); color: #0c2921; background: var(--lime); border: 8px solid #1a3d33; border-radius: 50%; box-shadow: 0 0 0 1px rgba(184,219,116,.5), 0 0 40px rgba(184,219,116,.18); }
.servo-core b { font: 600 .52rem/1.15 var(--mono); text-align: center; }
.servo-core i { position: absolute; inset: -20px; border: 1px dashed rgba(184,219,116,.28); border-radius: 50%; }
.orbit { position: absolute; top: 50%; left: 52%; z-index: 1; width: 170px; height: 170px; transform: translate(-50%,-50%); border: 1px solid rgba(184,219,116,.12); border-radius: 50%; }
.orbit-two { width: 260px; height: 260px; }
.orbit span { position: absolute; top: 18px; left: 20px; width: 5px; height: 5px; background: var(--lime); border-radius: 50%; }
.orbit-two span { top: auto; right: 20px; bottom: 48px; left: auto; }
.visual-meta { z-index: 1; display: flex; padding-top: 18px; justify-content: space-between; color: #718f85; border-top: 1px solid rgba(255,255,255,.08); font: 500 .55rem var(--mono); letter-spacing: .06em; }
.visual-meta span { display: flex; align-items: center; gap: 7px; }
.visual-meta i { width: 6px; height: 6px; background: var(--green); border-radius: 50%; }
.login-panel { display: grid; padding: 40px; place-items: center; background: #f8faf9; }
.login-form { width: min(410px, 100%); }
.login-form h2 { margin: 9px 0 8px; font-size: 2rem; letter-spacing: -.045em; }
.form-lead { margin: 0 0 26px; color: var(--muted); font-size: .75rem; line-height: 1.7; }
.login-form > label { display: flex; margin-bottom: 16px; flex-direction: column; gap: 7px; color: #4c625b; font-size: .65rem; font-weight: 700; }
.login-form > label input { height: 47px; padding: 0 13px; color: var(--ink); border: 1px solid #ced9d5; outline: 0; background: white; border-radius: 3px; font-size: .72rem; }
.login-form > label input:focus { border-color: #70a894; box-shadow: 0 0 0 3px #e6f3ed; }
.form-options { display: flex; margin: 1px 0 22px; align-items: center; justify-content: space-between; color: #71817c; font-size: .62rem; }
.check-label { display: flex; align-items: center; gap: 6px; }
.form-options a { color: var(--green-dark); font-weight: 700; }
.login-submit { display: flex; width: 100%; height: 48px; padding: 0 18px; align-items: center; justify-content: space-between; color: white; border: 0; background: var(--green-dark); border-radius: 3px; cursor: pointer; font-size: .73rem; font-weight: 700; }
.login-submit:hover { background: #075e42; }
.login-submit span { font-size: 1.1rem; }
.demo-accounts { margin-top: 25px; padding: 14px; background: #eef3f0; border: 1px solid #e0e7e3; }
.demo-accounts > div:first-child { display: flex; align-items: center; justify-content: space-between; }
.demo-accounts > div > span { font-size: .61rem; font-weight: 700; }
.demo-accounts small { color: #7c8b86; font-size: .55rem; }
.demo-accounts code { color: var(--green-dark); font-family: var(--mono); }
.account-chips { display: grid; margin-top: 10px; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.account-chips button { height: 31px; color: #536a62; border: 1px solid #d1ddd8; background: white; cursor: pointer; font-size: .58rem; font-weight: 700; }
.account-chips button:hover { color: var(--green-dark); border-color: #7fb09e; }
.security-caption { margin-top: 18px; color: #8a9994; font-size: .55rem; text-align: center; }
.security-caption span { color: var(--green); }
.login-alert { margin-bottom: 16px; padding: 10px 12px; color: #9b3731; background: var(--red-soft); border-left: 3px solid var(--red); font-size: .62rem; }
.mobile-login-brand { display: none; }
.public-error, .error-state { display: flex; min-height: 100vh; padding: 30px; align-items: center; justify-content: center; flex-direction: column; text-align: center; }
.public-error > span, .error-state > span { color: #bfd4cc; font: 500 clamp(5rem, 15vw, 10rem)/1 var(--mono); }
.public-error h1, .error-state h1 { margin: 0; font-size: 1.8rem; }
.public-error p, .error-state p { color: var(--muted); }
.public-error a { padding: 11px 18px; color: white; background: var(--green-dark); }
.error-state { min-height: 65vh; }
.error-state small { margin-top: 25px; color: #9aa7a2; font: .55rem var(--mono); }

@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 218px minmax(0,1fr); }
  .sidebar { width: 218px; }
  .hero-status-meta > div { min-width: 105px; padding: 2px 15px; }
  .control-strip { grid-template-columns: 170px 1fr; }
  .health-card-grid { grid-template-columns: repeat(3, 1fr); }
  .approval-stats { grid-template-columns: repeat(2, 1fr); }
  .admin-grid { grid-template-columns: 1fr; }
  .admin-side { display: grid; grid-template-columns: 1fr 1fr; }
  .approval-row { grid-template-columns: 52px 1fr auto; }
}

@media (max-width: 900px) {
  .app-shell { display: block; }
  .sidebar { width: 248px; transform: translateX(-100%); box-shadow: 20px 0 50px rgba(4,24,18,.2); transition: transform .2s ease; }
  .sidebar.open { transform: translateX(0); }
  .main-frame { min-height: 100vh; }
  .mobile-menu { display: grid; }
  .topbar { padding: 0 18px; }
  .content { padding: 25px 20px 35px; }
  .footer { padding: 0 20px; }
  .operator-metrics { grid-template-columns: 1fr 1fr; }
  .operator-metrics .metric-card:last-child { grid-column: span 2; }
  .control-strip { grid-template-columns: 1fr; }
  .control-copy { display: none; }
  .dashboard-columns, .engineer-grid, .engineer-bottom, .detail-grid, .profile-grid { grid-template-columns: 1fr; }
  .hero-status { grid-template-columns: 55px 1fr; }
  .hero-status-meta { grid-column: span 2; justify-content: stretch; }
  .hero-status-meta > div { flex: 1; }
  .login-shell { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-panel { min-height: 100vh; }
  .mobile-login-brand { display: flex; margin-bottom: 45px; align-items: center; gap: 9px; color: var(--ink); }
  .brand-mark.dark span { background: var(--green-dark); }
  .form-section { grid-template-columns: 35px 1fr; }
  .form-fields { grid-column: 2; }
}

@media (max-width: 640px) {
  html { font-size: 14px; }
  .hide-mobile { display: none; }
  .topbar-context .context-item { min-width: 0; padding-right: 10px; }
  .connection-pill small { display: none; }
  .page-heading { align-items: stretch; flex-direction: column; }
  .heading-actions { width: 100%; }
  .heading-actions .button { flex: 1; }
  .hero-status { padding: 18px; }
  .hero-status-meta > div { min-width: 0; padding: 2px 9px; }
  .hero-status-meta > div:first-child { display: none; }
  .operator-metrics, .health-card-grid, .approval-stats, .stat-strip { grid-template-columns: 1fr; }
  .operator-metrics .metric-card:last-child { grid-column: auto; }
  .control-buttons { grid-template-columns: 1fr; }
  .dashboard-columns { grid-template-columns: 1fr; }
  .admin-side { grid-template-columns: 1fr; }
  .approval-row { grid-template-columns: 42px 1fr; padding: 15px 0; }
  .approval-actions { grid-column: 2; }
  .table-search { display: none; }
  .footer span:nth-child(2), .footer span:nth-child(3) { display: none; }
  .health-score, .evidence-chip { min-width: 0; }
  .form-fields, .form-fields.full { grid-template-columns: 1fr; }
  .form-submit { align-items: stretch; flex-direction: column; }
  .form-submit > span { margin: 0 0 8px; }
  .login-panel { padding: 28px 22px; }
  .mobile-login-brand { margin-bottom: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Operator feature monitor · appended without changing the existing dashboard grid */
.operator-feature-monitor { margin-top: 16px; }
.feature-monitor-header {
  display: flex;
  min-height: 84px;
  padding: 17px 20px;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  border-bottom: 1px solid var(--line-soft);
}
.feature-monitor-header h2 { margin: 5px 0 4px; font-size: 1rem; letter-spacing: -.02em; }
.feature-monitor-header p { margin: 0; color: var(--muted); font-size: .6rem; }
.feature-monitor-summary { display: flex; align-items: center; gap: 13px; color: #71817c; font: .5rem var(--mono); }
.feature-monitor-summary > span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.feature-monitor-summary i { width: 6px; height: 6px; background: var(--green); border-radius: 50%; }
.feature-monitor-summary i.watch { background: var(--amber); }
.feature-monitor-summary i.warning { background: var(--orange); }
.feature-monitor-summary b { color: var(--ink-2); font-size: .62rem; }
.feature-stream-state { min-height: 31px; padding: 0 9px; border: 1px solid #c9dfd6; background: #edf8f3; }
.feature-stream-state > i { background: var(--green) !important; box-shadow: 0 0 0 4px rgba(23,154,107,.1); }
.feature-stream-state small { color: #779088; font-size: .47rem; }
.feature-stream-state.stale { color: #71817c; background: #f0f3f1; border-color: #d2d9d6; }
.feature-stream-state.stale > i { background: #87948f !important; box-shadow: none; }

.feature-monitor-tabs { display: flex; min-height: 40px; padding: 0 12px; align-items: flex-end; gap: 2px; border-bottom: 1px solid var(--line-soft); }
.feature-monitor-tabs button { height: 39px; padding: 0 11px; color: #768781; background: transparent; border: 0; border-bottom: 2px solid transparent; cursor: pointer; font-size: .57rem; }
.feature-monitor-tabs button b { margin-left: 4px; color: #9aa7a2; font: 500 .5rem var(--mono); }
.feature-monitor-tabs button:hover { color: var(--ink); }
.feature-monitor-tabs button.active { color: var(--green-dark); border-bottom-color: var(--green); }
.feature-monitor-tabs button.active b { color: #4c8f76; }

.feature-monitor-grid { display: grid; padding: 10px; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 8px; background: #f6f8f7; }
.feature-monitor-card {
  --feature-tone: var(--green);
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 180px;
  padding: 12px 13px 9px;
  flex-direction: column;
  overflow: hidden;
  background: white;
  border: 1px solid var(--line);
  border-top: 3px solid var(--feature-tone);
  box-shadow: 0 1px 0 rgba(15,45,36,.02);
}
.feature-monitor-card.watch { --feature-tone: var(--amber); }
.feature-monitor-card.warning { --feature-tone: var(--orange); }
.feature-monitor-card.critical { --feature-tone: var(--red); }
.feature-monitor-card.stale { --feature-tone: #87948f; filter: saturate(.35); }
.feature-monitor-card[hidden] { display: none; }
.feature-monitor-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.feature-monitor-card-head > span { display: flex; min-width: 0; flex-direction: column; }
.feature-monitor-card-head b { color: #334a43; font: 500 .58rem var(--mono); letter-spacing: .03em; }
.feature-monitor-card-head small { overflow: hidden; margin-top: 3px; color: #75857f; font-size: .53rem; white-space: nowrap; text-overflow: ellipsis; }
.feature-monitor-card-head em { padding: 3px 5px; color: var(--feature-tone); background: color-mix(in srgb, var(--feature-tone) 7%, white); border: 1px solid color-mix(in srgb, var(--feature-tone) 28%, white); font: 600 .44rem var(--mono); font-style: normal; letter-spacing: .04em; }
.feature-monitor-reading { display: flex; margin-top: 9px; align-items: baseline; gap: 7px; }
.feature-monitor-reading strong { color: var(--ink); font: 500 1.55rem/1 var(--mono); letter-spacing: -.055em; }
.feature-monitor-reading small { color: #687b75; font: .55rem var(--mono); }
.feature-monitor-reference { display: flex; margin-top: 8px; align-items: center; gap: 13px; color: #7b8b86; font: .47rem var(--mono); }
.feature-monitor-reference b { margin-left: 3px; color: #536a63; font-weight: 500; }
.feature-monitor-spark { width: 100%; height: 50px; margin-top: 3px; }
.feature-monitor-quality { display: flex; margin-top: auto; align-items: center; gap: 5px; color: #75857f; font: .45rem var(--mono); }
.feature-monitor-quality i { width: 5px; height: 5px; background: var(--feature-tone); border-radius: 50%; }
.feature-monitor-quality time { margin-left: auto; }

@media (min-width: 1600px) {
  .feature-monitor-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .feature-monitor-header { align-items: flex-start; flex-direction: column; }
  .feature-monitor-summary { width: 100%; flex-wrap: wrap; }
  .feature-monitor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .feature-monitor-header { padding: 15px; }
  .feature-monitor-tabs { overflow-x: auto; align-items: stretch; }
  .feature-monitor-tabs button { min-width: max-content; }
  .feature-monitor-grid { grid-template-columns: 1fr; }
  .feature-stream-state { width: 100%; }
}

/* Feature monitor right-side detail pane; scoped to the appended monitor only */
.feature-monitor-card {
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.feature-monitor-card:hover { background: #f5f9f7; border-color: #a9bdb5; }
.feature-monitor-card.selected { background: #edf8f3; border-color: var(--green); box-shadow: inset 0 0 0 1px rgba(23,154,107,.1); }
.feature-monitor-card:focus-visible { outline: 2px solid var(--green-dark); outline-offset: 2px; }
.feature-monitor-explorer { min-width: 0; }
.feature-monitor-overview { min-width: 0; }
.feature-monitor-explorer.detail-open {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(420px, .75fr);
  align-items: start;
}
.feature-monitor-explorer.detail-open .feature-monitor-overview { border-right: 1px solid var(--line); }
.feature-monitor-explorer.detail-open .feature-monitor-grid { grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); }
.feature-monitor-explorer.detail-open .feature-monitor-card { min-height: 174px; }

.feature-monitor-detail {
  position: sticky;
  top: 76px;
  z-index: 8;
  max-height: calc(100vh - 92px);
  padding: 9px;
  overflow-x: hidden;
  overflow-y: auto;
  background: #eef3f0;
  border-left: 1px solid white;
  box-shadow: -12px 0 28px rgba(20,43,38,.08);
  overscroll-behavior: contain;
}
.feature-monitor-detail[hidden] { display: none; }
.feature-monitor-detail-toolbar {
  display: grid;
  min-height: 42px;
  padding-bottom: 9px;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid var(--line);
}
.feature-monitor-detail-toolbar button { min-height: 29px; padding: 0 8px; color: #536a63; background: white; border: 1px solid var(--line); cursor: pointer; font-size: .51rem; font-weight: 700; }
.feature-monitor-detail-toolbar button:hover { color: var(--green-dark); border-color: #93afa3; }
.feature-monitor-detail-toolbar > div { display: flex; min-width: 0; align-items: center; gap: 6px; color: #84938e; font: .48rem var(--mono); }
.feature-monitor-detail-toolbar > div strong { overflow: hidden; color: var(--ink); font-weight: 500; white-space: nowrap; text-overflow: ellipsis; }
.feature-monitor-detail-toolbar > div b { color: #bdc9c4; }
.feature-monitor-detail-toolbar nav { display: flex; gap: 4px; }
.feature-monitor-detail-toolbar nav button { min-width: 29px; padding: 0; }

.feature-monitor-detail-hero {
  display: grid;
  min-height: 116px;
  margin-top: 9px;
  padding: 14px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  background: white;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
}
.feature-monitor-detail-hero h3 { margin: 5px 0 4px; color: var(--ink); font-size: 1.05rem; letter-spacing: -.025em; }
.feature-monitor-detail-hero p { margin: 0; color: #7b8b86; font: .48rem var(--mono); }
.feature-monitor-detail-value { display: flex; align-items: baseline; gap: 6px; text-align: right; }
.feature-monitor-detail-value strong { color: var(--ink); font: 500 1.9rem/1 var(--mono); letter-spacing: -.06em; }
.feature-monitor-detail-value small { color: #71817c; font: .54rem var(--mono); }
.feature-monitor-detail-state { grid-column: span 2; display: flex; padding-top: 11px; align-items: center; justify-content: space-between; border-top: 1px solid var(--line-soft); }
.feature-monitor-detail-state > span { display: inline-flex; padding: 4px 7px; align-items: center; gap: 5px; color: var(--green-dark); background: var(--green-soft); border: 1px solid #c5dfd4; font: 600 .46rem var(--mono); }
.feature-monitor-detail-state > span i { width: 6px; height: 6px; background: currentColor; border-radius: 50%; }
.feature-monitor-detail-state > span.watch { color: #9a670c; background: var(--amber-soft); border-color: #ead29b; }
.feature-monitor-detail-state > span.warning { color: #b4511d; background: #fff1e8; border-color: #edc2aa; }
.feature-monitor-detail-state > span.critical { color: #a93630; background: var(--red-soft); border-color: #e8b4b0; }
.feature-monitor-detail-state > span.stale { color: #6f7f7a; background: #eef2f0; border-color: #d4dcda; }
.feature-monitor-detail-state > b { color: var(--ink); font: 500 .9rem var(--mono); }

.feature-monitor-detail-chart-panel,
.feature-monitor-detail-stats,
.feature-monitor-detail-meta,
.feature-monitor-related { margin-top: 9px; background: white; border: 1px solid var(--line); }
.feature-monitor-detail-chart-panel > header { display: flex; min-height: 52px; padding: 9px 12px; align-items: center; justify-content: space-between; gap: 9px; border-bottom: 1px solid var(--line-soft); }
.feature-monitor-detail-chart-panel > header > div:first-child { display: flex; flex-direction: column; }
.feature-monitor-detail-chart-panel > header span,
.feature-monitor-related > header span { color: #71817c; font: 500 .47rem var(--mono); letter-spacing: .08em; }
.feature-monitor-detail-chart-panel > header b,
.feature-monitor-related > header b { margin-top: 3px; color: #526760; font-size: .51rem; }
.feature-monitor-detail-chart-panel > header > div:last-child { display: flex; border: 1px solid var(--line); }
.feature-monitor-detail-chart-panel > header button { height: 27px; padding: 0 8px; color: #768781; background: white; border: 0; border-right: 1px solid var(--line); font: .48rem var(--mono); }
.feature-monitor-detail-chart-panel > header button:last-child { border-right: 0; }
.feature-monitor-detail-chart-panel > header button.active { color: white; background: var(--green-dark); }
.feature-monitor-detail-chart-panel > header button:disabled { opacity: .38; }
.feature-monitor-detail-chart { height: 255px; }

.feature-monitor-detail-stats { display: grid; padding: 7px; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.feature-monitor-detail-stats > div { min-width: 0; min-height: 62px; padding: 8px; background: #f8faf9; border: 1px solid #e5ebe8; }
.feature-monitor-detail-stats span { display: block; color: #7c8b86; font-size: .46rem; }
.feature-monitor-detail-stats strong { display: inline-block; overflow: hidden; max-width: 100%; margin-top: 7px; color: var(--ink); font: 500 .76rem var(--mono); text-overflow: ellipsis; }
.feature-monitor-detail-stats small { margin-left: 3px; color: #87948f; font: .4rem var(--mono); }
.feature-monitor-detail-meta { padding: 7px 12px; }
.feature-monitor-detail-meta > div { display: flex; min-height: 29px; align-items: center; justify-content: space-between; gap: 9px; border-bottom: 1px solid var(--line-soft); }
.feature-monitor-detail-meta > div:last-child { border-bottom: 0; }
.feature-monitor-detail-meta span { color: #75857f; font-size: .48rem; }
.feature-monitor-detail-meta b { color: #445a53; font: 500 .46rem var(--mono); text-align: right; }
.feature-monitor-detail-meta b.normal { color: var(--green-dark); }
.feature-monitor-related > header { display: flex; min-height: 49px; padding: 9px 12px; flex-direction: column; justify-content: center; border-bottom: 1px solid var(--line-soft); }
.feature-monitor-related > div { display: grid; padding: 7px; grid-template-columns: 1fr 1fr; gap: 6px; }
.feature-monitor-related-button {
  --related-tone: var(--green);
  display: grid;
  min-width: 0;
  min-height: 61px;
  padding: 7px 8px;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 5px;
  color: var(--ink);
  background: #f8faf9;
  border: 1px solid #e0e7e3;
  border-top: 2px solid var(--related-tone);
  cursor: pointer;
  text-align: left;
}
.feature-monitor-related-button.watch { --related-tone: var(--amber); }
.feature-monitor-related-button.warning { --related-tone: var(--orange); }
.feature-monitor-related-button.critical { --related-tone: var(--red); }
.feature-monitor-related-button:hover { background: #eef6f2; border-color: #abc1b7; }
.feature-monitor-related-button > span { display: flex; min-width: 0; flex-direction: column; }
.feature-monitor-related-button b { color: #354b44; font: 500 .48rem var(--mono); }
.feature-monitor-related-button small { overflow: hidden; margin-top: 3px; color: #81908b; font-size: .42rem; white-space: nowrap; text-overflow: ellipsis; }
.feature-monitor-related-button > strong { font: 500 .7rem var(--mono); }
.feature-monitor-related-button > em { grid-column: 2; color: #81908b; font: .39rem var(--mono); font-style: normal; text-align: right; }

@media (max-width: 1180px) {
  .feature-monitor-explorer.detail-open { grid-template-columns: minmax(0, 1fr) minmax(380px, .82fr); }
  .feature-monitor-explorer.detail-open .feature-monitor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .feature-monitor-explorer.detail-open { display: block; }
  .feature-monitor-explorer.detail-open .feature-monitor-overview { border-right: 0; }
  .feature-monitor-detail { position: relative; top: auto; max-height: none; border-top: 1px solid var(--line); border-left: 0; box-shadow: 0 -10px 28px rgba(20,43,38,.06); }
  .feature-monitor-explorer.detail-open .feature-monitor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature-monitor-detail-stats { grid-template-columns: repeat(3, 1fr); }
  .feature-monitor-related > div { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 640px) {
  .feature-monitor-explorer.detail-open .feature-monitor-grid { grid-template-columns: 1fr; }
  .feature-monitor-detail-hero { grid-template-columns: 1fr; }
  .feature-monitor-detail-value { justify-self: start; text-align: left; }
  .feature-monitor-detail-state { grid-column: auto; }
  .feature-monitor-detail-chart-panel > header { align-items: flex-start; flex-direction: column; }
  .feature-monitor-detail-chart { height: 235px; }
  .feature-monitor-detail-stats { grid-template-columns: repeat(2, 1fr); }
  .feature-monitor-related > div { grid-template-columns: 1fr 1fr; }
}
