:root {
  --bg: #f3f5f4;
  --panel: #ffffff;
  --panel-soft: #f8faf9;
  --ink: #18211f;
  --muted: #69736f;
  --line: #dfe5e2;
  --line-strong: #cbd4d0;
  --sidebar: #121b19;
  --sidebar-2: #1b2623;
  --green: #117a5b;
  --green-soft: #e7f3ef;
  --blue: #286c9c;
  --blue-soft: #eaf2f8;
  --orange: #c15f2d;
  --orange-soft: #fff0e8;
  --red: #b93b42;
  --red-soft: #fbeaec;
  --yellow: #9a6a0a;
  --yellow-soft: #fff6dd;
  --shadow: 0 8px 24px rgba(20, 36, 31, 0.08);
  --sidebar-width: 232px;
  --radius: 6px;
  font-family: "Microsoft YaHei UI", "PingFang SC", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}

.notification-list { display: grid; gap: 8px; }
.notification-item { width: 100%; min-height: 72px; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto 20px; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); background: #fff; color: var(--ink); text-align: left; cursor: pointer; border-radius: 6px; }
.notification-item:hover { border-color: #9fb2c2; background: #f8fafb; }
.notification-item.unread { border-left: 3px solid var(--accent); background: #f6fbfa; }
.notification-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.notification-item > span:nth-child(2) { min-width: 0; display: grid; gap: 4px; }
.notification-item strong, .notification-item small { overflow-wrap: anywhere; }
.notification-item small, .notification-item time { color: var(--muted); font-size: 12px; }
.empty-state > strong, .empty-state > span { display: block; margin-top: 8px; }

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); }
body { min-width: 320px; overflow-x: hidden; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, [role="button"] { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(40, 108, 156, .2); outline-offset: 1px; }
svg { width: 18px; height: 18px; stroke-width: 1.8; flex: 0 0 auto; }
[hidden] { display: none !important; }

.login-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(330px, .8fr) minmax(480px, 1.2fr); background: #fff; }
.login-context { position: relative; min-height: 100vh; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; padding: 42px 48px 38px; color: #dfe7e4; background: var(--sidebar); }
.login-context::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .12; background-image: linear-gradient(#86a49a 1px, transparent 1px), linear-gradient(90deg, #86a49a 1px, transparent 1px); background-size: 48px 48px; }
.login-context::after { content: ""; position: absolute; left: 48px; right: 48px; bottom: 104px; height: 1px; background: rgba(255,255,255,.12); }
.login-brand, .login-context-copy, .login-system-state { position: relative; z-index: 1; }
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-brand > div:last-child { display: flex; flex-direction: column; }
.login-brand strong { color: #fff; font-size: 18px; }
.login-brand small { margin-top: 4px; color: #91a49e; font-size: 10px; }
.login-context-copy { max-width: 430px; margin-bottom: 24px; }
.login-kicker { display: block; margin-bottom: 18px; color: #55c9a1; font-size: 10px; font-weight: 700; }
.login-context-copy h1 { margin: 0; color: #fff; font-size: 34px; line-height: 1.25; letter-spacing: 0; }
.login-context-copy p { margin: 14px 0 0; color: #9fb0ab; font-size: 14px; }
.login-system-state { display: grid; grid-template-columns: 9px auto 1fr; gap: 10px; align-items: center; padding-top: 26px; font-size: 10px; }
.login-system-state .pulse { width: 8px; height: 8px; border-radius: 50%; background: #4fc49b; box-shadow: 0 0 0 4px rgba(79,196,155,.12); }
.login-system-state small { justify-self: end; color: #71857e; }
.login-form-area { min-height: 100vh; display: grid; place-items: center; padding: 48px; background: #fff; }
.login-form { width: min(100%, 380px); }
.login-form-head { display: flex; align-items: center; gap: 13px; margin-bottom: 30px; }
.login-icon { width: 42px; height: 42px; display: grid; place-items: center; color: var(--green); background: var(--green-soft); border: 1px solid #cfe4dc; border-radius: 6px; }
.login-icon svg { width: 21px; height: 21px; }
.login-form-head h2 { margin: 0; font-size: 20px; letter-spacing: 0; }
.login-form-head p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.login-alert { margin-bottom: 17px; padding: 10px 12px; color: var(--red); background: var(--red-soft); border: 1px solid #efc8cc; border-radius: 5px; font-size: 10px; line-height: 1.55; }
.login-field { display: block; margin-top: 17px; }
.login-field > span { display: block; margin-bottom: 7px; color: #3c4844; font-size: 10px; font-weight: 600; }
.login-field > div { height: 43px; display: flex; align-items: center; gap: 9px; padding: 0 12px; background: #fff; border: 1px solid var(--line-strong); border-radius: 5px; }
.login-field > div:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(17,122,91,.1); }
.login-field svg { width: 16px; color: #86918d; }
.login-field input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; font-size: 12px; }
.password-toggle { width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 0; color: var(--muted); background: transparent; }
.password-toggle:hover { color: var(--ink); }
.login-captcha-row { display: grid; grid-template-columns: minmax(0, 1fr) 156px; align-items: end; gap: 10px; }
.login-captcha-row .login-field { min-width: 0; }
.captcha-image-button { width: 156px; height: 43px; display: grid; grid-template-columns: 124px 30px; align-items: center; overflow: hidden; padding: 0; color: #52636a; background: #f4f7f6; border: 1px solid var(--line-strong); border-radius: 5px; }
.captcha-image-button:hover { background: #fff; border-color: var(--green); }
.captcha-image-button:disabled { cursor: wait; opacity: .72; }
.captcha-image-button img { width: 124px; height: 43px; display: block; object-fit: cover; }
.captcha-image-button > span { width: 124px; font-size: 10px; }
.captcha-refresh-icon { width: 16px; height: 16px; justify-self: center; color: #31525a; }
.remember-login { width: fit-content; display: flex; align-items: center; gap: 7px; margin: 16px 0 20px; color: var(--muted); font-size: 10px; }
.remember-login input { width: 14px; height: 14px; accent-color: var(--green); }
.login-submit { width: 100%; height: 43px; display: flex; align-items: center; justify-content: center; gap: 9px; color: #fff; background: var(--green); border: 1px solid var(--green); border-radius: 5px; font-size: 12px; font-weight: 700; }
.login-submit:hover { background: #0c684c; }
.login-submit:disabled { cursor: wait; opacity: .65; }
.login-submit svg { width: 16px; }
.login-foot { display: flex; justify-content: center; align-items: center; gap: 7px; margin-top: 18px; color: #87918d; font-size: 9px; }
.login-foot svg { width: 13px; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; width: var(--sidebar-width); display: flex; flex-direction: column; padding: 18px 12px 14px; color: #dfe7e4; background: var(--sidebar); border-right: 1px solid #25312e; }
.brand { min-height: 48px; display: flex; align-items: center; gap: 11px; padding: 0 8px 17px; border-bottom: 1px solid rgba(255,255,255,.09); }
.brand-mark { width: 33px; height: 33px; display: grid; grid-template-columns: repeat(3, 5px); align-items: end; justify-content: center; gap: 3px; padding: 7px 0; border: 1px solid #5b7770; border-radius: 5px; background: #1d2b27; }
.brand-mark span { display: block; width: 5px; background: #4fc49b; border-radius: 1px; }
.brand-mark span:nth-child(1) { height: 8px; }
.brand-mark span:nth-child(2) { height: 17px; }
.brand-mark span:nth-child(3) { height: 12px; }
.brand-copy { display: flex; flex-direction: column; line-height: 1.2; }
.brand-copy strong { color: #fff; font-size: 17px; font-weight: 700; }
.brand-copy small { margin-top: 3px; font-size: 10px; color: #8fa19c; }
.nav-list { display: flex; flex-direction: column; gap: 4px; margin-top: 18px; }
.nav-item { width: 100%; min-height: 42px; display: flex; align-items: center; gap: 11px; padding: 0 11px; border: 0; border-radius: 5px; color: #aab9b5; background: transparent; text-align: left; transition: background .16s ease, color .16s ease; }
.nav-item:hover { color: #fff; background: #1c2825; }
.nav-item.active { color: #fff; background: #263632; box-shadow: inset 3px 0 #47bd92; }
.nav-item span { flex: 1; font-size: 13px; }
.nav-item em { min-width: 22px; padding: 2px 6px; border-radius: 10px; color: #adc0ba; background: #283631; font-size: 10px; font-style: normal; text-align: center; }
.nav-item em.warn { color: #ffcfad; background: #4b3023; }
.nav-item.compact { margin-top: 8px; }
.sidebar-footer { margin-top: auto; padding-top: 13px; border-top: 1px solid rgba(255,255,255,.09); }
.system-state { display: flex; gap: 9px; align-items: center; padding: 9px 11px; }
.system-state .pulse { width: 8px; height: 8px; border-radius: 50%; background: #4fc49b; box-shadow: 0 0 0 4px rgba(79,196,155,.12); }
.system-state div { display: flex; flex-direction: column; }
.system-state strong { color: #dce5e2; font-size: 11px; font-weight: 500; }
.system-state small { margin-top: 3px; color: #73857f; font-size: 9px; }

.page-shell { min-height: 100vh; margin-left: var(--sidebar-width); }
.topbar { position: sticky; top: 0; z-index: 20; height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 0 28px; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); }
.topbar-left { min-width: 0; display: flex; align-items: center; gap: 10px; }
.topbar h1 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: 0; }
.topbar p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.global-search { width: min(300px, 25vw); height: 36px; display: flex; align-items: center; gap: 8px; padding: 0 10px; color: #7e8985; background: #f5f7f6; border: 1px solid var(--line); border-radius: 5px; }
.global-search svg { width: 15px; }
.global-search input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 11px; }
.global-search kbd { padding: 2px 5px; border: 1px solid #d3d9d6; border-radius: 3px; color: #8b9692; background: #fff; font: 9px/1.2 Arial; }
.icon-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 5px; background: #fff; }
.icon-btn:hover { background: #f4f7f6; }
.notification-btn { position: relative; }
.notification-btn span { position: absolute; top: -4px; right: -3px; min-width: 16px; height: 16px; display: grid; place-items: center; padding: 0 4px; color: #fff; background: var(--red); border: 2px solid #fff; border-radius: 10px; font-size: 8px; }
.profile-btn { height: 42px; display: flex; align-items: center; gap: 9px; padding: 0 4px 0 8px; border: 0; background: transparent; }
.avatar { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--green); font-size: 11px; font-weight: 700; }
.profile-copy { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.profile-copy strong { font-size: 11px; }
.profile-copy small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.profile-btn svg { width: 14px; color: var(--muted); }
.profile-menu-wrap { position: relative; }
.profile-menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 60; width: 210px; padding: 7px; background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow); }
.profile-menu-user { display: flex; align-items: center; gap: 10px; padding: 9px 8px 12px; border-bottom: 1px solid var(--line); }
.profile-menu-user > div { min-width: 0; display: flex; flex-direction: column; }
.profile-menu-user strong { font-size: 11px; }
.profile-menu-user small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.profile-menu > button { width: 100%; height: 34px; display: flex; align-items: center; gap: 9px; margin-top: 6px; padding: 0 9px; color: var(--red); background: transparent; border: 0; border-radius: 4px; font-size: 10px; text-align: left; }
.profile-menu > button:hover { background: var(--red-soft); }
.profile-menu > button svg { width: 15px; }
.mobile-only { display: none; }

main { min-height: calc(100vh - 72px); padding: 24px 28px 36px; }
.view { max-width: 1600px; margin: 0 auto; animation: viewIn .2s ease both; }
@keyframes viewIn { from { opacity: .3; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 15px; }
.section-heading h2 { margin: 0; font-size: 14px; font-weight: 700; }
.section-heading p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.section-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn { min-height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 5px; background: #fff; font-size: 11px; font-weight: 600; white-space: nowrap; }
.btn:hover { background: #f6f8f7; border-color: #b7c2bd; }
.btn svg { width: 15px; height: 15px; }
.btn.primary { color: #fff; background: var(--green); border-color: var(--green); }
.btn.primary:hover { background: #0c684c; }
.btn.danger { color: var(--red); background: var(--red-soft); border-color: #efc8cc; }
.btn.link { min-height: auto; padding: 0; color: var(--blue); background: transparent; border: 0; }
.btn.small { min-height: 28px; padding: 0 9px; font-size: 10px; }
.btn:disabled, .table-action:disabled { cursor: not-allowed; opacity: .38; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 18px; }
.operational-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 18px; }
.operational-strip > div { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; border: 1px solid var(--line, #dfe7ef); background: var(--panel, #fff); border-radius: 8px; min-width: 0; }
.operational-strip strong { color: var(--ink, #172536); font-size: 13px; white-space: nowrap; }
.operational-strip span { color: var(--muted, #687789); font-size: 12px; text-align: right; }
@media (max-width: 900px) { .operational-strip { grid-template-columns: 1fr; } .operational-strip > div { align-items: flex-start; flex-direction: column; gap: 4px; } .operational-strip span { text-align: left; } }
.metric-card { min-height: 116px; padding: 17px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.dashboard-action { font: inherit; color: inherit; text-align: left; }
.metric-card.dashboard-action { width: 100%; transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.metric-card.dashboard-action:hover { border-color: #b9c9c3; box-shadow: 0 5px 15px rgba(20,36,31,.07); transform: translateY(-1px); }
.metric-card.dashboard-action:focus-visible { border-color: var(--green); }
.metric-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 10px; }
.metric-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 5px; color: var(--green); background: var(--green-soft); }
.metric-icon.blue { color: var(--blue); background: var(--blue-soft); }
.metric-icon.orange { color: var(--orange); background: var(--orange-soft); }
.metric-icon.red { color: var(--red); background: var(--red-soft); }
.metric-icon svg { width: 16px; height: 16px; }
.metric-value { display: flex; align-items: baseline; gap: 7px; margin-top: 8px; }
.metric-value strong { font-size: 26px; line-height: 1; }
.metric-value span { color: var(--muted); font-size: 10px; }
.metric-foot { display: flex; align-items: center; gap: 5px; margin-top: 9px; color: var(--muted); font-size: 9px; }
.trend-up { color: var(--green); }
.trend-down { color: var(--red); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .75fr); gap: 14px; }
.dashboard-grid > * { min-width: 0; }
.panel { min-width: 0; max-width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.panel + .panel { margin-top: 14px; }
.panel-header { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 17px; border-bottom: 1px solid var(--line); }
.panel-title { display: flex; align-items: center; gap: 8px; }
.panel-title h3 { margin: 0; font-size: 12px; }
.panel-title .count { min-width: 20px; padding: 2px 6px; border-radius: 10px; color: var(--red); background: var(--red-soft); font-size: 9px; text-align: center; }
.panel-body { padding: 16px 17px; }
.panel-body.flush { padding: 0; }

.progress-overview { min-width: 0; display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 24px; align-items: center; }
.donut-wrap { display: grid; justify-items: center; position: relative; }
.donut { width: 126px; aspect-ratio: 1; border-radius: 50%; background: conic-gradient(var(--green) 0 68%, var(--orange) 68% 79%, #e7ece9 79%); display: grid; place-items: center; }
.donut::after { content: ""; width: 88px; height: 88px; border-radius: 50%; background: #fff; }
.donut-label { position: absolute; top: 35px; display: grid; place-items: center; }
.donut-label strong { font-size: 24px; }
.donut-label small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.chart-legend { width: 100%; margin-top: 13px; display: flex; justify-content: center; gap: 12px; color: var(--muted); font-size: 9px; }
.legend-dot { width: 7px; height: 7px; display: inline-block; margin-right: 4px; border-radius: 50%; background: var(--green); }
.legend-dot.orange { background: var(--orange); }
.legend-dot.gray { background: #d8dfdc; }
.work-bars { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.work-bar-row { display: grid; grid-template-columns: 84px 1fr 36px; gap: 10px; align-items: center; font-size: 10px; }
.work-bar-row.dashboard-row-action { width: 100%; padding: 4px; margin: -4px; border: 0; border-radius: 4px; background: transparent; }
.work-bar-row.dashboard-row-action:hover { background: #f5f8f7; }
.work-bar-row span:first-child { color: #3f4a46; }
.bar-track { height: 7px; border-radius: 4px; background: #edf0ef; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: inherit; background: var(--green); }
.bar-fill.blue { background: var(--blue); }
.bar-fill.orange { background: var(--orange); }
.work-bar-row b { font-size: 10px; text-align: right; }

.mini-timeline { display: flex; flex-direction: column; }
.timeline-item { display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: start; position: relative; padding-bottom: 18px; }
.timeline-item.dashboard-action { width: 100%; padding-top: 0; padding-right: 4px; padding-left: 0; border: 0; background: transparent; border-radius: 4px; }
.timeline-item.dashboard-action:hover .timeline-copy strong { color: var(--blue); }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { content: ""; position: absolute; left: 17px; top: 34px; bottom: 2px; width: 1px; background: var(--line); }
.timeline-item:last-child::before { display: none; }
.timeline-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: var(--green); background: var(--green-soft); }
.timeline-icon.warn { color: var(--orange); background: var(--orange-soft); }
.timeline-icon svg { width: 15px; }
.timeline-copy strong { display: block; font-size: 10px; font-weight: 600; }
.timeline-copy small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.timeline-time { color: var(--muted); font-size: 9px; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.search-field { min-width: 220px; height: 34px; display: flex; align-items: center; gap: 7px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 5px; background: #fff; }
.search-field svg { width: 14px; color: var(--muted); }
.search-field input { min-width: 0; flex: 1; border: 0; outline: 0; font-size: 10px; }
.select { height: 34px; min-width: 112px; padding: 0 29px 0 9px; border: 1px solid var(--line-strong); border-radius: 5px; color: #44504c; background: #fff; font-size: 10px; }
.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 5px; background: #eef2f0; }
.segment { min-height: 27px; padding: 0 10px; border: 0; border-radius: 3px; color: var(--muted); background: transparent; font-size: 10px; }
.segment.active { color: var(--ink); background: #fff; box-shadow: 0 1px 3px rgba(20,30,27,.1); }
.report-format-selector { width: fit-content; margin-top: 2px; }
.report-format-selector .segment { display: inline-flex; align-items: center; gap: 6px; min-width: 92px; justify-content: center; }
.report-format-selector .segment svg { width: 14px; height: 14px; }
.report-format-fixed { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel-soft); }
.report-format-fixed > svg { width: 20px; height: 20px; color: var(--brand); }
.report-format-fixed strong, .report-format-fixed small { display: block; }
.report-format-fixed small { margin-top: 2px; color: var(--muted); }

.data-table-wrap { width: 100%; overflow-x: auto; }
.task-table-scroll { max-height: min(62vh, 680px); overflow: auto; scrollbar-gutter: stable; cursor: grab; overscroll-behavior: contain; }
.task-table-scroll.drag-ready, .task-table-scroll.dragging { cursor: grabbing; user-select: none; }
.task-table-scroll .data-table thead th { position: sticky; top: 0; z-index: 3; box-shadow: 0 1px 0 var(--line); }
.task-table-scroll::-webkit-scrollbar { width: 11px; height: 13px; }
.task-table-scroll::-webkit-scrollbar-track { background: #e7ece9; }
.task-table-scroll::-webkit-scrollbar-thumb { background: #91a19b; border: 2px solid #e7ece9; border-radius: 5px; }
.task-table-scroll::-webkit-scrollbar-thumb:hover { background: #6f837b; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { height: 38px; padding: 0 13px; color: #6f7a76; background: #f7f9f8; border-bottom: 1px solid var(--line); font-size: 9px; font-weight: 600; text-align: left; white-space: nowrap; }
.data-table td { height: 52px; padding: 8px 13px; border-bottom: 1px solid #edf0ef; font-size: 10px; white-space: nowrap; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background .12s ease; }
.data-table tbody tr:hover { background: #fafcfb; }
.data-table tbody tr.clickable { cursor: pointer; }
.data-table tbody tr.dashboard-action { cursor: pointer; }
.data-table tbody tr.dashboard-action:focus-visible { outline: 2px solid rgba(40,108,156,.3); outline-offset: -2px; }
.cell-primary { display: flex; align-items: center; gap: 9px; }
.protected-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 6px; color: var(--blue); background: var(--blue-soft); border-radius: 3px; font-size: 8px; font-weight: 600; }
.protected-badge svg { width: 11px; height: 11px; }
.device-icon { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 5px; color: var(--blue); background: var(--blue-soft); }
.device-icon.software { color: var(--green); background: var(--green-soft); }
.device-icon.security { color: var(--orange); background: var(--orange-soft); }
.device-icon svg { width: 15px; }
.cell-stack { display: flex; flex-direction: column; line-height: 1.2; }
.cell-stack strong { font-size: 10px; font-weight: 600; }
.cell-stack small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.table-link { display: inline-block; width: fit-content; max-width: 100%; margin-top: 4px; padding: 0; color: var(--blue); background: transparent; border: 0; font: inherit; font-size: 8px; line-height: 1.2; text-align: left; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.table-link:hover, .table-link:focus-visible { color: var(--ink); }
.status { display: inline-flex; align-items: center; gap: 5px; min-height: 22px; padding: 0 7px; border-radius: 11px; color: var(--green); background: var(--green-soft); font-size: 9px; }
.status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status.warning { color: var(--orange); background: var(--orange-soft); }
.status.danger { color: var(--red); background: var(--red-soft); }
.status.info { color: var(--blue); background: var(--blue-soft); }
.status.neutral { color: #6e7774; background: #edf0ef; }
.priority { display: inline-flex; min-width: 34px; justify-content: center; padding: 3px 6px; border: 1px solid #e6b9bd; border-radius: 3px; color: var(--red); background: var(--red-soft); font-size: 8px; }
.priority.medium { color: var(--yellow); background: var(--yellow-soft); border-color: #edd89d; }
.priority.low { color: var(--blue); background: var(--blue-soft); border-color: #c5dbe9; }
.avatar-group { display: flex; align-items: center; }
.avatar.mini { width: 24px; height: 24px; margin-right: -5px; border: 2px solid #fff; font-size: 8px; }
.table-actions { display: flex; align-items: center; gap: 3px; }
.table-action { width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 4px; color: var(--muted); background: transparent; }
.table-action:hover { color: var(--ink); background: #eef2f0; }
.table-action svg { width: 14px; }
.pagination { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 14px; color: var(--muted); border-top: 1px solid var(--line); font-size: 9px; }
.page-buttons { display: flex; gap: 4px; }
.page-btn { width: 27px; height: 27px; border: 1px solid var(--line); border-radius: 4px; background: #fff; font-size: 9px; }
.page-btn.active { color: #fff; background: var(--green); border-color: var(--green); }

.subtabs { display: flex; gap: 20px; margin: -2px 0 14px; border-bottom: 1px solid var(--line); }
.subtab { position: relative; min-height: 38px; padding: 0 1px; color: var(--muted); background: transparent; border: 0; font-size: 11px; }
.subtab.active { color: var(--ink); font-weight: 600; }
.subtab.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--green); }
.inspection-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.summary-strip { display: flex; align-items: center; gap: 11px; padding: 13px 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.summary-strip .metric-icon { width: 32px; height: 32px; }
.summary-strip div:last-child { display: flex; flex-direction: column; }
.summary-strip strong { font-size: 17px; }
.summary-strip small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.summary-strip.summary-action { width: 100%; font: inherit; text-align: left; cursor: pointer; transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.summary-strip.summary-action:hover { border-color: #a9c2bd; box-shadow: 0 6px 18px rgba(20,45,39,.08); transform: translateY(-1px); }
.summary-strip.summary-action:focus-visible { border-color: var(--green); outline: 3px solid rgba(8,122,112,.12); }
.summary-strip.summary-action.active { border-color: #68aaa1; box-shadow: inset 0 0 0 1px rgba(8,122,112,.12), 0 5px 16px rgba(20,45,39,.07); }
.summary-chevron { width: 15px; margin-left: auto; color: var(--muted); }
.progress-cell { min-width: 112px; }
.progress-label { display: flex; justify-content: space-between; margin-bottom: 5px; color: var(--muted); font-size: 8px; }
.progress-cell .bar-track { height: 5px; }
.template-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.template-card { padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.template-card:hover { border-color: #b8c8c2; box-shadow: 0 4px 14px rgba(20,40,33,.05); }
.template-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.template-card h3 { margin: 0; font-size: 12px; }
.template-card p { margin: 5px 0 13px; color: var(--muted); font-size: 9px; }
.template-meta { display: flex; gap: 15px; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.template-card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }

.credential-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 13px; padding: 12px 14px; color: #725107; background: var(--yellow-soft); border: 1px solid #ead59e; border-radius: var(--radius); }
.credential-banner > div { display: flex; align-items: center; gap: 10px; }
.credential-banner svg { color: #a7740a; }
.credential-banner strong { display: block; font-size: 10px; }
.credential-banner small { display: block; margin-top: 3px; color: #876a2b; font-size: 9px; }
.masked { color: var(--muted); font-family: Consolas, monospace; letter-spacing: 1px; }
.address { color: var(--blue); font-family: Consolas, monospace; font-size: 9px; }
.role-chip { display: inline-flex; padding: 4px 7px; border-radius: 3px; color: var(--blue); background: var(--blue-soft); font-size: 8px; }
.role-chip.admin { color: var(--red); background: var(--red-soft); }
.role-chip.ops { color: var(--green); background: var(--green-soft); }

.role-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.role-card { padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.role-card-head { display: flex; justify-content: space-between; align-items: center; }
.role-card h3 { margin: 0; font-size: 11px; }
.role-card strong { font-size: 19px; }
.role-card p { height: 30px; margin: 8px 0 10px; color: var(--muted); font-size: 9px; line-height: 1.55; }
.role-card .avatars { display: flex; align-items: center; }

.settings-grid { display: grid; grid-template-columns: 180px 1fr; gap: 14px; }
.upgrade-upload-box { display:flex; align-items:center; gap:12px; padding:18px; margin-bottom:18px; border:1px dashed #a9bac0; border-radius:10px; background:#f7fbfb; }
.upgrade-upload-box .upload-progress { flex:1; margin:0; min-width:120px; }
.upgrade-upload-box > span { min-width:42px; text-align:right; color:#5d7078; font-variant-numeric:tabular-nums; }
.upgrade-upload-box + .audit-note { margin-bottom:18px; }
.settings-nav { padding: 7px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); align-self: start; }
.settings-link { width: 100%; min-height: 34px; padding: 0 9px; border: 0; border-radius: 4px; color: var(--muted); background: transparent; text-align: left; font-size: 10px; }
.settings-link.active { color: var(--green); background: var(--green-soft); font-weight: 600; }
.setting-row { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: 0; }
.setting-row strong { display: block; font-size: 10px; }
.setting-row small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.toggle { position: relative; width: 36px; height: 20px; border: 0; border-radius: 10px; background: #c9d0cd; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .15s ease; }
.toggle.on { background: var(--green); }
.toggle.on::after { transform: translateX(16px); }

.modal-layer { position: fixed; inset: 0; z-index: 60; display: none; align-items: center; justify-content: center; padding: 20px; background: rgba(10, 18, 16, .5); }
.modal-layer.open { display: flex; }
.modal { width: min(720px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; overflow: hidden; background: #fff; border-radius: 7px; box-shadow: 0 24px 70px rgba(0,0,0,.25); animation: modalIn .18s ease both; }
.modal > form { min-height: 0; display: flex; flex: 1 1 auto; flex-direction: column; overflow: hidden; }
.modal.small { width: min(460px, 100%); }
.modal.large { width: min(880px, 100%); }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }
.modal-header { min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 0 18px; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 0; font-size: 14px; }
.modal-header p { margin: 4px 0 0; color: var(--muted); font-size: 9px; }
.modal-body { min-height: 0; flex: 1 1 auto; padding: 18px; overflow-y: auto; }
.modal-footer { min-height: 60px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 0 18px; border-top: 1px solid var(--line); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.field { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 10px; font-weight: 600; }
.field label .required { color: var(--red); }
.field input, .field select, .field textarea { width: 100%; min-height: 36px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 4px; color: var(--ink); background: #fff; font-size: 10px; }
.field textarea { min-height: 72px; padding-top: 9px; resize: vertical; }
.field small { color: var(--muted); font-size: 8px; }
.form-section { margin: 19px 0 12px; padding-top: 15px; border-top: 1px solid var(--line); }
.form-section h3 { margin: 0; font-size: 11px; }
.form-section p { margin: 4px 0 0; color: var(--muted); font-size: 9px; }
.upload-zone { min-height: 76px; display: flex; align-items: center; justify-content: center; gap: 9px; padding: 12px; color: var(--muted); background: #fafbfb; border: 1px dashed #bcc7c2; border-radius: 4px; font-size: 9px; text-align: center; }
.upload-zone svg { color: var(--green); }
.upload-zone:hover { color: var(--ink); background: #f4faf7; border-color: var(--green); cursor: pointer; }
.upload-zone-copy { display: flex; flex-direction: column; gap: 4px; text-align: left; }
.upload-zone-copy strong { color: var(--ink); font-size: 11px; font-weight: 600; }
.upload-zone-copy small { color: var(--muted); font-size: 9px; }
.evidence-paste-zone { min-height: 54px; display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; align-items: center; margin-top: 8px; padding: 8px 10px; color: var(--muted); border: 1px solid #cad8d3; border-radius: 4px; background: #f6faf8; outline: 0; }
.evidence-paste-zone > svg { width: 18px; height: 18px; justify-self: center; color: var(--green); }
.evidence-paste-zone > span { min-width: 0; }
.evidence-paste-zone > span strong, .evidence-paste-zone > span small { display: block; }
.evidence-paste-zone > span strong { color: var(--ink); font-size: 10px; }
.evidence-paste-zone > span small { margin-top: 3px; font-size: 9px; }
.evidence-paste-zone:focus-within, .evidence-paste-zone:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(20,121,105,.08); }
.evidence-paste-zone.uploading { opacity: .68; }
.evidence-paste-zone .btn { cursor: pointer; white-space: nowrap; }
.upload-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.upload-item { min-height: 52px; display: grid; grid-template-columns: 30px minmax(0, 1fr) 48px auto; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.upload-item.complete { border-color: #beded2; background: #f6fbf9; }
.upload-item.failed { border-color: #ebc7ca; background: var(--red-soft); }
.upload-file-icon { width: 30px; height: 30px; display: grid; place-items: center; color: var(--green); background: var(--green-soft); border-radius: 4px; }
.upload-item.failed .upload-file-icon, .upload-item.failed .upload-percent { color: var(--red); }
.upload-file-info { min-width: 0; }
.upload-file-info strong, .upload-file-info small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-file-info strong { font-size: 10px; }
.upload-file-info small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.upload-percent { color: var(--green); font-size: 10px; font-weight: 700; text-align: right; }
.attachment-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.attachment-action { min-height: 30px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 0 8px; color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 4px; font: inherit; font-size: 9px; text-decoration: none; white-space: nowrap; cursor: pointer; }
.attachment-action:hover { color: var(--ink); background: #eef3f1; border-color: var(--line); }
.attachment-action svg { width: 13px; height: 13px; }
.upload-progress { height: 5px; margin-top: 7px; overflow: hidden; background: #dfe7e3; border-radius: 3px; }
.upload-progress i { display: block; height: 100%; background: var(--green); transition: width .15s ease; }
.inspection-readiness { display: grid; grid-template-columns: minmax(190px, auto) minmax(180px, 1fr); gap: 18px; align-items: center; margin-bottom: 12px; padding: 12px 13px; border: 1px solid #c8ded6; background: #f5faf8; border-radius: 4px; }
.inspection-readiness strong, .inspection-readiness small { display: block; }
.inspection-readiness strong { font-size: 11px; }
.inspection-readiness small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.modal-permission-note { margin-right: auto; color: var(--muted); font-size: 10px; }
.checklist { display: flex; flex-direction: column; gap: 8px; }
.check-row { display: grid; grid-template-columns: 20px 1fr 130px 86px; gap: 9px; align-items: center; min-height: 43px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 4px; }
.check-row input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--green); }
.check-row strong { display: block; font-size: 9px; }
.check-row small { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; }
.check-row input[type="number"], .check-row select { width: 100%; height: 29px; border: 1px solid var(--line-strong); border-radius: 4px; padding: 0 6px; font-size: 9px; }
.inspection-checklist { gap: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.inspection-checklist-head,
.inspection-checklist .check-row { display: grid; grid-template-columns: 52px minmax(260px, 1fr) 180px 180px; column-gap: 16px; align-items: center; }
.inspection-checklist-head { min-height: 38px; padding: 0 16px; color: var(--muted); background: #f3f6f5; border-bottom: 1px solid var(--line); font-size: 9px; font-weight: 600; }
.inspection-checklist-head span:first-child,
.inspection-checklist-head span:nth-child(3),
.inspection-checklist-head span:nth-child(4) { text-align: center; }
.inspection-checklist .check-row { min-height: 64px; padding: 9px 16px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.inspection-checklist .check-row:last-child { border-bottom: 0; }
.inspection-checklist .metric-complete { justify-self: center; margin: 0; }
.inspection-metric-copy { min-width: 0; }
.inspection-metric-copy strong { font-size: 10px; line-height: 1.35; }
.inspection-metric-copy small { margin-top: 4px; font-size: 9px; line-height: 1.35; }
.inspection-checklist .check-row .inspection-measured { width: 100%; height: 38px; margin: 0; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 4px; color: var(--ink); background: #fff; font-size: 10px; line-height: 38px; text-align: center; text-align-last: center; }
.inspection-checklist .check-row .inspection-measured:focus { border-color: var(--green); outline: 2px solid rgba(20, 121, 105, .12); outline-offset: 0; }
.inspection-result-cell { width: 100%; height: 38px; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 0 10px; border: 1px solid var(--line); border-radius: 4px; background: #f5f7f7; text-align: center; }
.inspection-result-cell strong { color: var(--muted); font-size: 10px; }
.inspection-result-cell small { margin: 0; color: var(--muted); font-size: 8px; }
.inspection-result-cell.normal { border-color: #b9dcd2; background: #edf8f4; }
.inspection-result-cell.normal strong { color: var(--green); }
.inspection-result-cell.abnormal { border-color: #ebc1c5; background: var(--red-soft); }
.inspection-result-cell.abnormal strong { color: var(--red); }
.attachment-preview-layer { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(8, 15, 18, .72); backdrop-filter: blur(3px); }
.attachment-preview-shell { width: min(1120px, 94vw); height: min(820px, 92vh); display: flex; flex-direction: column; overflow: hidden; border: 1px solid rgba(255,255,255,.3); border-radius: 6px; background: #fff; box-shadow: 0 28px 90px rgba(0,0,0,.4); }
.attachment-preview-shell > header { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 18px; border-bottom: 1px solid var(--line); background: #f8faf9; }
.attachment-preview-shell > header strong, .attachment-preview-shell > header small { display: block; }
.attachment-preview-shell > header strong { max-width: min(760px, 70vw); overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.attachment-preview-shell > header small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.attachment-preview-loading, .attachment-preview-unsupported { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 30px; color: var(--muted); text-align: center; }
.attachment-preview-loading svg { animation: spin 1s linear infinite; }
.attachment-preview-content { min-height: 0; flex: 1; display: flex; overflow: auto; background: #e9edef; }
.attachment-preview-media { width: 100%; min-height: 100%; display: grid; place-items: center; padding: 20px; }
.attachment-preview-media img { max-width: 100%; max-height: 100%; object-fit: contain; background: #fff; box-shadow: 0 4px 22px rgba(0,0,0,.12); }
.attachment-preview-frame { width: 100%; height: 100%; min-height: 520px; border: 0; background: #fff; }
.attachment-preview-text { width: min(900px, 100%); min-height: 100%; margin: 0 auto; padding: 28px 32px; color: var(--ink); background: #fff; font: 11px/1.75 Consolas, "Microsoft YaHei", sans-serif; white-space: pre-wrap; overflow-wrap: anywhere; }
.attachment-preview-table-wrap { width: 100%; overflow: auto; padding: 16px; }
.attachment-preview-table { min-width: 100%; border-collapse: collapse; background: #fff; }
.attachment-preview-table th, .attachment-preview-table td { min-width: 110px; padding: 8px 10px; border: 1px solid #d8e0e3; font-size: 10px; text-align: left; vertical-align: top; white-space: pre-wrap; }
.attachment-preview-table th { position: sticky; top: 0; z-index: 1; background: #f1f5f5; font-weight: 700; }
.attachment-preview-unsupported strong { color: var(--ink); font-size: 13px; }
.attachment-preview-unsupported p { max-width: 520px; margin: 0; font-size: 10px; line-height: 1.6; }
@keyframes spin { to { transform: rotate(360deg); } }
.auto-hint { display: flex; align-items: center; gap: 7px; margin-bottom: 11px; padding: 9px 10px; color: var(--blue); background: var(--blue-soft); border-radius: 4px; font-size: 9px; }
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 16px; }
.detail-item span { display: block; color: var(--muted); font-size: 8px; }
.detail-item strong { display: block; margin-top: 5px; font-size: 10px; font-weight: 600; overflow-wrap: anywhere; }
.account-row { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 8px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.account-row:last-child { border-bottom: 0; }
.account-row code { font-size: 9px; }
.account-row.account-head { color: var(--muted); background: #f7f9f8; border-radius: 4px; padding: 8px; font-size: 8px; }
.credential-extension { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.credential-account-section { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.credential-account-editor { padding: 15px 0; border-top: 1px solid var(--line); }
.credential-account-editor:first-child { border-top: 0; padding-top: 3px; }
.account-editor-head { min-height: 34px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.account-editor-head div { display: flex; flex-direction: column; }
.account-editor-head strong { font-size: 10px; }
.account-editor-head small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.asset-node-section { margin-top: 2px; }
.node-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.node-section-head > div { min-width: 0; }
.asset-node-list { display: flex; flex-direction: column; }
.asset-node-editor { padding: 15px 0; border-top: 1px solid var(--line); }
.asset-node-editor:first-child { border-top: 0; }
.node-editor-head { min-height: 34px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.node-editor-head strong { display: block; font-size: 10px; }
.node-editor-head small { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; }
.node-detail-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 4px; }
.node-detail-table { width: 100%; border-collapse: collapse; }
.node-detail-table th { padding: 8px 10px; color: var(--muted); background: #f7f9f8; font-size: 8px; font-weight: 600; text-align: left; white-space: nowrap; }
.node-detail-table td { padding: 9px 10px; border-top: 1px solid var(--line); font-size: 9px; white-space: nowrap; }
.node-detail-table code { font-size: 9px; }
.node-password { min-width: 112px; display: flex; align-items: center; justify-content: space-between; gap: 5px; }
.node-detail-wrap.compact { margin-top: 10px; }
.imported-node-table { max-height: 52vh; overflow: auto; }
.imported-node-table .node-detail-table { min-width: 1320px; }
.imported-node-table th { position: sticky; z-index: 1; top: 0; }
.imported-node-table td { min-width: 140px; vertical-align: top; white-space: normal; }
.imported-node-table td:first-child { min-width: 210px; }
.network-line { display: flex; flex-direction: column; gap: 2px; margin-bottom: 7px; }
.network-line:last-child { margin-bottom: 0; }
.network-line small { color: var(--muted); font-size: 8px; line-height: 1.45; }
.node-account-list { min-width: 210px; display: flex; flex-direction: column; gap: 6px; }
.node-account-pill { display: grid; grid-template-columns: minmax(82px, 1fr) minmax(70px, 1fr); gap: 3px 7px; align-items: center; padding: 6px 7px; background: #f7f9f8; border-radius: 4px; }
.node-account-pill span { font-size: 8px; font-weight: 600; }
.node-account-pill code { overflow-wrap: anywhere; white-space: normal; }
.node-account-pill small { grid-column: 1 / -1; color: #946b18; font-size: 7px; }
.endpoint-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.endpoint-item { min-width: 0; display: flex; flex-direction: column; gap: 7px; padding: 10px; background: #f7f9f8; border: 1px solid var(--line); border-radius: 4px; }
.endpoint-item > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.endpoint-item strong { font-size: 9px; }
.endpoint-item code { overflow-wrap: anywhere; white-space: normal; }
.endpoint-item small { color: var(--muted); font-size: 8px; }
.secret-status { display: inline-flex; align-items: center; min-height: 22px; padding: 0 7px; border-radius: 3px; font-size: 8px; font-weight: 600; white-space: nowrap; }
.secret-status.pending { color: #805b12; background: #fff3ce; }
.account-list-scroll, .asset-credential-preview { max-height: 42vh; overflow-y: auto; }
.imported-account-row { min-height: 46px; }
.imported-account-row small { color: var(--muted); font-size: 8px; }
.asset-account-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.asset-account-heading .section-actions { flex-wrap: wrap; justify-content: flex-end; }
.asset-login-list { overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
.asset-login-row { display: grid; grid-template-columns: minmax(190px, 1.45fr) minmax(130px, 1fr) minmax(150px, 1fr) auto; gap: 14px; align-items: center; min-height: 54px; padding: 10px 12px; border-top: 1px solid var(--line); }
.asset-login-row:first-child { border-top: 0; }
.asset-login-row > code { overflow-wrap: anywhere; white-space: normal; }
.asset-login-row.asset-login-head { min-height: 36px; color: var(--muted); background: var(--panel-soft); font-size: 8px; }
.asset-login-row.asset-login-head strong { font-weight: 600; }
.asset-password-value { display: inline-flex; min-width: 110px; color: var(--muted); letter-spacing: .08em; }
.asset-password-value.revealed { color: var(--ink); letter-spacing: normal; overflow-wrap: anywhere; white-space: normal; }
.credential-visibility-note { color: var(--muted); font-size: 8px; white-space: nowrap; }
.page-btn svg { width: 13px; height: 13px; }
.empty-inline { padding: 18px; color: var(--muted); background: #fafbfb; border: 1px dashed var(--line-strong); border-radius: 4px; font-size: 9px; text-align: center; }
.delete-warning { display: flex; align-items: flex-start; gap: 11px; padding: 13px; color: #7d222b; background: var(--red-soft); border: 1px solid #efc8cc; border-radius: 4px; }
.delete-warning > svg { flex: 0 0 auto; width: 18px; margin-top: 1px; }
.delete-warning strong { display: block; font-size: 10px; }
.delete-warning p { margin: 4px 0 0; color: #92525a; font-size: 9px; line-height: 1.6; }
.danger-text { color: var(--red); }
.audit-note { margin-top: 13px; padding: 10px; color: var(--muted); background: #f5f7f6; border-radius: 4px; font-size: 9px; line-height: 1.6; }
.attachment-storage-config { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.storage-path-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.storage-path-row .field { margin: 0; }
.storage-path-row .btn { min-height: 42px; white-space: nowrap; }
.storage-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.storage-stats span { min-height: 30px; display: inline-flex; align-items: center; gap: 5px; padding: 0 10px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; background: var(--panel-soft); font-size: 9px; }
.storage-stats strong { color: var(--ink); font-size: 10px; }
.storage-readonly { display: flex; align-items: center; gap: 10px; padding: 13px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel-soft); }
.storage-readonly > svg { width: 20px; color: var(--muted); }
.storage-readonly strong, .storage-readonly small { display: block; }
.storage-readonly small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.warning-note { color: #7d5b13; background: #fff7dd; }
.device-category-section { padding: 0 16px 16px; border-bottom: 1px solid var(--line); }
.device-category-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.device-category-item { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel-soft); }
.device-category-item strong, .device-category-item small { display: block; }
.device-category-item strong { color: var(--ink); font-size: 10px; }
.device-category-item small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.field-control-row { display: grid; grid-template-columns: minmax(0, 1fr) 40px; gap: 8px; align-items: center; }
.field-control-row .icon-btn { width: 40px; height: 40px; }
.inline-create-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; margin-top: -3px; padding: 10px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel-soft); }
.inline-create-row input { min-width: 0; min-height: 38px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 5px; }
@media (max-width: 760px) { .storage-path-row, .inline-create-row { grid-template-columns: 1fr; } .storage-path-row .btn, .inline-create-row .btn { width: 100%; } }

.toast-stack { position: fixed; z-index: 100; right: 18px; bottom: 18px; width: min(340px, calc(100vw - 36px)); display: flex; flex-direction: column; gap: 8px; }
.toast { display: grid; grid-template-columns: 28px 1fr auto; gap: 9px; align-items: center; padding: 12px; color: #fff; background: #1e2b27; border-radius: 6px; box-shadow: var(--shadow); animation: toastIn .2s ease both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }
.toast-icon { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; color: #92e0c2; background: rgba(79,196,155,.15); }
.toast-icon svg { width: 14px; }
.toast strong { display: block; font-size: 10px; }
.toast small { display: block; margin-top: 3px; color: #aebdb8; font-size: 8px; line-height: 1.4; }
.toast button { border: 0; color: #94a49f; background: transparent; }
.empty-state { min-height: 260px; display: grid; place-items: center; color: var(--muted); font-size: 11px; text-align: center; }
.empty-state svg { width: 34px; height: 34px; margin-bottom: 8px; color: #9eaaa5; }
.template-grid > .template-empty-state { grid-column: 1 / -1; min-height: 240px; border: 1px dashed var(--line-strong); border-radius: 6px; background: #fff; }
.hidden { display: none !important; }

/* DingDong operations workspace: restrained, readable and optimized for repeated work. */
:root {
  --bg: #f4f6f7;
  --panel-soft: #f8faf9;
  --ink: #17211e;
  --muted: #61706a;
  --line: #dce3e0;
  --line-strong: #c5d0cb;
  --sidebar: #101816;
  --sidebar-2: #18231f;
  --green: #147d61;
  --green-soft: #e7f4ef;
  --blue: #246b91;
  --blue-soft: #e9f2f7;
  --orange: #b85b2c;
  --red: #b83c45;
  --shadow: 0 12px 30px rgba(21, 35, 30, .09);
  --sidebar-width: 246px;
  --radius: 6px;
}

body, button, input, select, textarea { letter-spacing: 0; }
.sidebar { padding: 20px 14px 16px; }
.brand { min-height: 58px; gap: 12px; padding: 0 9px 18px; }
.brand-mark { width: 36px; height: 36px; border-color: #4d6b62; background: #192720; }
.brand-copy strong { font-size: 20px; }
.brand-copy small { font-size: 11px; }
.nav-list { gap: 5px; margin-top: 20px; }
.nav-item { min-height: 46px; gap: 12px; padding: 0 12px; border-radius: 5px; }
.nav-item span { font-size: 14px; }
.nav-item svg { width: 18px; height: 18px; }
.system-state { padding: 11px 12px; }
.system-state strong { font-size: 12px; }
.system-state small { font-size: 10px; }
.topbar { height: 78px; padding: 0 34px; }
.topbar h1 { font-size: 20px; }
.topbar p { margin-top: 5px; font-size: 12px; }
.global-search { width: min(340px, 28vw); height: 40px; padding: 0 12px; }
.global-search input { font-size: 12px; }
.icon-btn { width: 40px; height: 40px; }
.profile-btn { height: 46px; }
.profile-copy strong { font-size: 12px; }
.profile-copy small { font-size: 10px; }
main { min-height: calc(100vh - 78px); padding: 30px 34px 44px; }
.view { max-width: 1680px; }
.section-heading { margin-bottom: 20px; }
.section-heading h2 { font-size: 20px; }
.section-heading p { margin-top: 6px; font-size: 12px; }
.btn { min-height: 38px; gap: 8px; padding: 0 14px; font-size: 12px; }
.btn.small { min-height: 32px; padding: 0 11px; font-size: 11px; }
.metric-grid { gap: 14px; margin-bottom: 20px; }
.metric-card { min-height: 126px; padding: 19px; }
.metric-top { font-size: 12px; }
.metric-value strong { font-size: 30px; }
.metric-value span, .metric-foot { font-size: 11px; }
.panel-header { min-height: 60px; padding: 0 20px; }
.panel-title h3 { font-size: 14px; }
.panel-body { padding: 20px; }
.toolbar { min-height: 58px; margin-bottom: 14px; }
.search-field, .select { min-height: 38px; font-size: 12px; }
.data-table th { padding: 12px 14px; font-size: 11px; }
.data-table td { padding: 13px 14px; font-size: 12px; }
.cell-stack strong { font-size: 12px; }
.cell-stack small, .address, .masked { font-size: 10px; }
.role-chip, .priority, .status, .secret-status { min-height: 24px; align-items: center; font-size: 10px; }
.table-action { width: 32px; height: 32px; }
.pagination { min-height: 54px; padding: 0 16px; font-size: 11px; }
.page-btn { width: 31px; height: 31px; font-size: 11px; }
.subtab { min-height: 44px; font-size: 12px; }
.summary-strip { min-height: 74px; padding: 15px 16px; }
.summary-strip strong { font-size: 20px; }
.summary-strip small { font-size: 10px; }
.template-card { padding: 18px; }
.template-card h3 { font-size: 14px; }
.template-card p, .template-meta { font-size: 10px; }
.role-grid { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.role-card { min-height: 150px; padding: 17px; }
.role-card h3 { font-size: 13px; }
.role-card strong { font-size: 24px; }
.role-card p { height: auto; min-height: 38px; font-size: 10px; }
.credential-banner { padding: 15px 17px; }
.credential-banner strong { font-size: 12px; }
.credential-banner small { font-size: 10px; line-height: 1.6; }
.settings-grid { grid-template-columns: 210px 1fr; gap: 16px; }
.settings-nav { padding: 8px; }
.settings-link { min-height: 42px; padding: 0 12px; font-size: 12px; }
.setting-row { min-height: 74px; }
.setting-row strong { font-size: 12px; }
.setting-row small { font-size: 10px; }
.modal-layer { padding: 24px; background: rgba(11, 18, 16, .58); }
.modal { width: min(780px, 100%); max-height: calc(100vh - 48px); border-radius: 6px; }
.modal.small { width: min(520px, 100%); }
.modal.large { width: min(1160px, 100%); }
.modal-header { min-height: 76px; padding: 0 24px; }
.modal-header h2 { font-size: 20px; }
.modal-header p { margin-top: 5px; font-size: 11px; }
.modal-body { padding: 24px; }
.modal-footer { min-height: 72px; padding: 0 24px; }
.form-grid { gap: 16px; }
.field { gap: 7px; }
.field label { font-size: 12px; }
.field input, .field select, .field textarea { min-height: 42px; padding: 0 12px; font-size: 12px; }
.field textarea { min-height: 90px; padding-top: 11px; }
.field small { font-size: 10px; }
.form-section { margin: 24px 0 14px; padding-top: 19px; }
.form-section h3 { font-size: 14px; }
.form-section p { margin-top: 5px; font-size: 10px; }
.upload-zone { min-height: 96px; font-size: 11px; }
.auto-hint, .audit-note { padding: 12px 13px; font-size: 10px; }
.detail-grid { gap: 15px 22px; }
.detail-item span { font-size: 10px; }
.detail-item strong { font-size: 12px; }
.endpoint-grid { gap: 10px; }
.endpoint-item { min-height: 116px; padding: 14px; background: #fafcfb; }
.endpoint-item strong { font-size: 12px; }
.endpoint-item small { font-size: 10px; }
.endpoint-editor, .mapping-editor { padding: 18px; margin-bottom: 12px; border: 1px solid var(--line); background: #fafcfb; border-radius: 5px; }
.endpoint-editor .account-editor-head, .mapping-editor .account-editor-head { margin-bottom: 14px; }
.review-groups { display: grid; gap: 14px; }
.review-group { border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.review-group.abnormal { border-color: #ebc7ca; }
.review-group-head { min-height: 46px; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; background: #f2f8f5; }
.review-group.abnormal .review-group-head { color: var(--red); background: var(--red-soft); }
.review-group-head strong { font-size: 12px; }
.review-group-head span { font-size: 12px; font-weight: 700; }
.compact-table th, .compact-table td { padding: 9px 12px; }
.permission-table th { min-width: 116px; text-align: center; }
.permission-table th:first-child { min-width: 130px; text-align: left; }
.permission-table th small { display: block; margin-top: 4px; color: var(--muted); font-weight: 400; }
.permission-table td:not(:first-child) { text-align: center; }
.permission-mark { width: 26px; height: 26px; display: inline-grid; place-items: center; color: #9da8a4; background: #f0f3f2; border-radius: 50%; }
.permission-mark.allowed { color: var(--green); background: var(--green-soft); }
.permission-mark svg { width: 14px; }
.policy-list { display: grid; gap: 8px; }
.policy-item { min-height: 66px; display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.policy-item:last-child { border-bottom: 0; }
.policy-item strong { display: block; font-size: 12px; }
.policy-item small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.dictionary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.dictionary-grid > div { display: flex; flex-direction: column; gap: 4px; padding: 12px; border: 1px solid var(--line); background: #fafcfb; border-radius: 4px; }
.dictionary-grid span { font-size: 12px; font-weight: 600; }
.dictionary-grid small { color: var(--muted); font-size: 10px; }
.number-setting { display: flex; align-items: center; gap: 8px; }
.number-setting input { width: 90px; height: 38px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 4px; }
.audit-overview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.audit-overview > div { padding: 16px; border-left: 3px solid var(--green); background: #f7faf9; }
.audit-overview strong, .audit-overview span { display: block; }
.audit-overview strong { font-size: 12px; }
.audit-overview span { margin-top: 6px; color: var(--muted); font-size: 10px; line-height: 1.6; }

@media (max-width: 1100px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .template-grid { grid-template-columns: repeat(2, 1fr); }
  .role-grid { grid-template-columns: repeat(2, 1fr); }
  .progress-overview { grid-template-columns: 145px 1fr; }
}

@media (max-width: 840px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-context { min-height: 220px; padding: 28px 32px; }
  .login-context-copy { margin: 32px 0 12px; }
  .login-context-copy h1 { font-size: 25px; }
  .login-context::after, .login-system-state { display: none; }
  .login-form-area { min-height: calc(100vh - 220px); padding: 40px 28px; place-items: start center; }
  .mobile-only { display: inline-grid; }
  .sidebar { transform: translateX(-100%); box-shadow: 18px 0 50px rgba(0,0,0,.24); transition: transform .2s ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar .mobile-only { margin-left: auto; color: #ccd7d3; background: transparent; border-color: rgba(255,255,255,.14); }
  .page-shell { margin-left: 0; }
  .topbar { height: 64px; padding: 0 16px; }
  .topbar h1 { font-size: 15px; }
  .topbar p, .global-search, .profile-copy, .profile-btn > svg { display: none; }
  main { min-height: calc(100vh - 64px); padding: 17px 16px 30px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .inspection-summary { grid-template-columns: repeat(2, 1fr); }
  .form-grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-nav { display: flex; overflow-x: auto; }
  .settings-link { min-width: 105px; }
}

@media (max-width: 560px) {
  .login-context { min-height: 178px; padding: 22px 20px; }
  .login-context-copy { margin: 24px 0 0; }
  .login-kicker { margin-bottom: 10px; font-size: 8px; }
  .login-context-copy h1 { font-size: 21px; }
  .login-context-copy p { margin-top: 8px; font-size: 11px; }
  .login-form-area { min-height: calc(100vh - 178px); padding: 32px 20px; }
  .login-captcha-row { grid-template-columns: minmax(0, 1fr) 144px; }
  .captcha-image-button { width: 144px; grid-template-columns: 112px 30px; }
  .captcha-image-button img, .captcha-image-button > span { width: 112px; }
  .topbar { gap: 8px; }
  .topbar-actions { gap: 4px; }
  .profile-btn { padding: 0; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .metric-card { min-height: 104px; padding: 13px; }
  .metric-value strong { font-size: 22px; }
  .metric-foot { line-height: 1.4; }
  .progress-overview { grid-template-columns: 1fr; }
  .section-heading { align-items: center; }
  .section-heading p { display: none; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .filters { display: grid; grid-template-columns: 1fr 1fr; }
  .search-field { min-width: 0; grid-column: 1 / -1; }
  .select { min-width: 0; width: 100%; }
  .template-grid, .role-grid { grid-template-columns: 1fr; }
  .inspection-summary { grid-template-columns: 1fr 1fr; }
  .summary-strip { padding: 10px; }
  .form-grid, .form-grid.cols-3 { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .detail-grid { grid-template-columns: repeat(2, 1fr); }
  .check-row { grid-template-columns: 20px 1fr; }
  .check-row input[type="number"], .check-row select { grid-column: 2; }
  .account-row { grid-template-columns: 1fr 1fr; }
  .endpoint-grid { grid-template-columns: 1fr; }
  .asset-account-heading { align-items: flex-start; flex-direction: column; }
  .asset-account-heading .section-actions { width: 100%; display: grid; grid-template-columns: 1fr; }
  .asset-account-heading .btn { width: 100%; }
  .asset-login-list { overflow-x: auto; }
  .asset-login-row { min-width: 680px; grid-template-columns: 190px 130px 150px auto; }
  .modal-layer { align-items: flex-end; padding: 0; }
  .modal { max-height: 92vh; border-radius: 7px 7px 0 0; }
  .credential-banner { align-items: flex-start; flex-direction: column; }
  .credential-account-section { align-items: flex-start; flex-direction: column; }
  .node-section-head { align-items: flex-start; flex-direction: column; }
  .node-section-head .btn { width: 100%; }
}

/* Operations console refresh: clearer hierarchy, denser controls, stronger system identity. */
:root {
  --bg: #eef1f4;
  --panel-soft: #f5f7f8;
  --ink: #172126;
  --muted: #617078;
  --line: #d7dee2;
  --line-strong: #bcc8ce;
  --sidebar: #151b1e;
  --sidebar-2: #1d272a;
  --green: #087a70;
  --green-soft: #e1f3f0;
  --blue: #236e9b;
  --blue-soft: #e6f0f6;
  --orange: #b55a28;
  --red: #b63843;
  --shadow: 0 8px 24px rgba(24, 38, 45, .08);
}

body { color: var(--ink); background: var(--bg); }
.sidebar { background: var(--sidebar); border-right-color: #2c383d; }
.brand { border-bottom-color: rgba(255,255,255,.11); }
.brand-mark { border-color: #38665f; background: #12302e; }
.brand-mark span { background: #38c4ac; }
.brand-copy small { color: #95a8af; }
.nav-item { color: #aab7bc; }
.nav-item:hover { background: #202a2e; }
.nav-item.active { background: #243337; box-shadow: inset 3px 0 #35bda6; }
.nav-item.active svg { color: #51d3bd; }
.system-state .pulse { background: #43cf9f; }
.topbar { background: rgba(255,255,255,.98); border-bottom-color: #d5dde1; box-shadow: 0 1px 0 rgba(22,34,40,.02); }
.topbar h1 { color: #111a1f; }
.global-search { background: #f2f5f6; border-color: #d4dde1; }
main { background: #eef1f4; }
.section-heading h2 { color: #111b20; font-weight: 750; }
.section-heading p { color: #6a7880; }
.btn { border-color: #c9d2d7; background: #fff; }
.btn:hover { border-color: #9eafb7; background: #f8fafb; }
.btn.primary { color: #fff; background: #087a70; border-color: #087a70; box-shadow: 0 3px 8px rgba(8,122,112,.16); }
.btn.primary:hover { background: #06685f; border-color: #06685f; }
.panel, .metric-card, .summary-strip, .template-card, .role-card, .data-table-wrap { border-color: #d6dee2; box-shadow: 0 4px 14px rgba(28,43,50,.045); }
.metric-card { position: relative; overflow: hidden; }
.metric-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--green); }
.metric-card:nth-child(2)::before { background: var(--blue); }
.metric-card:nth-child(3)::before { background: var(--orange); }
.metric-card:nth-child(4)::before { background: var(--red); }
.metric-icon { border: 1px solid rgba(8,122,112,.11); }
.panel-header { background: #fbfcfc; border-bottom-color: #d9e0e4; }
.toolbar { padding: 10px 12px; border: 1px solid #d6dee2; border-radius: 6px; background: #f8fafb; }
.search-field, .select { border-color: #cbd5da; background: #fff; }
.data-table th { color: #56656d; background: #f1f4f6; border-bottom-color: #cfd9de; font-weight: 700; }
.data-table td { border-bottom-color: #e5eaed; }
.data-table tbody tr:hover { background: #f3f8f7; }
.data-table tbody tr.selected { background: #edf7f5; box-shadow: inset 3px 0 #178f84; }
.selection-column { width: 48px; min-width: 48px; padding-right: 6px !important; padding-left: 14px !important; text-align: center !important; }
.table-checkbox { width: 22px; height: 22px; display: inline-grid; place-items: center; cursor: pointer; }
.table-checkbox input { position: absolute; opacity: 0; pointer-events: none; }
.table-checkbox span { width: 18px; height: 18px; display: grid; place-items: center; color: transparent; border: 1px solid #aebbc1; border-radius: 4px; background: #fff; transition: background .12s ease, border-color .12s ease, box-shadow .12s ease; }
.table-checkbox span svg { width: 12px; }
.table-checkbox input:checked + span,
.table-checkbox input:indeterminate + span { color: #fff; border-color: var(--green); background: var(--green); box-shadow: 0 0 0 2px rgba(8,122,112,.12); }
.table-checkbox input:disabled + span { cursor: not-allowed; opacity: .45; }
.inspection-filter-toolbar { align-items: center; }
.inspection-filters { flex: 1 1 auto; }
.inspection-filters .search-field { min-width: 210px; flex: 1 1 240px; }
.inspection-filters .select { min-width: 126px; }
.inspection-selection-bar { min-height: 50px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; padding: 8px 12px; color: #255850; border: 1px solid #bcded8; border-radius: 6px; background: #edf8f6; }
.inspection-selection-bar > div { display: flex; align-items: center; gap: 8px; }
.inspection-selection-bar > div > svg { width: 17px; color: var(--green); }
.inspection-selection-bar strong { font-size: 11px; }
.inspection-selection-bar span { color: #66807b; font-size: 9px; }
.status { border: 1px solid rgba(8,122,112,.12); }
.page-btn.active { background: #087a70; border-color: #087a70; }
.modal-layer { background: rgba(10,18,22,.64); }
.modal { border: 1px solid rgba(255,255,255,.35); box-shadow: 0 26px 80px rgba(7,15,19,.34); }
.modal-header { background: #f8fafb; }
.modal-header h2 { color: #10191e; }
.modal-footer { background: #f8fafb; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #087a70; box-shadow: 0 0 0 3px rgba(8,122,112,.1); outline: 0; }
.auto-hint { color: #145e59; background: #e8f5f3; border-color: #b9ded8; }

.inspection-builder-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .75fr); gap: 14px; margin-top: 22px; }
.inspection-select-panel { min-width: 0; border: 1px solid var(--line); border-radius: 6px; background: #fff; overflow: hidden; }
.builder-panel-head { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: #f7f9fa; }
.builder-panel-head h3 { margin: 0; font-size: 13px; }
.builder-panel-head p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.selection-count { min-width: 48px; padding: 5px 8px; color: var(--green); background: var(--green-soft); border: 1px solid #bfdfda; border-radius: 4px; font-size: 11px; font-weight: 700; text-align: center; }
.inspection-choice-list { max-height: 310px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 10px; overflow-y: auto; }
.inspection-device-toolbar { display: grid; grid-template-columns: minmax(150px, .8fr) minmax(180px, 1.2fr); gap: 8px; padding: 10px 10px 0; }
.inspection-device-toolbar select,
.inspection-device-search { min-width: 0; min-height: 36px; border: 1px solid var(--line-strong); border-radius: 4px; background: #fff; }
.inspection-device-toolbar select { padding: 0 9px; font-size: 10px; }
.inspection-device-search { display: flex; align-items: center; gap: 7px; padding: 0 9px; }
.inspection-device-search svg { width: 15px; flex: 0 0 auto; color: var(--muted); }
.inspection-device-search input { width: 100%; min-width: 0; border: 0; outline: 0; font-size: 10px; }
.inspection-batch-actions { grid-column: 1 / -1; display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.visible-selection-state { min-height: 30px; display: inline-flex; align-items: center; gap: 7px; padding: 0 8px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; background: #f8faf9; font-size: 9px; }
.visible-selection-state input { accent-color: var(--green); }
.selected-asset-summary { max-height: 76px; display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 10px 0; padding: 8px; overflow-y: auto; border: 1px dashed #cbd7d6; border-radius: 4px; background: #f8fbfa; }
.selected-asset-summary > span { color: var(--muted); font-size: 9px; }
.selected-asset-summary button { max-width: 220px; display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; color: #285a55; border: 1px solid #bfded9; border-radius: 4px; background: #eaf6f4; cursor: pointer; font-size: 9px; }
.selected-asset-summary button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selected-asset-summary button svg { width: 12px; flex: 0 0 auto; }
.inspection-empty-result { grid-column: 1 / -1; }
.schedule-rule-panel { min-height: 58px; display: flex; align-items: center; gap: 11px; margin-top: 12px; padding: 11px 13px; color: #224d5a; border: 1px solid #c9dce4; border-radius: 5px; background: #edf5f7; }
.schedule-rule-panel > span { width: 32px; height: 32px; display: grid; place-items: center; color: var(--blue); border-radius: 4px; background: #dcecf2; }
.schedule-rule-panel svg { width: 18px; }
.schedule-rule-panel strong, .schedule-rule-panel small { display: block; }
.schedule-rule-panel strong { font-size: 11px; }
.schedule-rule-panel small { margin-top: 4px; color: #60757d; font-size: 9px; }
.plan-table { margin-top: 12px; }
.plan-table table { min-width: 900px; }
.inspection-choice, .operator-choice { position: relative; min-width: 0; display: grid; align-items: center; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 5px; background: #fff; cursor: pointer; transition: border-color .14s ease, background .14s ease, box-shadow .14s ease; }
.inspection-choice { grid-template-columns: 20px 34px minmax(0,1fr); }
.operator-choice-list { display: grid; gap: 7px; padding: 10px; }
.operator-choice { min-height: 54px; grid-template-columns: 30px minmax(0,1fr) 20px; }
.inspection-choice:hover, .operator-choice:hover { border-color: #9fb8b5; background: #f8fbfa; }
.inspection-choice:has(input:checked), .operator-choice:has(input:checked) { border-color: #58a89f; background: #edf8f6; box-shadow: inset 0 0 0 1px rgba(8,122,112,.08); }
.inspection-choice input, .operator-choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice-indicator { width: 20px; height: 20px; display: grid; place-items: center; color: transparent; border: 1px solid #b8c4c9; border-radius: 4px; background: #fff; }
.choice-indicator svg { width: 13px; }
.inspection-choice:has(input:checked) .choice-indicator, .operator-choice:has(input:checked) .choice-indicator { color: #fff; background: var(--green); border-color: var(--green); }
.inspection-choice > span:last-child, .operator-choice > span:nth-child(3) { min-width: 0; }
.inspection-choice strong, .operator-choice strong { display: block; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.inspection-choice small, .operator-choice small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inspection-choice .device-icon { width: 34px; height: 34px; color: var(--blue); background: var(--blue-soft); border: 1px solid #cfe0ea; }
.assignment-section { margin-top: 6px; }
.device-assignment-list { display: grid; gap: 8px; }
.device-assignment-row { min-height: 62px; display: grid; grid-template-columns: minmax(200px,1fr) 20px minmax(150px,220px) 92px; align-items: center; gap: 12px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 5px; background: #fff; }
.device-assignment-row strong, .device-assignment-row small { display: block; }
.device-assignment-row strong { font-size: 11px; }
.device-assignment-row small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.device-assignment-row > svg { color: #8b989e; }
.device-assignment-row select { min-height: 36px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 4px; background: #fff; font-size: 11px; }
.assignment-lock { display: inline-flex; align-items: center; gap: 5px; color: #557169; font-size: 9px; }
.assignment-lock svg { width: 13px; }
.metric-batch-summary { display: flex; align-items: center; gap: 11px; padding: 13px 14px; color: #164f62; background: #eaf4f7; border: 1px solid #cbdfe7; border-radius: 5px; }
.metric-batch-summary > svg { width: 22px; color: var(--blue); }
.metric-batch-summary strong, .metric-batch-summary small { display: block; }
.metric-batch-summary strong { font-size: 12px; }
.metric-batch-summary small { margin-top: 4px; color: #607981; font-size: 9px; }
.metric-device-groups { display: grid; gap: 8px; margin-top: 10px; }
.metric-device-group { border: 1px solid var(--line); border-radius: 5px; background: #fff; overflow: hidden; }
.metric-device-group summary { min-height: 58px; display: grid; grid-template-columns: 34px minmax(0,1fr) auto 18px; align-items: center; gap: 10px; padding: 8px 12px; list-style: none; cursor: pointer; }
.metric-device-group summary::-webkit-details-marker { display: none; }
.metric-device-group summary strong, .metric-device-group summary small { display: block; }
.metric-device-group summary strong { font-size: 11px; }
.metric-device-group summary small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.metric-device-group summary em { color: var(--green); font-size: 10px; font-style: normal; font-weight: 700; }
.metric-device-group[open] summary { border-bottom: 1px solid var(--line); background: #f8faf9; }
.metric-device-group[open] summary > svg { transform: rotate(180deg); }
.metric-device-group .checklist { padding: 8px; }
.task-assignment-banner { display: grid; grid-template-columns: 38px 1fr 24px; align-items: center; gap: 11px; margin-bottom: 12px; padding: 12px 14px; color: #23434d; background: #eaf3f6; border: 1px solid #cadde4; border-radius: 5px; }
.task-assignment-banner .avatar { width: 38px; height: 38px; }
.task-assignment-banner strong, .task-assignment-banner small { display: block; }
.task-assignment-banner strong { font-size: 12px; }
.task-assignment-banner small { margin-top: 4px; color: #62777f; font-size: 9px; }
.task-assignment-banner > svg { color: var(--blue); }

.inspection-summary.five-columns { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.inspection-summary.six-columns { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.inspection-summary.seven-columns { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.workflow-section { margin-top: 18px; }
.workflow-section > .form-section { margin-top: 0; }
.workflow-history { display: grid; margin-top: 10px; padding: 4px 0; }
.transfer-timeline { min-width: 0; overflow-x: auto; }
.transfer-timeline .transfer-timeline-item { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(180px, auto); gap: 18px; align-items: start; min-width: 420px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.transfer-timeline .transfer-timeline-item::before { display: none; }
.transfer-timeline .transfer-timeline-item:last-child { border-bottom: 0; }
.transfer-timeline .transfer-timeline-item strong { display: block; font-size: 12px; line-height: 1.45; white-space: normal; word-break: keep-all; overflow-wrap: anywhere; }
.transfer-timeline .transfer-timeline-item small { color: var(--muted); font-size: 10px; line-height: 1.5; text-align: right; white-space: normal; }
.transfer-timeline .timeline-transfer-main { min-width: 0; }
.transfer-timeline .timeline-transfer-main p { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; overflow-wrap: anywhere; }
.transfer-device-section { margin-top: 18px; }
.transfer-device-table-wrap { margin-top: 8px; border: 1px solid var(--line); border-radius: 6px; }
.transfer-device-table { min-width: 980px; }
.transfer-device-table th, .transfer-device-table td { vertical-align: top; }
.transfer-device-table td strong, .transfer-device-table td small { display: block; }
.transfer-device-table td small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.transfer-device-table .address { display: inline-block; max-width: 220px; overflow-wrap: anywhere; }
.transfer-asset-filter { display: flex; align-items: center; gap: 8px; margin: 7px 0 8px; }
.transfer-asset-filter label { margin: 0; color: var(--muted); font-size: 10px; white-space: nowrap; }
.transfer-asset-filter select { flex: 1; min-width: 0; }
.port-mapping-lookup-toolbar { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(150px, 220px) minmax(150px, 190px); gap: 8px; align-items: center; margin-bottom: 12px; }
.port-mapping-lookup-toolbar .search-field { min-width: 0; }
.port-mapping-asset-summary { display: grid; grid-template-columns: minmax(190px, 1fr) 2fr; gap: 14px; align-items: center; margin: 14px 0 18px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel-soft); }
.port-mapping-asset-summary > div { min-width: 0; }
.port-mapping-asset-summary strong, .port-mapping-asset-summary small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.port-mapping-asset-summary strong { color: var(--ink); font-size: 13px; }
.port-mapping-asset-summary small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.port-mapping-asset-summary dl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0; }
.port-mapping-asset-summary dl div { min-width: 0; }
.port-mapping-asset-summary dt { color: var(--muted); font-size: 9px; }
.port-mapping-asset-summary dd { margin: 3px 0 0; color: var(--ink); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.port-mapping-lookup-summary { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0 0 10px; color: var(--muted); font-size: 11px; }
.port-mapping-lookup-summary strong { color: var(--text); font-size: 13px; }
.port-mapping-conflict-text, .port-mapping-conflict-text strong { color: var(--red); }
.port-mapping-lookup-results { max-height: 430px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; }
.port-mapping-lookup-table { min-width: 980px; }
.port-mapping-conflict-row td { background: var(--red-soft); }
@media (max-width: 900px) { .port-mapping-lookup-toolbar { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .port-mapping-asset-summary { grid-template-columns: 1fr; } .port-mapping-asset-summary dl { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.transfer-asset-choice-list { max-height: 210px; display: grid; gap: 7px; overflow-y: auto; padding: 8px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--panel-soft); }
.transfer-asset-choice { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 8px 9px; border: 1px solid var(--line); border-radius: 4px; background: #fff; cursor: pointer; }
.transfer-asset-choice:hover { border-color: #8bbab4; background: #f5fbfa; }
.transfer-asset-choice:has(input:checked) { border-color: var(--green); background: var(--green-soft); }
.transfer-asset-choice input { width: 18px; min-width: 18px; height: 18px; min-height: 18px; flex: 0 0 18px; margin: 0; padding: 0; border: 0; accent-color: var(--green); }
.transfer-asset-choice span, .transfer-asset-choice strong, .transfer-asset-choice small { min-width: 0; display: block; }
.transfer-asset-choice strong { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.transfer-asset-choice small { margin-top: 3px; color: var(--muted); font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.transfer-new-asset-editor { margin-top: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel-soft); }
.transfer-new-asset-editor + .transfer-new-asset-editor { margin-top: 8px; }
.transfer-new-asset-editor .account-editor-head { margin-bottom: 10px; }
.transfer-new-asset-editor h4 { margin: 0 0 8px; color: var(--text); font-size: 12px; }
.workflow-event { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 11px; min-width: 0; padding: 7px 0 15px; }
.workflow-event:not(:last-child)::before { content: ""; position: absolute; top: 37px; bottom: -2px; left: 16px; width: 1px; background: #d8e1e4; }
.workflow-event-icon { position: relative; z-index: 1; width: 34px; height: 34px; display: grid; place-items: center; color: var(--blue); background: var(--blue-soft); border: 1px solid #c9dde8; border-radius: 50%; }
.workflow-event-icon svg { width: 15px; height: 15px; }
.workflow-event.returned .workflow-event-icon { color: var(--red); background: var(--red-soft); border-color: #efc9cf; }
.workflow-event.completed .workflow-event-icon { color: var(--green); background: var(--green-soft); border-color: #bfddd8; }
.workflow-event-body { min-width: 0; padding-top: 1px; }
.workflow-event-title { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.workflow-event-title strong { font-size: 11px; }
.workflow-transition { padding: 2px 6px; color: #52646d; background: #f1f4f5; border-radius: 3px; font-size: 9px; }
.workflow-event-body small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.workflow-event-body p { margin: 6px 0 0; color: #35464e; font-size: 10px; line-height: 1.6; overflow-wrap: anywhere; }
.order-treatment-highlight { margin-top: 18px; padding: 17px 19px; border: 1px solid #b9dcd5; border-left: 5px solid var(--green); border-radius: 7px; background: #f1f8f6; }
.order-treatment-highlight .form-section { margin: 0 0 9px; border-top: 0; }
.order-treatment-highlight .form-section h3 { font-size: 17px; }
.order-treatment-highlight .form-section p { margin-top: 4px; font-size: 11px; }
.treatment-content { color: var(--ink); font-size: 15px; line-height: 1.9; overflow-wrap: anywhere; }
.order-evidence-section { margin-top: 18px; }
.order-evidence-section .form-section { margin-bottom: 8px; }
.order-evidence-section .form-section h3 { font-size: 15px; }
.order-evidence-section .form-section p { margin-top: 4px; color: var(--muted); font-size: 10px; }
.knowledge-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.knowledge-tags span { padding: 4px 7px; color: #345f5a; background: var(--green-soft); border: 1px solid #c7e1dc; border-radius: 3px; font-size: 9px; }
.knowledge-tags.detail-tags { margin-top: 16px; }
.knowledge-detail-section { margin-top: 18px; }
.knowledge-detail-section h3 { margin: 0; font-size: 13px; }
.knowledge-detail-section .audit-note { white-space: normal; overflow-wrap: anywhere; }
.knowledge-solution { color: var(--ink); background: #f7faf9; border-left: 3px solid var(--green); }
.fault-context { margin-top: 18px; padding: 0 16px 16px; border: 1px solid var(--line); border-radius: 5px; background: #fbfcfc; }
.fault-context > .form-section:first-child { margin-top: 0; border-top: 0; }
.fault-description { margin-top: 16px; padding: 16px 18px; color: #26363d; background: #f1f5f6; border-left: 4px solid var(--red); border-radius: 5px; font-size: 16px; font-weight: 500; line-height: 1.9; overflow-wrap: anywhere; }
.reviewer-choice-list { display: grid; gap: 8px; margin-top: 8px; }
.reviewer-choice .choice-order { width: 22px; min-width: 22px; height: 22px; display: grid; place-items: center; color: var(--blue); background: var(--blue-soft); border-radius: 50%; font-size: 11px; font-weight: 700; }
.reviewer-sequence-hint { display: block; margin-top: 6px; color: var(--muted); font-size: 10px; }
.integration-card-body { min-width: 0; flex: 1; }
.integration-config-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center; gap: 10px; margin-top: 10px; min-width: 0; }
.integration-config-fields label { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; color: var(--muted); font-size: 11px; }
.integration-config-fields > label:first-child, .integration-config-fields > input[data-integration-endpoint] { grid-column: 1 / -1; }
.integration-config-fields > input, .integration-config-fields > select { width: 100%; min-width: 0; }
.integration-advanced-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; grid-column: 1 / -1; padding: 12px; border: 1px solid #d9e5ea; border-radius: 7px; background: #fbfdfe; }
.integration-field { display: grid; gap: 5px; min-width: 0; }
.integration-field label { color: #58717e; font-size: 10px; font-weight: 700; }
.integration-field input, .integration-field select { width: 100%; min-width: 0; }
.integration-save-actions { justify-content: flex-end; margin-top: 12px; }

/* Product UI v4: desktop operations console */
:root {
  --bg: #f3f5f7;
  --panel: #ffffff;
  --panel-soft: #f7f9fa;
  --ink: #172229;
  --muted: #66757e;
  --line: #dde4e8;
  --line-strong: #c8d2d8;
  --sidebar: #121a1e;
  --sidebar-2: #1b272c;
  --green: #087a70;
  --green-soft: #e6f4f1;
  --blue: #256f9c;
  --blue-soft: #e8f2f8;
  --orange: #b65d2d;
  --orange-soft: #fff0e7;
  --red: #bd3d4a;
  --red-soft: #fcecef;
  --yellow: #8a6714;
  --yellow-soft: #fff6dc;
  --shadow: 0 10px 28px rgba(29, 46, 56, .08);
  --sidebar-width: 224px;
  --radius: 7px;
  font-family: "Segoe UI", "Microsoft YaHei UI", "PingFang SC", Arial, sans-serif;
}

html { background: var(--bg); }
body { color: var(--ink); background: var(--bg); }
body, button, input, select, textarea { letter-spacing: 0; }
::selection { color: #fff; background: #167f77; }

.selection-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; max-height: 300px; overflow: auto; padding: 2px; }
.selection-card { position: relative; cursor: pointer; }
.selection-card input { position: absolute; opacity: 0; pointer-events: none; }
.selection-card > span { min-height: 76px; display: grid; grid-template-columns: 28px 1fr; grid-template-rows: auto auto; align-items: center; gap: 2px 10px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; transition: .18s ease; }
.selection-card svg { grid-row: 1 / 3; width: 20px; color: var(--muted); }
.selection-card strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.selection-card small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.selection-card input:checked + span { border-color: #68b9ab; background: #edf8f6; box-shadow: 0 0 0 2px rgba(22,127,119,.08); }
.selection-card input:checked + span svg { color: var(--green); }
.change-plan-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.change-plan-grid section { min-height: 120px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #f8faf9; }
.change-plan-grid section h4 { margin: 0 0 8px; color: var(--text); font-size: 11px; }
.change-plan-grid section p { margin: 0; color: #536965; font-size: 10px; line-height: 1.7; }
.change-plan-grid .danger-zone { border-color: #ead0d2; background: #fff8f8; }
.change-filter-toolbar { align-items: center; }
.change-filters { min-width: 0; flex: 1 1 auto; }
.change-filters .search-field { min-width: 280px; flex: 1 1 300px; }
.change-filters .select { flex: 0 1 145px; }
.change-filter-count { flex: 0 0 auto; color: var(--muted); font-size: 10px; white-space: nowrap; }
.change-table { min-width: 1180px; table-layout: auto; }
.change-table th, .change-table td { vertical-align: middle; }
.change-table th:not(:first-child), .change-table td:not(:first-child) { text-align: center; }
.change-table th:nth-child(2), .change-table td:nth-child(2) { min-width: 210px; text-align: left; }
.change-table th:nth-child(3), .change-table td:nth-child(3) { min-width: 210px; text-align: left; }
.change-table th:nth-child(5), .change-table td:nth-child(5) { min-width: 145px; text-align: left; }
.change-table th:nth-child(6), .change-table td:nth-child(6) { min-width: 175px; text-align: left; }
.change-table th:last-child, .change-table td:last-child { min-width: 126px; }
.change-table .table-actions { justify-content: center; }
.change-asset-tags { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; white-space: normal; }
.change-asset-tags .status { max-width: 112px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.change-asset-tags small { color: var(--muted); font-size: 9px; }
.change-window { align-items: flex-start; }

.change-editor-body { background: #f7f9fa; }
.change-form-grid, .change-plan-form { padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.change-form-grid .field label { min-height: 18px; display: flex; align-items: center; }
.change-form-grid .field input, .change-form-grid .field select { height: 42px; }
.change-asset-heading { margin-bottom: 12px; }
.change-asset-picker { padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.change-asset-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.change-asset-controls .search-field { min-width: 280px; flex: 1 1 300px; }
.change-asset-controls .select { min-width: 160px; }
.change-asset-selection-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 13px 0 10px; padding: 9px 11px; border-radius: 6px; color: #275d56; background: var(--green-soft); }
.change-asset-selection-summary strong { font-size: 11px; }
.change-asset-selection-summary span { color: var(--muted); font-size: 9px; }
.change-asset-selection { max-height: none; overflow: visible; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.change-asset-card > span { min-height: 92px; grid-template-rows: auto auto auto; align-content: center; }
.change-asset-card svg { grid-row: 1 / 4; }
.change-asset-card strong { overflow: visible; line-height: 1.45; white-space: normal; }
.change-asset-card small { line-height: 1.4; white-space: normal; }
.change-asset-card em { overflow: hidden; color: #839098; font-size: 9px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.change-plan-form { margin-top: 18px; }
.maintenance-overview { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.integration-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.integration-grid article { display: grid; grid-template-columns: 36px minmax(0, 1fr); align-items: start; gap: 10px; min-height: 82px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #f8faf9; overflow: visible; }
.integration-grid article > div { min-width: 0; display: grid; gap: 3px; }
.integration-grid article > .status { grid-column: 2; justify-self: start; margin-top: 2px; }
.integration-grid strong { font-size: 11px; }
.integration-grid small { color: var(--muted); font-size: 9px; line-height: 1.45; }
.integration-grid code { overflow: hidden; color: #48645f; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 900px) {
  .change-plan-grid, .maintenance-overview, .integration-grid { grid-template-columns: 1fr; }
  .selection-grid { grid-template-columns: 1fr; }
  .change-filter-toolbar { align-items: stretch; flex-direction: column; }
  .change-filter-count { padding: 0 2px; }
  .change-asset-selection { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .change-filters, .change-asset-controls { display: grid; grid-template-columns: 1fr; width: 100%; }
  .change-filters .search-field, .change-filters .select, .change-asset-controls .search-field, .change-asset-controls .select { width: 100%; min-width: 0; }
  .change-asset-selection { grid-template-columns: 1fr; }
  .change-asset-selection-summary { align-items: flex-start; flex-direction: column; }
}
* { scrollbar-color: #b9c4ca transparent; scrollbar-width: thin; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: #bcc7cc; border: 2px solid transparent; border-radius: 8px; background-clip: padding-box; }
*::-webkit-scrollbar-track { background: transparent; }

.sidebar { width: var(--sidebar-width); padding: 18px 12px 14px; color: #dce5e9; background: var(--sidebar); border-right: 1px solid #28343a; box-shadow: 8px 0 28px rgba(12, 21, 25, .08); }
.brand { min-height: 64px; gap: 11px; padding: 0 10px 18px; border-bottom-color: rgba(255,255,255,.09); }
.brand-mark { width: 38px; height: 38px; border-color: #39645f; border-radius: 7px; background: #16302f; }
.brand-mark span { background: #44c7b5; }
.brand-copy strong { font-size: 19px; font-weight: 720; }
.brand-copy small { margin-top: 4px; color: #8fa2aa; font-size: 10px; }
.nav-list { gap: 4px; margin-top: 18px; }
.nav-item { position: relative; min-height: 44px; gap: 12px; padding: 0 12px; border-radius: 6px; color: #a8b6bc; }
.nav-item::before { content: ""; position: absolute; inset: 9px auto 9px 0; width: 3px; border-radius: 0 3px 3px 0; background: transparent; }
.nav-item:hover { color: #f1f6f7; background: #1d282d; }
.nav-item.active { color: #fff; background: #213136; box-shadow: none; }
.nav-item.active::before { background: #45c8b5; }
.nav-item.active svg { color: #57d3c1; }
.nav-item span { font-size: 13px; font-weight: 520; }
.nav-item svg { width: 18px; height: 18px; stroke-width: 1.75; }
.nav-item em { min-width: 24px; padding: 3px 7px; color: #b8c7c3; background: #29383a; font-size: 10px; }
.nav-item em.warn { color: #ffd4b7; background: #573624; }
.sidebar-footer { padding-top: 12px; border-top-color: rgba(255,255,255,.08); }
.system-state { padding: 10px 12px; }
.system-state strong { font-size: 11px; }
.system-state small { color: #71858d; font-size: 9px; }

.page-shell { margin-left: var(--sidebar-width); }
.topbar { height: 68px; padding: 0 30px; background: rgba(255,255,255,.96); border-bottom-color: #dce3e7; box-shadow: 0 1px 0 rgba(23,34,41,.03); backdrop-filter: blur(14px); }
.topbar h1 { color: #121c22; font-size: 18px; font-weight: 720; }
.topbar p { margin-top: 4px; color: #71808a; font-size: 10px; }
.global-search { width: min(360px, 30vw); height: 38px; padding: 0 12px; color: #7a8992; background: #f4f6f7; border-color: #d8e0e4; border-radius: 6px; }
.global-search:focus-within { background: #fff; border-color: #82aaa6; box-shadow: 0 0 0 3px rgba(8,122,112,.09); }
.global-search input { font-size: 11px; }
.icon-btn { width: 38px; height: 38px; border-color: #d7dfe3; border-radius: 6px; }
.icon-btn:hover { color: var(--green); background: #f2f7f6; border-color: #b9ceca; }
.profile-btn { height: 44px; padding-right: 3px; }
.profile-btn:hover { background: #f5f7f8; border-radius: 6px; }
.profile-copy strong { font-size: 11px; }
.profile-copy small { font-size: 9px; }
.avatar { background: #087a70; box-shadow: inset 0 0 0 1px rgba(255,255,255,.16); }

main { min-height: calc(100vh - 68px); padding: 26px 30px 44px; background: var(--bg); }
#app:focus { outline: none; }
.view { width: 100%; min-width: 0; max-width: 1720px; }
.section-heading { align-items: center; margin-bottom: 18px; }
.section-heading h2 { color: #111c22; font-size: 20px; font-weight: 730; line-height: 1.25; }
.section-heading p { margin-top: 6px; color: #6c7a83; font-size: 11px; }
.section-actions { gap: 9px; }

.btn { min-height: 36px; gap: 7px; padding: 0 13px; color: #293840; background: #fff; border-color: #cad4da; border-radius: 6px; font-size: 11px; font-weight: 650; box-shadow: 0 1px 2px rgba(25,40,49,.03); }
.btn:hover { color: #152229; background: #f8fafb; border-color: #9fadb5; }
.btn.primary { color: #fff; background: #087a70; border-color: #087a70; box-shadow: 0 4px 10px rgba(8,122,112,.17); }
.btn.primary:hover { background: #076a62; border-color: #076a62; transform: translateY(-1px); }
.btn.small { min-height: 31px; padding: 0 10px; font-size: 10px; }

.subtabs { gap: 24px; margin: 0 0 16px; }
.subtab { min-height: 42px; color: #71808a; font-size: 11px; }
.subtab.active { color: #172229; font-weight: 700; }
.subtab.active::after { height: 3px; border-radius: 3px 3px 0 0; background: #087a70; }

.inspection-summary { min-width: 0; gap: 12px; margin-bottom: 16px; }
.summary-strip { position: relative; min-width: 0; min-height: 82px; gap: 13px; overflow: hidden; padding: 15px 16px; background: #fff; border: 1px solid #dbe3e7; border-radius: 7px; box-shadow: 0 3px 12px rgba(29,46,56,.045); }
.summary-strip::after { content: ""; position: absolute; inset: auto 0 0; height: 2px; background: var(--green); opacity: .78; }
.summary-strip.blue::after { background: var(--blue); }
.summary-strip.orange::after { background: var(--orange); }
.summary-strip.red::after { background: var(--red); }
.summary-strip .metric-icon { width: 38px; height: 38px; border: 0; border-radius: 7px; }
.summary-strip .metric-icon svg { width: 18px; height: 18px; }
.summary-strip strong { color: #152129; font-size: 22px; font-weight: 720; line-height: 1; font-variant-numeric: tabular-nums; }
.summary-strip small { margin-top: 6px; color: #75838b; font-size: 10px; }

.toolbar { min-height: 56px; gap: 14px; margin-bottom: 12px; padding: 9px 11px; background: #fff; border: 1px solid #dbe3e7; border-radius: 7px; box-shadow: 0 2px 8px rgba(29,46,56,.03); }
.filters { gap: 8px; }
.search-field, .select { min-height: 36px; border-color: #cbd5da; border-radius: 6px; background: #fbfcfc; font-size: 11px; }
.search-field { min-width: 260px; padding: 0 11px; }
.search-field:focus-within, .select:focus { background: #fff; border-color: #77a7a2; box-shadow: 0 0 0 3px rgba(8,122,112,.08); outline: 0; }
.search-field input { background: transparent; font-size: 11px; }
.select { min-width: 128px; color: #3d4d56; }
.segmented { padding: 3px; background: #edf1f3; border-color: #d9e1e5; border-radius: 6px; }
.segment { min-height: 29px; border-radius: 4px; font-size: 10px; }

.panel { background: #fff; border-color: #dbe3e7; border-radius: 7px; box-shadow: 0 4px 16px rgba(29,46,56,.045); }
.panel-header { min-height: 58px; padding: 0 18px; background: #fff; border-bottom-color: #e0e6e9; }
.panel-title h3 { color: #172229; font-size: 13px; }
.panel-body { padding: 18px; }
.panel-body.flush { padding: 0; }
.panel .data-table-wrap { border: 0; border-radius: inherit; box-shadow: none; }
.data-table { min-width: 980px; }
.data-table th { height: 43px; padding: 0 15px; color: #5e6e77; background: #f5f7f8; border-bottom: 1px solid #d8e0e4; font-size: 10px; font-weight: 680; }
.data-table td { height: 60px; padding: 10px 15px; color: #26353d; border-bottom-color: #e8edef; font-size: 11px; }
.data-table tbody tr { position: relative; }
.data-table tbody tr:hover { background: #f7faf9; }
.data-table tbody tr.task-row.warning { box-shadow: inset 3px 0 #d2864c; }
.data-table tbody tr.task-row.info { box-shadow: inset 3px 0 #4a8eb5; }
.data-table tbody tr.task-row.danger { box-shadow: inset 3px 0 #cb5964; }
.cell-stack { line-height: 1.25; }
.cell-stack strong { color: #172229; font-size: 11px; font-weight: 680; }
.cell-stack small { margin-top: 5px; color: #79868d; font-size: 9px; }
.cell-primary { gap: 9px; }
.avatar.mini { width: 25px; height: 25px; margin-right: 0; border: 0; font-size: 9px; }
.progress-cell { min-width: 132px; }
.progress-label { margin-bottom: 7px; font-size: 9px; }
.progress-label b { color: #52616a; font-variant-numeric: tabular-nums; }
.progress-cell .bar-track { height: 5px; background: #e9eef0; }
.bar-fill { background: #0b8277; }
.status { min-height: 24px; padding: 0 9px; border: 1px solid #c8e3de; border-radius: 12px; font-size: 10px; font-weight: 600; }
.status.warning { border-color: #efd4c1; }
.status.info { border-color: #c9dfea; }
.status.danger { border-color: #edcbd0; }
.table-actions { gap: 5px; }
.table-action { width: 31px; height: 31px; border: 1px solid transparent; border-radius: 5px; }
.table-action:hover { background: #f0f4f5; border-color: #dce3e6; }
.pagination { min-height: 52px; padding: 0 15px; background: #fbfcfc; border-top-color: #e1e7ea; font-size: 10px; }
.page-btn { width: 30px; height: 30px; border-color: #d2dbe0; border-radius: 5px; font-size: 10px; }

.modal-layer { background: rgba(11,19,23,.62); backdrop-filter: blur(3px); }
.modal { border: 1px solid rgba(255,255,255,.48); border-radius: 8px; box-shadow: 0 28px 86px rgba(5,14,18,.34); }
.modal-header { min-height: 72px; padding: 0 22px; background: #fbfcfc; }
.modal-header h2 { font-size: 18px; }
.modal-body { padding: 22px; }
.modal-footer { min-height: 68px; padding: 0 22px; background: #fbfcfc; }
.field label { color: #34434b; font-size: 11px; }
.field input, .field select, .field textarea { min-height: 40px; border-color: #cbd5da; border-radius: 6px; font-size: 11px; }
.field textarea { min-height: 88px; }
.form-section h3 { font-size: 13px; }
.upload-zone { border-radius: 6px; }
.toast { padding: 13px; background: #172429; border: 1px solid #304148; border-radius: 7px; box-shadow: 0 16px 40px rgba(8,18,22,.24); }

.import-guide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid #d7e1e4;
  border-radius: 6px;
  background: #f7faf9;
}
.import-guide > div { display: flex; align-items: center; gap: 12px; min-width: 0; }
.import-guide > div > svg { width: 22px; color: var(--primary); flex: 0 0 auto; }
.import-guide strong, .import-guide small { display: block; }
.import-guide small { margin-top: 4px; color: var(--muted); line-height: 1.5; }
.audit-note.success-note { border-color: #b9dcd5; background: #f1f8f6; color: #1f665d; }
.audit-note.import-error { border-color: #edcbd0; background: #fff5f6; color: #a43b49; }

@media (max-width: 1180px) {
  :root { --sidebar-width: 210px; }
  .inspection-summary.five-columns, .inspection-summary.six-columns, .inspection-summary.seven-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .global-search { width: min(290px, 27vw); }
  main { padding-right: 22px; padding-left: 22px; }
}

@media (max-width: 840px) {
  :root { --sidebar-width: 224px; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .page-shell { margin-left: 0; }
  .topbar { height: 62px; padding: 0 15px; }
  .topbar h1 { font-size: 15px; }
  .topbar p, .global-search, .profile-copy, .profile-btn > svg { display: none; }
  main { min-height: calc(100vh - 62px); padding: 18px 15px 30px; }
  .section-heading { align-items: flex-start; }
  .section-heading h2 { font-size: 18px; }
  .inspection-summary.five-columns, .inspection-summary.six-columns, .inspection-summary.seven-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.log-table { min-width: 1120px; }
.log-table th:nth-child(1) { width: 158px; }
.log-table th:nth-child(2) { width: 72px; }
.log-table th:nth-child(3) { width: 140px; }
.log-table th:nth-child(4) { width: 130px; }
.log-table th:nth-child(5) { width: 180px; }
.log-table th:nth-child(7) { width: 116px; }
.log-detail { display: block; max-width: 360px; color: var(--muted); line-height: 1.55; overflow-wrap: anywhere; }

/* Dashboard panels share one grid so row and column edges stay aligned. */
.dashboard-grid {
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, .75fr);
  grid-template-areas:
    "progress todo"
    "risk health";
  align-items: stretch;
}
.dashboard-grid > .panel { height: 100%; margin: 0; overflow: hidden; }
.dashboard-progress-card { grid-area: progress; }
.dashboard-todo-card { grid-area: todo; }
.dashboard-risk-card { grid-area: risk; }
.dashboard-health-card { grid-area: health; }
.dashboard-progress-card .panel-body,
.dashboard-todo-card .panel-body { min-height: 250px; }
.dashboard-risk-card .panel-body,
.dashboard-health-card .panel-body { min-height: 300px; }
.dashboard-todo-card .mini-timeline,
.dashboard-todo-card .empty-state { height: 100%; }
.dashboard-todo-card .empty-state { min-height: 214px; }
.dashboard-risk-card .empty-state { min-height: 255px; }
.dashboard-risk-table { min-width: 0; table-layout: fixed; }
.dashboard-risk-table th:nth-child(1) { width: 30%; }
.dashboard-risk-table th:nth-child(2) { width: 14%; }
.dashboard-risk-table th:nth-child(3) { width: 15%; }
.dashboard-risk-table th:nth-child(4) { width: 17%; }
.dashboard-risk-table th:nth-child(5) { width: 11%; }
.dashboard-risk-table th:nth-child(6) { width: 13%; }
.dashboard-risk-table th,
.dashboard-risk-table td { overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 1100px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
    grid-template-areas: "progress" "todo" "risk" "health";
  }
  .dashboard-grid > .panel { height: auto; }
}

@media (max-width: 960px) {
  .inspection-builder-grid { grid-template-columns: 1fr; }
  .operator-choice-list { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 841px) and (max-width: 960px) {
  .inspection-summary.five-columns, .inspection-summary.six-columns, .inspection-summary.seven-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .section-heading { flex-direction: column; align-items: stretch; gap: 12px; }
  .section-actions { width: 100%; }
  .section-actions .btn { flex: 1 1 auto; }
  .inspection-summary.five-columns, .inspection-summary.six-columns, .inspection-summary.seven-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inspection-choice-list, .operator-choice-list { grid-template-columns: 1fr; }
  .inspection-device-toolbar { grid-template-columns: 1fr; }
  .inspection-batch-actions { grid-column: 1; }
  .device-assignment-row { grid-template-columns: 1fr 1fr; }
  .device-assignment-row > svg { display: none; }
  .assignment-lock { justify-self: end; }
  .builder-panel-head { align-items: flex-start; }
  .inspection-readiness { grid-template-columns: 1fr; gap: 8px; }
  .upload-item { grid-template-columns: 28px minmax(0, 1fr) 42px; }
  .upload-item .attachment-actions { grid-column: 2 / 4; flex-wrap: wrap; justify-content: flex-start; }
  .evidence-paste-zone { grid-template-columns: 26px minmax(0, 1fr); }
  .evidence-paste-zone .btn { grid-column: 1 / -1; width: 100%; }
  .attachment-preview-layer { align-items: flex-end; padding: 0; }
  .attachment-preview-shell { width: 100%; height: 94vh; border-radius: 6px 6px 0 0; }
  .attachment-preview-shell > header { min-height: 62px; padding: 0 12px; }
  .attachment-preview-shell > header strong { max-width: 72vw; }
  .attachment-preview-text { padding: 18px 16px; }
  .attachment-preview-table-wrap { padding: 8px; }
}

@media (max-width: 840px) and (min-width: 641px) {
  .inspection-checklist-head,
  .inspection-checklist .check-row { grid-template-columns: 44px minmax(180px, 1fr) 140px 140px; column-gap: 10px; }
}

@media (max-width: 640px) {
  .inspection-checklist-head { display: none; }
  .inspection-checklist .check-row { grid-template-columns: 36px minmax(0, 1fr); gap: 10px; min-height: 0; padding: 12px; }
  .inspection-checklist .metric-complete { grid-column: 1; grid-row: 1; align-self: center; }
  .inspection-checklist .inspection-metric-copy { grid-column: 2; grid-row: 1; }
  .inspection-checklist .inspection-measured,
  .inspection-checklist .inspection-result-cell { grid-column: 2; width: 100%; }
}

/* Keep the application frame fluid while wide operational tables scroll inside their own panels. */
.page-shell, main, .view, .topbar-left > div, .section-heading > div, .toolbar > * { min-width: 0; }

@media (max-width: 840px) {
  .topbar-left { flex: 1 1 auto; }
  .topbar-actions { flex: 0 0 auto; }
  .subtabs, .segmented { max-width: 100%; overflow-x: auto; }
  .subtab, .segment { flex: 0 0 auto; }
  .toolbar { align-items: stretch; flex-wrap: wrap; }
  .filters { min-width: 0; max-width: 100%; }
  .inspection-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inspection-filters .search-field { min-width: 0; grid-column: 1 / -1; }
  .inspection-filters .select { min-width: 0; width: 100%; }
  .inspection-selection-bar { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 640px) {
  .section-actions, .filters { width: 100%; }
  .section-actions .btn { min-width: 0; }
  .inspection-filters { grid-template-columns: 1fr; }
  .inspection-filters .search-field { grid-column: 1; }
  .inspection-selection-bar, .inspection-selection-bar > div { width: 100%; flex-wrap: wrap; }
  .pagination { min-height: 52px; flex-wrap: wrap; padding-top: 9px; padding-bottom: 9px; }
  .modal-header { min-height: 64px; padding: 10px 15px; }
  .modal-header > div { min-width: 0; }
  .modal-header h2, .modal-header p { overflow-wrap: anywhere; }
  .modal-body { padding: 16px 15px; }
  .modal-footer { min-height: 62px; flex-wrap: wrap; padding: 10px 15px; }
  .settings-nav { max-width: 100%; }
}

@media (max-width: 420px) {
  .topbar { padding-right: 10px; padding-left: 10px; }
  .topbar-actions { gap: 2px; }
  .section-actions { display: grid; grid-template-columns: 1fr; }
  .section-actions .btn { width: 100%; }
  .setting-row { align-items: flex-start; flex-direction: column; }
  .setting-row > :last-child { max-width: 100%; }
}
/* Huawei model-specific inspection templates */
.official-template-notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 14px 0 18px;
  padding: 15px 17px;
  border: 1px solid color-mix(in srgb, var(--green) 24%, var(--line));
  border-radius: 14px;
  background: color-mix(in srgb, var(--green) 7%, var(--panel));
}

.official-template-notice > svg { width: 22px; height: 22px; color: var(--green); flex: 0 0 auto; }
.official-template-notice strong, .official-template-notice small { display: block; }
.official-template-notice small { margin-top: 4px; color: var(--muted); line-height: 1.6; }
.official-template-grid { align-items: stretch; }
.official-template-card { display: flex; flex-direction: column; min-height: 390px; }
.official-template-card.template-disabled { opacity: .68; }

.template-application {
  display: grid;
  gap: 7px;
  margin: 14px 0;
  padding: 12px;
  border-radius: 10px;
  background: var(--panel-soft);
}

.template-application span { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 8px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.template-application b { color: var(--text); font-weight: 650; }

.template-source {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.5;
}

.template-source svg, .profile-source-inline svg { width: 16px; height: 16px; color: var(--green); flex: 0 0 auto; margin-top: 1px; }
.template-source a, .profile-source-inline a { color: var(--green); text-decoration: none; }
.template-source a:hover, .profile-source-inline a:hover { text-decoration: underline; }
.official-template-card .template-card-foot { margin-top: auto; }

.profile-source-inline {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--green) 5%, var(--panel));
  font-size: 12px;
}

.official-metric-row > div small { display: block; margin-top: 4px; line-height: 1.45; }

.template-type-choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.template-type-choice {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  cursor: pointer;
}

.template-type-choice:has(input:checked) { border-color: var(--green); background: color-mix(in srgb, var(--green) 7%, var(--panel)); }
.template-source-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; color: var(--muted); font-size: 12px; }
.template-metric-list { display: grid; gap: 12px; }

.template-metric-editor {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 38px;
  gap: 12px;
  align-items: start;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--panel);
}

.template-metric-index {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--green) 10%, var(--panel));
  color: var(--green);
  font-weight: 750;
  font-size: 12px;
}

.template-metric-fields textarea { min-height: 68px; }
.template-metric-options { display: flex; align-items: center; justify-content: space-between; gap: 14px; color: var(--muted); font-size: 12px; }
.template-metric-options > div { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.template-metric-options label { display: inline-flex; align-items: center; gap: 5px; }
.table-subtext { display: block; max-width: 380px; margin-top: 4px; color: var(--muted); line-height: 1.45; font-weight: 400; }

@media (max-width: 760px) {
  .template-metric-editor { grid-template-columns: 34px minmax(0, 1fr); }
  .template-metric-editor > .table-action { grid-column: 2; justify-self: end; }
  .template-metric-options, .template-source-actions { align-items: flex-start; flex-direction: column; }
}

/* AI operations assistant */
.ai-view { max-width: 1480px; }
.ai-status-bar {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding: 11px 15px;
  color: #236158;
  border: 1px solid #b8ddd6;
  border-radius: 8px;
  background: #edf8f6;
}
.ai-status-bar.warning { color: #8a5a27; border-color: #ead4bb; background: #fff8ee; }
.ai-status-bar > div { min-width: 0; display: flex; align-items: center; gap: 11px; }
.ai-status-bar > div > svg { width: 22px; height: 22px; flex: 0 0 auto; }
.ai-status-bar strong, .ai-status-bar small { display: block; }
.ai-status-bar strong { font-size: 12px; }
.ai-status-bar small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.ai-mode-bar { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.ai-mode-bar > span { color: var(--muted); font-size: 10px; text-align: right; }
.ai-mode-switch button { min-height: 32px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 11px; color: var(--muted); border: 0; border-radius: 4px; background: transparent; font-size: 10px; }
.ai-mode-switch button svg { width: 14px; height: 14px; }
.ai-mode-switch button.active { color: #145f58; background: #fff; box-shadow: 0 1px 4px rgba(20,30,27,.13); }
.ai-mode-switch button:disabled { opacity: .45; cursor: not-allowed; }
.ai-console { overflow: hidden; }
.ai-conversation {
  height: clamp(440px, calc(100vh - 360px), 720px);
  min-height: 420px;
  overflow-y: auto;
  padding: 24px;
  background: linear-gradient(180deg, #fbfcfc 0%, #f6f8f9 100%);
}
.ai-empty { min-height: 360px; display: flex; align-items: center; justify-content: center; flex-direction: column; text-align: center; color: var(--muted); }
.ai-empty > span { width: 54px; height: 54px; display: grid; place-items: center; margin-bottom: 14px; color: var(--green); border: 1px solid #c6e0db; border-radius: 15px; background: #edf8f6; }
.ai-empty > span svg { width: 25px; height: 25px; }
.ai-empty strong { color: var(--ink); font-size: 16px; }
.ai-empty small { margin-top: 7px; font-size: 11px; }
.ai-suggestions { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 20px; }
.ai-suggestions button { min-height: 34px; padding: 0 12px; color: #49606b; border: 1px solid var(--line); border-radius: 17px; background: #fff; font-size: 10px; }
.ai-suggestions button:hover { color: var(--green); border-color: #9bc8c0; background: #f2faf8; }
.ai-message { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 11px; max-width: 980px; margin-bottom: 22px; }
.ai-message.user { margin-left: auto; }
.ai-message > div { min-width: 0; }
.ai-message header { min-height: 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ai-message header strong { font-size: 11px; }
.ai-message header small { color: var(--muted); font-size: 9px; }
.ai-avatar { width: 34px; height: 34px; display: grid; place-items: center; color: #fff; border-radius: 9px; background: linear-gradient(145deg, #087a70, #2c789d); box-shadow: 0 5px 14px rgba(8,122,112,.18); }
.ai-avatar svg { width: 17px; height: 17px; }
.ai-message.user > .avatar { width: 34px; height: 34px; margin: 0; }
.ai-answer { margin-top: 5px; padding: 13px 15px; color: #263740; border: 1px solid #dce4e7; border-radius: 4px 12px 12px 12px; background: #fff; box-shadow: 0 3px 12px rgba(25,42,50,.04); }
.ai-message.user .ai-answer { border-radius: 12px 4px 12px 12px; background: #eef8f6; border-color: #c7e0db; }
.ai-answer p { margin: 0; font-size: 11px; line-height: 1.78; }
.ai-answer p + p { margin-top: 9px; }
.ai-message.error .ai-avatar { background: var(--red); }
.ai-message.error .ai-answer { color: #8c3440; border-color: #edcbd0; background: #fff6f7; }
.ai-message.pending .ai-avatar svg { animation: spin 1s linear infinite; }
.ai-message footer { margin-top: 7px; color: var(--muted); font-size: 9px; }
.ai-references { display: grid; gap: 7px; margin-top: 10px; }
.ai-references > span { color: var(--muted); font-size: 9px; font-weight: 650; }
.ai-reference { width: 100%; min-height: 48px; display: grid; grid-template-columns: 22px minmax(0,1fr) 18px; align-items: center; gap: 9px; padding: 8px 10px; text-align: left; color: #38505a; border: 1px solid #dce5e8; border-radius: 7px; background: #fff; }
.ai-reference:hover { color: var(--green); border-color: #a9d2ca; background: #f5fbfa; }
.ai-reference.external { text-decoration: none; }
.ai-reference.external > svg:first-child { color: #26746b; }
.ai-reference > svg { width: 15px; height: 15px; }
.ai-reference span { min-width: 0; }
.ai-reference strong, .ai-reference small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-reference strong { font-size: 10px; }
.ai-reference small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.ai-composer { padding: 14px 16px; border-top: 1px solid var(--line); background: #fff; }
.ai-composer textarea { width: 100%; min-height: 82px; padding: 12px 13px; resize: vertical; color: var(--ink); border: 1px solid var(--line-strong); border-radius: 8px; background: #fbfcfc; font: inherit; font-size: 11px; line-height: 1.6; }
.ai-composer textarea:focus { background: #fff; border-color: #77a7a2; box-shadow: 0 0 0 3px rgba(8,122,112,.08); outline: 0; }
.ai-composer > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 9px; }
.ai-composer > div > span { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 9px; }
.ai-composer > div > span svg { width: 14px; height: 14px; color: var(--green); }
.ai-composer-actions { display: flex; align-items: center; gap: 8px; }
.ai-composer-actions label.btn { cursor: pointer; }
.ai-image-tray { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.ai-image-tray.empty { display: none; }
.ai-image-item { position: relative; min-width: 0; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: #f5f8f8; }
.ai-image-item img { display: block; width: 100%; height: 92px; object-fit: cover; background: #e7eded; }
.ai-image-item figcaption { min-width: 0; padding: 7px 8px; }
.ai-image-item figcaption strong, .ai-image-item figcaption small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-image-item figcaption strong { font-size: 9px; }
.ai-image-item figcaption small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.ai-image-item > button { position: absolute; top: 5px; right: 5px; width: 25px; height: 25px; display: grid; place-items: center; padding: 0; color: #fff; border: 0; border-radius: 4px; background: rgba(18,31,34,.78); cursor: pointer; }
.ai-image-item > button:disabled { cursor: wait; opacity: .55; }
.ai-image-item > button svg { width: 14px; height: 14px; }
.ai-image-item > i { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--green); transition: width .15s ease; }
.ai-image-item.failed { border-color: #df9aa5; }
.ai-image-item.failed > i { background: var(--red); }
.ai-message-images { display: grid; grid-template-columns: repeat(2, minmax(120px, 220px)); gap: 8px; margin: 5px 0 9px; }
.ai-message-images .ai-image-item img { height: 130px; }
.ai-disclaimer { margin-top: 10px; color: var(--muted); font-size: 9px; text-align: center; }
.ai-config-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 15px; }
.ai-config-grid .field.full { grid-column: 1 / -1; }
.ai-settings-section { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.ai-settings-section .form-section { margin: 0; }
.ai-settings-divider { height: 1px; margin: 22px 0; background: var(--line); }
.ai-policy-check { display: flex; align-items: flex-start; gap: 10px; margin-top: 17px; padding: 13px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-soft); }
.ai-policy-check input { margin-top: 3px; }
.ai-policy-check strong, .ai-policy-check small { display: block; }
.ai-policy-check strong { font-size: 11px; }
.ai-policy-check small { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.55; }
.ai-config-notice { display: flex; align-items: flex-start; gap: 9px; margin-top: 14px; padding: 12px 13px; color: #3d625d; border-radius: 7px; background: #eef7f5; font-size: 10px; line-height: 1.6; }
.ai-config-notice svg { width: 17px; height: 17px; flex: 0 0 auto; color: var(--green); }

@media (max-width: 760px) {
  .ai-status-bar, .ai-mode-bar, .ai-composer > div, .ai-settings-section { align-items: flex-start; flex-direction: column; }
  .ai-mode-bar > span { text-align: left; }
  .ai-mode-switch { width: 100%; overflow-x: auto; }
  .ai-mode-switch button { flex: 1 0 auto; }
  .ai-conversation { height: auto; min-height: 420px; padding: 16px 12px; }
  .ai-message { grid-template-columns: 30px minmax(0,1fr); }
  .ai-config-grid { grid-template-columns: 1fr; }
  .ai-config-grid .field.full { grid-column: auto; }
  .ai-composer .btn { width: 100%; }
  .ai-composer-actions { width: 100%; }
  .ai-image-tray { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ai-message-images { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Product UI v5: calmer hierarchy and readable operations workspace. */
:root {
  --bg: #eef2f4;
  --panel: #ffffff;
  --panel-soft: #f6f8f9;
  --ink: #17242b;
  --muted: #65757e;
  --line: #d8e1e5;
  --line-strong: #c1cdd3;
  --sidebar: #101a1f;
  --sidebar-2: #19272d;
  --green: #087a70;
  --green-soft: #e7f5f2;
  --blue: #276d9a;
  --blue-soft: #eaf3f8;
  --orange: #b7612e;
  --orange-soft: #fff1e8;
  --red: #bd3e4b;
  --red-soft: #fcedef;
  --shadow: 0 8px 24px rgba(29, 47, 57, .06);
  --sidebar-width: 248px;
  --radius: 10px;
}

html, body { background: var(--bg); }
body { color: var(--ink); }

/* Login is the first trust signal: keep it quiet, but make the form easy to scan. */
.login-form-head h2 { font-size: 22px; }
.login-form-head p { font-size: 11px; }
.login-field > span { font-size: 11px; }
.login-field input { font-size: 13px; }
.login-alert { font-size: 11px; }
.remember-login { font-size: 11px; }
.login-submit { height: 46px; font-size: 13px; }
.login-foot { font-size: 10px; }

.sidebar {
  width: var(--sidebar-width);
  padding: 20px 14px 16px;
  background: var(--sidebar);
  border-right-color: #25353d;
  box-shadow: 10px 0 30px rgba(12, 25, 31, .08);
}
.brand { min-height: 68px; padding: 0 11px 20px; }
.brand-mark { width: 40px; height: 40px; border-radius: 9px; }
.brand-copy strong { font-size: 20px; letter-spacing: .1px; }
.brand-copy small { font-size: 11px; }
.nav-list { gap: 5px; margin-top: 20px; }
.nav-item { min-height: 46px; padding: 0 13px; border-radius: 8px; }
.nav-item span { font-size: 14px; }
.nav-item.active { background: #20353a; }
.nav-item.active::before { width: 4px; background: #51c9b6; }
.nav-item em { font-size: 11px; }

.page-shell { margin-left: var(--sidebar-width); }
.topbar {
  height: 76px;
  padding: 0 34px;
  background: rgba(255, 255, 255, .97);
  border-bottom-color: #d8e1e5;
  box-shadow: 0 1px 0 rgba(23, 36, 43, .02), 0 5px 20px rgba(26, 46, 55, .04);
}
.topbar h1 { font-size: 20px; }
.topbar p { font-size: 11px; }
.global-search { width: min(380px, 32vw); height: 40px; font-size: 12px; }
.global-search input { font-size: 12px; }
.icon-btn { width: 40px; height: 40px; }
.profile-copy strong { font-size: 12px; }
.profile-copy small { font-size: 10px; }

main { min-height: calc(100vh - 76px); padding: 30px 34px 48px; }
.view { max-width: 1760px; }
.section-heading { margin-bottom: 22px; }
.section-heading h2 { font-size: 23px; letter-spacing: -.1px; }
.section-heading p { font-size: 12px; }
.section-actions { gap: 10px; }
.btn { min-height: 40px; padding: 0 15px; border-radius: 7px; font-size: 12px; }
.btn.small { min-height: 34px; padding: 0 11px; font-size: 11px; }
.btn.primary { box-shadow: 0 5px 13px rgba(8, 122, 112, .15); }

.metric-grid { gap: 16px; margin-bottom: 22px; }
.metric-card { min-height: 128px; padding: 20px; border-color: #d7e1e5; border-radius: 10px; box-shadow: var(--shadow); }
.metric-top { font-size: 11px; }
.metric-icon { width: 36px; height: 36px; border-radius: 8px; }
.metric-value { margin-top: 12px; }
.metric-value strong { font-size: 30px; }
.metric-value span, .metric-foot { font-size: 11px; }
.metric-foot { margin-top: 11px; }

.dashboard-grid { gap: 16px; }
.panel { border-color: #d7e1e5; border-radius: 10px; box-shadow: var(--shadow); }
.panel-header { min-height: 64px; padding: 0 21px; border-bottom-color: #e1e8eb; }
.panel-title { gap: 10px; }
.panel-title h3 { font-size: 14px; }
.panel-body { padding: 21px; }
.panel-body.flush { padding: 0; }

.inspection-summary { gap: 16px; margin-bottom: 18px; }
.summary-strip { min-height: 90px; padding: 17px 18px; border-radius: 9px; box-shadow: var(--shadow); }
.summary-strip strong { font-size: 25px; }
.summary-strip small { font-size: 11px; }
.toolbar { min-height: 62px; gap: 12px; margin-bottom: 16px; padding: 11px 13px; border-color: #d7e1e5; border-radius: 9px; box-shadow: 0 3px 12px rgba(29, 47, 57, .04); }
.filters { gap: 9px; }
.search-field, .select { min-height: 40px; border-radius: 7px; font-size: 12px; }
.search-field { min-width: 280px; }
.search-field input { font-size: 12px; }
.select { min-width: 140px; }
.segmented { padding: 4px; border-radius: 8px; }
.segment { min-height: 31px; border-radius: 5px; font-size: 11px; }

.data-table-wrap { border-radius: 9px; scrollbar-gutter: stable; }
.data-table { min-width: 1020px; }
.data-table th { height: 48px; padding: 0 16px; color: #596a73; background: #f2f6f7; font-size: 11px; letter-spacing: .1px; }
.data-table td { height: 66px; padding: 12px 16px; color: #273941; font-size: 12px; }
.data-table tbody tr:hover { background: #f5faf9; }
.cell-stack { line-height: 1.35; }
.cell-stack strong { font-size: 12px; }
.cell-stack small { margin-top: 6px; font-size: 10px; }
.cell-primary { gap: 10px; }
.avatar.mini { width: 28px; height: 28px; font-size: 10px; }
.status { min-height: 26px; padding: 0 10px; font-size: 11px; }
.table-actions { gap: 6px; }
.table-action { width: 34px; height: 34px; border-radius: 7px; }
.table-action:hover { color: var(--green); background: #eef7f5; border-color: #c7dfdb; }
.pagination { min-height: 58px; padding: 0 16px; font-size: 11px; }
.page-btn { width: 32px; height: 32px; font-size: 11px; }

.modal-layer { padding: 28px; }
.modal { border-radius: 12px; box-shadow: 0 30px 90px rgba(5, 14, 18, .28); }
.modal-header { min-height: 78px; padding: 0 25px; }
.modal-header h2 { font-size: 20px; }
.modal-body { padding: 25px; }
.modal-footer { min-height: 74px; padding: 0 25px; }
.field label { font-size: 12px; }
.field input, .field select, .field textarea { min-height: 43px; border-radius: 7px; font-size: 12px; }
.field textarea { min-height: 100px; }
.field small { font-size: 10px; }
.form-section { margin: 24px 0 15px; padding-top: 19px; }
.form-section h3 { font-size: 14px; }
.form-section p { font-size: 11px; }

.empty-state { min-height: 180px; color: var(--muted); font-size: 12px; }
.toast { padding: 15px; border-radius: 9px; }

@media (max-width: 1180px) {
  :root { --sidebar-width: 224px; }
  main { padding-right: 24px; padding-left: 24px; }
  .topbar { padding-right: 24px; padding-left: 24px; }
}

@media (max-width: 840px) {
  :root { --sidebar-width: 224px; }
  .topbar { height: 64px; }
  main { min-height: calc(100vh - 64px); padding: 22px 16px 34px; }
  .section-heading h2 { font-size: 20px; }
  .panel-header { min-height: 60px; padding: 0 16px; }
  .panel-body { padding: 16px; }
  .toolbar { min-height: 58px; }
}

@media (max-width: 560px) {
  .login-form-head h2 { font-size: 20px; }
  .login-form-area { padding-right: 18px; padding-left: 18px; }
  main { padding-right: 12px; padding-left: 12px; }
  .section-heading h2 { font-size: 19px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .metric-card { min-height: 112px; padding: 14px; }
  .metric-value strong { font-size: 25px; }
  .metric-top { font-size: 10px; }
  .metric-icon { width: 31px; height: 31px; }
  .panel-header { min-height: 56px; padding: 0 13px; }
  .panel-body { padding: 13px; }
  .data-table th { height: 44px; padding: 0 12px; }
  .data-table td { height: 60px; padding: 10px 12px; }
  .modal-layer { padding: 12px; }
  .modal-header { min-height: 66px; padding: 0 16px; }
  .modal-body { padding: 17px 16px; }
  .modal-footer { min-height: 64px; padding: 0 16px; }
}

/* Product UI v6: premium operations console finish. */
:root {
  --bg: #edf2f4;
  --panel: #ffffff;
  --panel-soft: #f7f9fa;
  --ink: #15242c;
  --muted: #6b7b83;
  --line: #d9e2e6;
  --line-strong: #bfcdd3;
  --sidebar: #0d171c;
  --sidebar-2: #15252b;
  --green: #0b8f80;
  --green-soft: #e5f6f2;
  --blue: #2c719e;
  --blue-soft: #e9f3f8;
  --orange: #ba6b32;
  --orange-soft: #fff2e8;
  --red: #c24855;
  --red-soft: #fdefef;
  --shadow: 0 12px 30px rgba(24, 48, 58, .07);
  --shadow-soft: 0 4px 14px rgba(24, 48, 58, .045);
  --sidebar-width: 248px;
  --radius: 12px;
}

/* A more intentional login composition. */
.login-screen { background: #f7f9fa; }
.login-context {
  padding: 46px 52px 40px;
  background: #0c171c;
  border-right: 1px solid rgba(132, 191, 185, .16);
}
.login-context::before {
  opacity: .16;
  background-image: linear-gradient(rgba(106, 170, 164, .38) 1px, transparent 1px), linear-gradient(90deg, rgba(106, 170, 164, .38) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(135deg, #000 0%, rgba(0,0,0,.72) 58%, transparent 100%);
}
.login-context::after {
  left: 52px;
  right: 52px;
  bottom: 126px;
  height: 56px;
  border-top: 1px solid rgba(132, 191, 185, .16);
  border-bottom: 1px solid rgba(132, 191, 185, .08);
  background: transparent;
}
.login-brand { gap: 14px; }
.login-brand strong { font-size: 20px; letter-spacing: .2px; }
.login-brand small { color: #8da9a8; font-size: 11px; }
.login-context-copy { max-width: 480px; margin-bottom: 32px; }
.login-kicker { margin-bottom: 20px; color: #5ed5bd; font-size: 11px; letter-spacing: 1.6px; }
.login-context-copy h1 { font-size: 41px; font-weight: 760; letter-spacing: -.6px; }
.login-context-copy p { margin-top: 16px; color: #a3b6b7; font-size: 15px; line-height: 1.7; }
.login-system-state { padding-top: 28px; color: #d2e3e0; font-size: 11px; }
.login-system-state small { color: #7d999a; font-size: 10px; }
.login-form-area { padding: 54px; background: #f7f9fa; }
.login-form {
  width: min(100%, 450px);
  padding: 38px 38px 30px;
  background: rgba(255,255,255,.98);
  border: 1px solid #d9e3e6;
  border-radius: 16px;
  box-shadow: 0 24px 65px rgba(30, 55, 63, .12), 0 2px 4px rgba(30, 55, 63, .04);
}
.login-form-head { margin-bottom: 32px; }
.login-icon { width: 48px; height: 48px; border-radius: 12px; background: #e5f6f2; border-color: #c6e7df; }
.login-icon svg { width: 24px; height: 24px; }
.login-form-head h2 { font-size: 23px; letter-spacing: -.2px; }
.login-form-head p { color: #75878e; font-size: 11px; }
.login-field { margin-top: 19px; }
.login-field > span { margin-bottom: 8px; color: #34474e; font-size: 11px; }
.login-field > div { height: 46px; padding: 0 13px; border-radius: 8px; border-color: #c8d5da; background: #fbfcfc; }
.login-field > div:focus-within { border-color: var(--green); box-shadow: 0 0 0 4px rgba(11,143,128,.1); background: #fff; }
.login-field input { font-size: 13px; }
.captcha-image-button { width: 166px; height: 46px; grid-template-columns: 132px 33px; border-radius: 8px; }
.captcha-image-button img { width: 132px; height: 46px; }
.captcha-refresh-icon { width: 17px; height: 17px; }
.remember-login { margin: 17px 0 22px; color: #718188; font-size: 11px; }
.login-submit { height: 48px; border-radius: 8px; background: #0b8f80; border-color: #0b8f80; box-shadow: 0 8px 17px rgba(11,143,128,.2); font-size: 13px; }
.login-submit:hover { background: #08796d; }
.login-foot { margin-top: 20px; color: #819096; font-size: 10px; }

.app-shell { background: var(--bg); }
.sidebar {
  background: #0d171c;
  border-right-color: #23343b;
  box-shadow: 12px 0 34px rgba(9, 22, 28, .12);
}
.brand-mark { background: #15302f; border-color: #3b716b; box-shadow: 0 0 0 4px rgba(69, 200, 181, .06); }
.brand-copy strong { letter-spacing: .2px; }
.nav-item { color: #a8babc; }
.nav-item:hover { background: #17282e; }
.nav-item.active { background: #1b3639; box-shadow: inset 0 0 0 1px rgba(91, 214, 193, .09); }
.nav-item.active::before { background: #5ed5bd; box-shadow: 0 0 12px rgba(94,213,189,.7); }
.nav-item.active svg { filter: drop-shadow(0 0 5px rgba(94,213,189,.28)); }

.topbar { background: rgba(255,255,255,.93); border-bottom-color: #d7e1e5; box-shadow: 0 8px 24px rgba(29, 47, 57, .05); }
.topbar h1 { font-size: 21px; letter-spacing: -.2px; }
.global-search { background: #f5f8f9; border-color: #d5e0e4; border-radius: 9px; }
.global-search:focus-within { box-shadow: 0 0 0 4px rgba(11,143,128,.08); }
.icon-btn { border-radius: 9px; }
.profile-btn:hover { background: #f0f7f6; }
.avatar { background: #0b8f80; box-shadow: 0 4px 12px rgba(11,143,128,.18); }

main { background: #edf2f4; }
.section-heading h2 { font-size: 24px; font-weight: 760; letter-spacing: -.3px; }
.section-heading p { color: #74848b; }
.btn { border-color: #c7d3d8; box-shadow: 0 2px 5px rgba(24,48,58,.04); }
.btn:hover { border-color: #a9bbc2; box-shadow: 0 4px 10px rgba(24,48,58,.07); }
.btn.primary { background: #0b8f80; border-color: #0b8f80; }
.btn.primary:hover { background: #08796d; border-color: #08796d; }
.metric-card { border-color: #d4e0e4; border-radius: 12px; box-shadow: var(--shadow-soft); }
.metric-card:hover { box-shadow: 0 15px 33px rgba(22, 49, 59, .11); transform: translateY(-2px); }
.metric-card::before { width: 4px; }
.metric-value strong { font-weight: 760; letter-spacing: -.4px; }
.metric-icon { border: 1px solid rgba(11,143,128,.13); box-shadow: inset 0 1px 0 rgba(255,255,255,.6); }
.panel { border-color: #d4e0e4; border-radius: 12px; box-shadow: var(--shadow-soft); }
.panel-header { background: rgba(255,255,255,.92); }
.panel-title h3 { font-size: 14px; font-weight: 720; }
.toolbar { background: rgba(255,255,255,.88); border-color: #d4e0e4; box-shadow: var(--shadow-soft); }
.search-field, .select { background: #f8fafb; }
.search-field:focus-within, .select:focus { box-shadow: 0 0 0 4px rgba(11,143,128,.08); }
.data-table th { color: #64767e; background: #f3f7f8; }
.data-table tbody tr { transition: background .14s ease, box-shadow .14s ease; }
.data-table tbody tr:hover { box-shadow: inset 3px 0 #5bb9a9; }
.data-table tbody tr.selected { box-shadow: inset 3px 0 #0b8f80, 0 0 0 1px rgba(11,143,128,.08); }
.status { box-shadow: inset 0 1px 0 rgba(255,255,255,.65); }
.table-action { background: transparent; }
.table-action:hover { box-shadow: 0 4px 10px rgba(11,143,128,.12); }
.modal { border-radius: 14px; }
.toast { box-shadow: 0 18px 45px rgba(8, 25, 31, .22); }

@media (max-width: 840px) {
  .login-context { min-height: 250px; padding: 30px 28px 26px; }
  .login-context::after { left: 28px; right: 28px; bottom: 26px; height: 1px; }
  .login-context-copy { margin: 34px 0 8px; }
  .login-context-copy h1 { font-size: 30px; }
  .login-context-copy p { font-size: 12px; }
  .login-form-area { min-height: calc(100vh - 250px); padding: 32px 20px 42px; }
  .login-form { padding: 30px 25px 25px; border-radius: 14px; }
}

@media (max-width: 560px) {
  .login-context { min-height: 205px; padding: 24px 20px 20px; }
  .login-context-copy { margin: 28px 0 0; }
  .login-context-copy h1 { font-size: 25px; }
  .login-context-copy p { margin-top: 9px; font-size: 11px; }
  .login-form-area { min-height: calc(100vh - 205px); padding: 24px 14px 34px; }
  .login-form { padding: 26px 18px 22px; }
  .captcha-image-button { width: 150px; grid-template-columns: 119px 30px; }
  .captcha-image-button img { width: 119px; }
  .section-heading h2 { font-size: 20px; }
}

/* Product UI v7: blue technology identity for the operations product. */
:root {
  --bg: #edf4f8;
  --panel: #ffffff;
  --panel-soft: #f5f9fb;
  --ink: #132735;
  --muted: #667c89;
  --line: #d5e3ea;
  --line-strong: #b8ccd7;
  --sidebar: #071622;
  --sidebar-2: #0d2536;
  --green: #16b5c9;
  --green-soft: #e5f8fb;
  --blue: #3476dd;
  --blue-soft: #eaf1ff;
  --orange: #bf6a2f;
  --orange-soft: #fff1e7;
  --red: #c04456;
  --red-soft: #fcedf0;
  --yellow: #9b7417;
  --yellow-soft: #fff7dc;
  --shadow: 0 13px 34px rgba(20, 61, 82, .08);
  --shadow-soft: 0 4px 16px rgba(20, 61, 82, .055);
  --sidebar-width: 248px;
  --radius: 12px;
}

::selection { color: #fff; background: #3476dd; }
body { color: var(--ink); background: var(--bg); }

/* Blue-spectrum login identity. */
.login-screen { background: #f5f9fc; }
.login-context {
  background: #071622;
  border-right-color: rgba(81, 173, 220, .24);
}
.login-context::before {
  opacity: .2;
  background-image: linear-gradient(rgba(62, 143, 196, .42) 1px, transparent 1px), linear-gradient(90deg, rgba(62, 143, 196, .42) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(135deg, #000 0%, rgba(0,0,0,.72) 58%, transparent 100%);
}
.login-context::after {
  border-top-color: rgba(62, 143, 196, .28);
  border-bottom-color: rgba(62, 143, 196, .14);
}
.login-brand strong { color: #f0f8ff; }
.login-brand small { color: #8fb9cf; }
.login-kicker { color: #5fd8ed; }
.login-context-copy h1 { text-shadow: 0 0 28px rgba(64, 190, 230, .12); }
.login-context-copy p { color: #a1bacb; }
.login-system-state .pulse { background: #22c7df; box-shadow: 0 0 0 4px rgba(34,199,223,.14), 0 0 14px rgba(34,199,223,.45); }
.login-system-state small { color: #83a5b9; }
.login-icon { color: #2c76df; background: #eaf2ff; border-color: #cdddf8; }
.login-field > div:focus-within { border-color: #3476dd; box-shadow: 0 0 0 4px rgba(52,118,221,.11); }
.login-submit { background: #3476dd; border-color: #3476dd; box-shadow: 0 9px 20px rgba(52,118,221,.24); }
.login-submit:hover { background: #285fbd; border-color: #285fbd; }

/* Main frame, navigation and accents. */
.app-shell { background: var(--bg); }
.sidebar { background: #071622; border-right-color: #16364c; box-shadow: 12px 0 34px rgba(5, 22, 35, .16); }
.brand-mark { background: #0c2b42; border-color: #286989; box-shadow: 0 0 0 4px rgba(37, 166, 211, .08), 0 0 18px rgba(37, 166, 211, .12); }
.brand-mark span { background: #38c7e5; }
.brand-copy strong { color: #f3f9ff; }
.brand-copy small { color: #8fb5c9; }
.nav-item { color: #9db4c3; }
.nav-item:hover { color: #f2f8fc; background: #0d2b41; }
.nav-item.active { color: #fff; background: #103650; box-shadow: inset 0 0 0 1px rgba(80, 185, 226, .16), 0 4px 16px rgba(0, 98, 155, .12); }
.nav-item.active::before { background: #39c8e5; box-shadow: 0 0 12px rgba(57,200,229,.75); }
.nav-item.active svg { color: #65d8ef; filter: drop-shadow(0 0 5px rgba(101,216,239,.32)); }
.nav-item em { color: #b9d0dd; background: #17364a; }
.nav-item em.warn { color: #ffd4b4; background: #543424; }
.system-state .pulse { background: #25c4dc; box-shadow: 0 0 0 4px rgba(37,196,220,.12), 0 0 14px rgba(37,196,220,.35); }
.system-state strong { color: #d8ebf5; }
.system-state small { color: #7d9caf; }

.topbar { background: rgba(255,255,255,.94); border-bottom-color: #d3e1e8; box-shadow: 0 8px 26px rgba(28, 75, 100, .06); }
.topbar h1 { color: #102a3b; }
.topbar p { color: #6d8491; }
.global-search { background: #f3f8fb; border-color: #cfe0e8; }
.global-search:focus-within { border-color: #5c9be4; box-shadow: 0 0 0 4px rgba(52,118,221,.09); }
.icon-btn:hover { color: #3476dd; background: #eef5ff; border-color: #bcd2ef; }
.avatar { background: #3476dd; box-shadow: 0 4px 13px rgba(52,118,221,.22); }

main { background-color: #edf4f8; background-image: linear-gradient(rgba(72, 123, 153, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(72, 123, 153, .035) 1px, transparent 1px); background-size: 48px 48px; }
.section-heading h2 { color: #102b3d; }
.section-heading p { color: #708692; }
.btn { color: #294253; border-color: #bcd0db; background: #fff; }
.btn:hover { color: #17384e; border-color: #91b2c5; background: #f6fbfe; }
.btn.primary { color: #fff; background: #3476dd; border-color: #3476dd; box-shadow: 0 7px 16px rgba(52,118,221,.2); }
.btn.primary:hover { background: #285fbd; border-color: #285fbd; }
.btn.danger { color: #b6384d; background: #fff0f2; border-color: #edc5cd; }

.metric-card { border-color: #d1e0e7; box-shadow: var(--shadow-soft); }
.metric-card:hover { border-color: #9fc4dd; box-shadow: 0 16px 36px rgba(28, 86, 121, .13); }
.metric-card::before { background: #16b5c9; }
.metric-card:nth-child(2)::before { background: #3476dd; }
.metric-card:nth-child(3)::before { background: #bf6a2f; }
.metric-card:nth-child(4)::before { background: #c04456; }
.metric-icon { border-color: rgba(52,118,221,.14); }
.metric-icon.blue { color: #3476dd; background: #eaf1ff; }
.metric-icon.orange { color: #bf6a2f; background: #fff1e7; }
.metric-icon.red { color: #c04456; background: #fcedf0; }
.panel { border-color: #d1e0e7; box-shadow: var(--shadow-soft); }
.panel-header { background: rgba(255,255,255,.94); border-bottom-color: #deeaef; }
.panel-title h3 { color: #173447; }
.toolbar { background: rgba(255,255,255,.9); border-color: #d1e0e7; box-shadow: var(--shadow-soft); }
.search-field, .select { color: #294455; background: #f7fbfd; border-color: #bfd3df; }
.search-field:focus-within, .select:focus { border-color: #5c9be4; box-shadow: 0 0 0 4px rgba(52,118,221,.08); }
.segmented { background: #e9f1f6; border-color: #d1e0e7; }
.segment.active { color: #1f5caf; background: #fff; box-shadow: 0 2px 7px rgba(35, 86, 121, .12); }
.data-table th { color: #5f7683; background: #f1f7fa; border-bottom-color: #d3e1e7; }
.data-table td { color: #274150; border-bottom-color: #e6eef2; }
.data-table tbody tr:hover { background: #f1f8fb; box-shadow: inset 3px 0 #4fbcd0; }
.data-table tbody tr.selected { background: #eaf4ff; box-shadow: inset 3px 0 #3476dd, 0 0 0 1px rgba(52,118,221,.09); }
.status { box-shadow: inset 0 1px 0 rgba(255,255,255,.7); }
.status.info { color: #2c66c6; background: #eaf1ff; border-color: #c9daf6; }
.table-action:hover { color: #3476dd; background: #eef5ff; border-color: #c2d6f2; box-shadow: 0 4px 11px rgba(52,118,221,.14); }
.pagination { background: rgba(247,251,253,.92); border-top-color: #dce8ed; }
.page-btn.active { background: #3476dd; border-color: #3476dd; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #5c9be4; box-shadow: 0 0 0 4px rgba(52,118,221,.09); }
.modal-header, .modal-footer { background: #f7fbfd; }
.toast { border-color: #1f5f83; box-shadow: 0 18px 46px rgba(7, 29, 46, .26); }

/* Use blue for neutral workflow actions; reserve orange and red for risk. */
.inspection-selection-bar, .task-assignment-banner { color: #235b83; border-color: #c4ddef; background: #edf6fc; }
.selection-count, .visible-selection-state { color: #2c66c6; border-color: #c8daf2; background: #edf3ff; }
.inspection-choice:has(input:checked), .operator-choice:has(input:checked) { border-color: #6d9fe0; background: #edf4ff; box-shadow: inset 0 0 0 1px rgba(52,118,221,.1); }
.inspection-choice:has(input:checked) .choice-indicator, .operator-choice:has(input:checked) .choice-indicator { background: #3476dd; border-color: #3476dd; }
.workflow-event-icon { color: #3476dd; background: #eaf1ff; border-color: #c9daf6; }
.workflow-event.completed .workflow-event-icon { color: #0b9d8c; background: #e5f8f5; border-color: #c5e8e2; }
.auto-hint { color: #2c66c6; background: #edf3ff; border-color: #c9daf6; }
.official-template-notice { border-color: #c5dcef; background: #edf6fc; }
.official-template-notice > svg { color: #3476dd; }
.ai-status-bar { color: #235f8a; border-color: #c4ddef; background: #edf6fc; }
.ai-empty > span { color: #3476dd; border-color: #c9daf6; background: #edf3ff; }
.ai-suggestions button:hover, .ai-reference:hover { color: #2c66c6; border-color: #a9c6ec; background: #f0f5ff; }

/* Login information rail and compact collaboration controls. */
.login-form-area { grid-template-columns: minmax(240px, .8fr) minmax(360px, 1fr); gap: 52px; align-content: center; background: linear-gradient(135deg, #f9fcff 0%, #eef6fb 100%); }
.login-brief { max-width: 360px; padding: 30px; border: 1px solid #d6e6ef; border-radius: 14px; background: rgba(255,255,255,.82); box-shadow: 0 18px 44px rgba(39,83,112,.1); }
.login-brief-label { color: #3476dd; font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.login-brief h2 { margin: 13px 0 0; color: #173b55; font-size: 25px; line-height: 1.35; }
.login-brief p { margin: 12px 0 22px; color: #60798a; font-size: 12px; line-height: 1.8; }
.login-brief-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.login-brief-grid div { padding: 10px 8px; border: 1px solid #dceaf2; border-radius: 8px; background: #fff; }
.login-brief-grid strong, .login-brief-grid span { display: block; }
.login-brief-grid strong { color: #1f5caf; font-size: 14px; }
.login-brief-grid span { margin-top: 4px; color: #718997; font-size: 9px; }
.login-brief-status { display: flex; align-items: center; gap: 9px; margin-top: 20px; padding-top: 16px; border-top: 1px solid #dceaf2; }
.login-brief-status .pulse { width: 8px; height: 8px; border-radius: 50%; background: #11a688; box-shadow: 0 0 0 4px rgba(17,166,136,.12); }
.login-brief-status strong, .login-brief-status small { display: block; }
.login-brief-status strong { color: #245670; font-size: 11px; }
.login-brief-status small { margin-top: 3px; color: #718997; font-size: 9px; }
.profile-copy small#profileRole { display: none !important; }
.integration-config-fields select, .integration-config-fields input { min-width: 0; height: 32px; border: 1px solid var(--line); border-radius: 4px; background: #fff; padding: 0 8px; font-size: 10px; }
.permission-edit-table input { width: 16px; height: 16px; accent-color: #3476dd; }
.permission-edit-table td:not(:first-child), .permission-edit-table th:not(:first-child) { text-align: center; }
.chat-message-list { display: grid; gap: 10px; max-height: 340px; overflow-y: auto; padding: 4px; }
.chat-message { max-width: 82%; padding: 10px 12px; border: 1px solid #dce8ed; border-radius: 10px; background: #f7fbfd; }
.chat-message.mine { justify-self: end; color: #fff; border-color: #3476dd; background: #3476dd; }
.chat-message small { display: block; margin-top: 5px; opacity: .7; font-size: 9px; }
.chat-composer { display: flex; gap: 8px; margin-top: 12px; }
.chat-composer input { min-width: 0; flex: 1; }
.task-chat-picker { display: grid; gap: 8px; }
.task-chat-picker-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border: 1px solid #dce8ed; border-radius: 7px; background: #f8fbfd; }
.task-chat-picker-row > div { min-width: 0; display: grid; gap: 4px; }
.task-chat-picker-row strong { overflow-wrap: anywhere; }
.task-chat-picker-row small { color: var(--muted); line-height: 1.5; }
@media (max-width: 640px) { .integration-advanced-fields { grid-template-columns: 1fr; } .task-chat-picker-row { align-items: stretch; flex-direction: column; } }
.release-note-list { display: grid; gap: 10px; }
.release-note { display: grid; grid-template-columns: 90px 1fr; gap: 14px; padding: 13px; border: 1px solid #dce8ed; border-radius: 7px; background: #f8fbfd; }
.release-note > div:first-child strong, .release-note > div:first-child small { display: block; }
.release-note > div:first-child strong { color: #1f5caf; font-size: 14px; }
.release-note > div:first-child small { margin-top: 4px; color: #758c99; font-size: 9px; }
.release-note b { color: #294b61; font-size: 11px; }
.release-note ul { margin: 6px 0 0; padding-left: 17px; color: #627a89; font-size: 10px; line-height: 1.7; }
@media (max-width: 980px) { .login-form-area { grid-template-columns: 1fr; gap: 22px; padding: 36px 28px; } .login-brief { width: min(100%, 480px); margin: 0 auto; } .login-form { margin: 0 auto; } }
@media (max-width: 560px) { .login-brief { padding: 20px; } .login-brief h2 { font-size: 21px; } .login-brief-grid { gap: 5px; } }

@media (max-width: 560px) {
  main { background-size: 36px 36px; }
  .login-submit { box-shadow: 0 7px 16px rgba(52,118,221,.2); }
}

/* Final login composition: balanced proportions, clear primary action, no floating-card gap. */
.login-screen { grid-template-columns: minmax(420px, .9fr) minmax(760px, 1.1fr); background: #eef4f8; }
.login-form-area { grid-template-columns: minmax(270px, 340px) minmax(420px, 460px); justify-content: center; gap: clamp(28px, 3vw, 58px); padding: 44px clamp(28px, 5vw, 96px); background: radial-gradient(circle at 74% 20%, rgba(52,118,221,.08), transparent 32%), linear-gradient(135deg, #f7fbfe 0%, #eaf3f8 100%); }
.login-brief { width: 100%; max-width: none; padding: 22px 8px; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.login-brief h2 { max-width: 300px; font-size: 27px; line-height: 1.3; }
.login-brief p { max-width: 300px; margin-bottom: 26px; }
.login-brief-grid { grid-template-columns: 1fr; gap: 0; border-top: 1px solid #cfe0e8; border-bottom: 1px solid #cfe0e8; }
.login-brief-grid div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 13px 0; border: 0; border-bottom: 1px solid #dce9ef; background: transparent; }
.login-brief-grid div:last-child { border-bottom: 0; }
.login-brief-grid strong { font-size: 16px; }
.login-brief-grid span { margin-top: 0; font-size: 10px; }
.login-brief-status { margin-top: 22px; }
.login-form { width: 100%; max-width: 460px; padding: 34px 38px 28px; border-color: #cfdfe7; border-radius: 16px; box-shadow: 0 22px 52px rgba(31,71,96,.13), 0 2px 5px rgba(31,71,96,.04); }
.login-form-head { margin-bottom: 27px; }
.login-form-head h2 { font-size: 24px; }
.login-field { margin-top: 16px; }
.login-submit { margin-top: 2px; }

@media (max-width: 1240px) and (min-width: 841px) {
  .login-screen { grid-template-columns: minmax(330px, .8fr) minmax(620px, 1.2fr); }
  .login-form-area { grid-template-columns: minmax(220px, 280px) minmax(360px, 420px); gap: 24px; padding-right: 34px; padding-left: 34px; }
  .login-form { padding-right: 28px; padding-left: 28px; }
}

@media (max-width: 840px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-context { min-height: 250px; padding: 30px 28px 26px; }
  .login-context-copy { margin: 34px 0 8px; }
  .login-context-copy h1 { font-size: 30px; }
  .login-context-copy p { font-size: 12px; }
  .login-context::after, .login-system-state { display: none; }
  .login-form-area { min-height: calc(100vh - 250px); grid-template-columns: minmax(0, 480px); gap: 20px; padding: 32px 20px 42px; }
  .login-brief { padding: 0; }
  .login-brief-grid { grid-template-columns: repeat(3, 1fr); border: 0; }
  .login-brief-grid div { display: block; padding: 10px 8px; border: 1px solid #dceaf2; border-radius: 8px; background: #fff; }
  .login-brief-grid span { margin-top: 4px; }
}

@media (max-width: 560px) {
  .login-context { min-height: 205px; padding: 24px 20px 20px; }
  .login-context-copy { margin: 28px 0 0; }
  .login-context-copy h1 { font-size: 25px; }
  .login-form-area { min-height: calc(100vh - 205px); grid-template-columns: minmax(0, 1fr); padding: 24px 14px 34px; }
  .login-brief-grid { gap: 5px; }
  .login-form { padding: 26px 18px 22px; }
}

/* Login refinement: turn the right rail into a structured workspace instead of a centered description block. */
.login-form-area {
  grid-template-columns: minmax(0, 1fr) minmax(400px, 460px);
  grid-template-rows: auto 1fr auto;
  align-items: start;
  justify-content: stretch;
  align-content: stretch;
  column-gap: clamp(28px, 5vw, 76px);
  row-gap: 0;
  padding: 48px clamp(32px, 6vw, 108px) 30px;
}
.login-brief {
  grid-column: 1 / -1;
  grid-row: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: end;
  max-width: none;
  padding: 0 0 22px;
  border-bottom: 1px solid #cbdde7;
}
.login-brief-label { grid-column: 1; grid-row: 1; margin-bottom: 7px; }
.login-brief h2 { grid-column: 1; grid-row: 2; max-width: none; margin: 0; font-size: 22px; line-height: 1.25; }
.login-brief p { grid-column: 1; grid-row: 3; display: none; }
.login-brief-grid { grid-column: 2; grid-row: 1 / 4; display: flex; align-items: stretch; gap: 0; margin-left: 30px; border: 0; }
.login-brief-grid div { min-width: 92px; padding: 2px 16px; border: 0; border-left: 1px solid #cbdde7; border-radius: 0; background: transparent; }
.login-brief-grid div:last-child { border-bottom: 0; }
.login-brief-grid strong { font-size: 15px; }
.login-brief-grid span { margin-top: 5px; font-size: 9px; }
.login-brief-status { display: none; }
.login-form { grid-column: 2; grid-row: 2; align-self: start; justify-self: stretch; margin-top: clamp(30px, 6vh, 72px); }
.login-form-area::after { grid-column: 1 / -1; grid-row: 3; content: "安全会话已启用  ·  会话超时、验证码与操作审计共同保护系统"; width: 100%; padding-top: 17px; color: #718997; border-top: 1px solid #d2e1e8; font-size: 10px; text-align: right; }

@media (max-width: 840px) {
  .login-form-area { grid-template-columns: minmax(0, 480px); grid-template-rows: auto auto auto; justify-content: center; gap: 20px; padding: 32px 20px 34px; }
  .login-brief { grid-column: 1; grid-row: 1; display: block; padding: 0 0 18px; }
  .login-brief-label { margin-bottom: 9px; }
  .login-brief h2 { font-size: 22px; }
  .login-brief-grid { grid-column: auto; grid-row: auto; display: grid; grid-template-columns: repeat(3, 1fr); margin: 18px 0 0; gap: 5px; }
  .login-brief-grid div { min-width: 0; padding: 10px 8px; border: 1px solid #dceaf2; border-radius: 8px; background: #fff; }
  .login-brief-grid span { margin-top: 4px; }
  .login-form { grid-column: 1; grid-row: 2; margin-top: 0; }
  .login-form-area::after { grid-column: 1; grid-row: 3; text-align: center; }
}

/* Keep the desktop login composition inside one viewport and remove the large dead zones. */
@media (min-width: 841px) {
  .login-screen { height: 100dvh; min-height: 640px; overflow: hidden; }
  .login-context { min-height: 0; height: 100%; padding: 34px 48px 30px; }
  .login-context-copy { margin-top: auto; margin-bottom: auto; padding-top: 8vh; padding-bottom: 8vh; }
  .login-form-area { height: 100%; min-height: 0; overflow: hidden; grid-template-rows: auto minmax(0, 1fr) auto; padding-top: 34px; padding-bottom: 24px; }
  .login-brief { padding-bottom: 18px; }
  .login-form { align-self: center; margin-top: 0; padding: 27px 34px 22px; }
  .login-form-head { margin-bottom: 20px; }
  .login-field { margin-top: 13px; }
  .remember-login { margin-top: 13px; margin-bottom: 16px; }
  .login-foot { margin-top: 13px; }
  .login-form-area::after { padding-top: 12px; font-size: 9px; }
}

/* ============================================================
   Concept Refresh - final theme layer
   Keep this block last so the visual system stays deterministic.
   ============================================================ */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0e1a;
  --panel: #131a2e;
  --panel-soft: #1a2238;
  --ink: #f1f5f9;
  --muted: #a6b0c3;
  --line: rgba(255,255,255,.07);
  --line-strong: rgba(255,255,255,.14);
  --sidebar: #080d18;
  --sidebar-2: #11182a;
  --green: #10b981;
  --green-soft: rgba(16,185,129,.14);
  --blue: #818cf8;
  --blue-soft: rgba(99,102,241,.15);
  --orange: #f59e0b;
  --orange-soft: rgba(245,158,11,.15);
  --red: #fb7185;
  --red-soft: rgba(244,63,94,.14);
  --yellow: #fbbf24;
  --yellow-soft: rgba(245,158,11,.13);
  --accent: #6366f1;
  --brand: #818cf8;
  --shadow: 0 16px 36px rgba(0,0,0,.28), 0 0 0 1px rgba(255,255,255,.025);
  --sidebar-width: 248px;
  --radius: 8px;
  --canvas: #0f1424;
  --elevated: #1a2238;
  --hover: rgba(255,255,255,.055);
  --text-subtle: #6b7593;
  --brand-gradient: linear-gradient(135deg,#6366f1 0%,#8b5cf6 52%,#06b6d4 100%);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f7fb;
  --panel: #ffffff;
  --panel-soft: #f8f9fc;
  --ink: #0f172a;
  --muted: #58657a;
  --line: rgba(15,23,42,.08);
  --line-strong: rgba(15,23,42,.16);
  --sidebar: #111827;
  --sidebar-2: #1b2435;
  --green: #059669;
  --green-soft: rgba(5,150,105,.1);
  --blue: #4f46e5;
  --blue-soft: rgba(79,70,229,.1);
  --orange: #d97706;
  --orange-soft: rgba(217,119,6,.11);
  --red: #e11d48;
  --red-soft: rgba(225,29,72,.1);
  --yellow: #b45309;
  --yellow-soft: rgba(217,119,6,.1);
  --accent: #4f46e5;
  --brand: #4f46e5;
  --shadow: 0 12px 28px rgba(15,23,42,.08), 0 0 0 1px rgba(15,23,42,.02);
  --sidebar-width: 248px;
  --radius: 8px;
  --canvas: #ffffff;
  --elevated: #ffffff;
  --hover: rgba(15,23,42,.045);
  --text-subtle: #7b879a;
  --brand-gradient: linear-gradient(135deg,#4f46e5 0%,#7c3aed 52%,#0891b2 100%);
}

html { background: var(--bg); }
body, button, input, select, textarea { letter-spacing: 0; }
body { color: var(--ink); background: var(--bg); transition: color .2s ease, background-color .2s ease; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--blue) 26%, transparent);
  outline-offset: 2px;
}
::selection { color: #fff; background: #6366f1; }

/* Login */
.login-screen {
  isolation: isolate;
  position: relative;
  height: 100dvh;
  min-height: 640px;
  grid-template-columns: minmax(390px, .9fr) minmax(700px, 1.35fr);
  overflow: hidden;
  color: var(--ink);
  background: var(--bg);
}
.login-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg,var(--line) 1px,transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(90deg,#000,transparent 76%);
  opacity: .42;
}
.login-context {
  min-height: 0;
  height: 100%;
  padding: 38px clamp(34px,4vw,68px) 34px;
  color: #d8def0;
  background: linear-gradient(160deg,#080d18 0%,#10152a 55%,#111a32 100%);
  border-right: 1px solid rgba(255,255,255,.08);
}
.login-context::before {
  opacity: .16;
  background-image: linear-gradient(rgba(129,140,248,.24) 1px,transparent 1px),linear-gradient(90deg,rgba(129,140,248,.24) 1px,transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(180deg,#000,transparent 90%);
}
.login-context::after { left: clamp(34px,4vw,68px); right: clamp(34px,4vw,68px); border: 0; background: rgba(255,255,255,.09); }
.login-brand .brand-mark, .brand .brand-mark {
  border: 0;
  border-radius: 8px;
  background: var(--brand-gradient);
  box-shadow: 0 0 24px rgba(99,102,241,.32), inset 0 1px rgba(255,255,255,.3);
}
.login-brand .brand-mark span, .brand .brand-mark span { background: #fff; }
.login-brand strong { font-size: 20px; }
.login-brand small { color: #8d98b5; }
.login-kicker { color: #67e8f9; font-weight: 700; }
.login-context-copy { margin: auto 0; padding: 5vh 0; }
.login-context-copy h1 { max-width: 480px; font-size: clamp(35px,3.4vw,50px); font-weight: 720; line-height: 1.18; letter-spacing: 0; }
.login-context-copy p { color: #a6b0c3; font-size: 15px; }
.login-system-state { color: #c5ccdc; }
.login-system-state small { color: #74809b; }
.login-system-state .pulse, .login-brief-status .pulse, .system-state .pulse { background: #10b981; box-shadow: 0 0 0 4px rgba(16,185,129,.12),0 0 14px rgba(16,185,129,.65); }
.login-form-area {
  min-height: 0;
  height: 100%;
  grid-template-columns: minmax(210px,380px) minmax(360px,460px);
  grid-template-rows: minmax(0,1fr) auto;
  align-items: center;
  gap: clamp(24px,3vw,56px);
  padding: 42px clamp(28px,4vw,76px) 28px;
  background: var(--canvas);
}
.login-brief {
  grid-column: 1;
  grid-row: 1;
  display: block;
  align-self: center;
  padding: 0;
  border: 0;
  background: transparent;
}
.login-brief-label { color: var(--blue); font-size: 10px; }
.login-brief h2 { max-width: 330px; margin: 15px 0 0; color: var(--ink); font-size: 28px; line-height: 1.35; }
.login-brief p { display: block; max-width: 340px; margin: 14px 0 26px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.login-brief-grid { display: grid; grid-template-columns: 1fr; gap: 0; margin: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.login-brief-grid div { display: flex; align-items: baseline; justify-content: space-between; min-width: 0; padding: 13px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; }
.login-brief-grid div:last-child { border-bottom: 0; }
.login-brief-grid strong { color: var(--blue); font-size: 16px; }
.login-brief-grid span { margin: 0; color: var(--muted); font-size: 10px; }
.login-brief-status { display: flex; border-color: var(--line); }
.login-brief-status strong { color: var(--ink); }
.login-brief-status small { color: var(--muted); }
.login-form {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  width: 100%;
  max-width: 460px;
  margin: 0;
  padding: 30px 34px 25px;
  background: color-mix(in srgb,var(--panel) 92%,transparent);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}
.login-form-head { margin-bottom: 23px; }
.login-form-head h2 { color: var(--ink); font-size: 23px; }
.login-form-head p { color: var(--muted); font-size: 11px; }
.login-icon { color: #fff; background: var(--brand-gradient); border: 0; border-radius: 8px; box-shadow: 0 8px 20px rgba(99,102,241,.25); }
.login-field { margin-top: 14px; }
.login-field > span { color: var(--muted); font-size: 11px; }
.login-field > div, .captcha-image-button {
  color: var(--ink);
  background: var(--bg);
  border-color: var(--line-strong);
  border-radius: 7px;
}
.login-field > div:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb,var(--blue) 18%,transparent); }
.login-field input { color: var(--ink); }
.login-field input::placeholder { color: var(--text-subtle); }
.captcha-image-button:hover { background: var(--panel-soft); border-color: var(--blue); }
.captcha-refresh-icon { color: var(--blue); }
.remember-login { color: var(--muted); }
.remember-login input { accent-color: var(--blue); }
.login-submit {
  height: 44px;
  background: var(--brand-gradient);
  border: 0;
  border-radius: 7px;
  box-shadow: 0 8px 22px rgba(99,102,241,.28);
}
.login-submit:hover { filter: brightness(1.08); transform: translateY(-1px); }
.login-foot { color: var(--text-subtle); }
.login-form-area::after {
  grid-column: 1 / -1;
  grid-row: 2;
  color: var(--text-subtle);
  border-color: var(--line);
}
.theme-toggle { color: var(--muted); }
.login-theme-toggle { position: fixed; top: 22px; right: 24px; z-index: 10; }

/* Shell and navigation */
.app-shell { background: var(--bg); }
.sidebar {
  width: var(--sidebar-width);
  padding: 16px 12px 12px;
  color: #d8deed;
  background: var(--sidebar);
  border-right: 1px solid rgba(255,255,255,.07);
  box-shadow: 10px 0 30px rgba(0,0,0,.14);
}
.brand { min-height: 52px; padding: 0 9px 14px; border-color: rgba(255,255,255,.08); }
.brand-mark { width: 35px; height: 35px; }
.brand-copy strong { font-size: 18px; }
.brand-copy small { color: #7f8aa5; }
.nav-list { gap: 2px; margin-top: 8px; padding-right: 2px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #26304a transparent; }
.nav-section-label { display: block; padding: 13px 11px 5px; color: #59647e; font-size: 9px; font-weight: 700; line-height: 1; text-transform: uppercase; }
.nav-item { min-height: 38px; gap: 10px; padding: 0 11px; color: #98a4bd; border-radius: 7px; }
.nav-item span { font-size: 12px; }
.nav-item svg { width: 17px; height: 17px; }
.nav-item:hover { color: #f8fafc; background: rgba(255,255,255,.055); }
.nav-item.active { color: #fff; background: rgba(99,102,241,.15); box-shadow: inset 0 0 0 1px rgba(129,140,248,.12); }
.nav-item.active::before { inset: 9px auto 9px 0; width: 3px; background: #818cf8; box-shadow: 0 0 10px rgba(129,140,248,.7); }
.nav-item.active svg { color: #a5b4fc; filter: none; }
.nav-item em { color: #c3cbda; background: rgba(255,255,255,.075); }
.nav-item em.warn { color: #fbbf24; background: rgba(245,158,11,.14); }
.sidebar-footer { border-color: rgba(255,255,255,.08); }
.system-state strong { color: #d9dfeb; }
.system-state small { color: #6f7b96; }
.page-shell { margin-left: var(--sidebar-width); }
.topbar {
  height: 70px;
  padding: 0 28px;
  background: color-mix(in srgb,var(--canvas) 91%,transparent);
  border-color: var(--line);
  box-shadow: none;
  backdrop-filter: blur(16px);
}
.topbar h1 { color: var(--ink); font-size: 18px; font-weight: 680; }
.topbar p { color: var(--muted); font-size: 10px; }
.global-search { width: min(340px,27vw); height: 38px; color: var(--text-subtle); background: var(--bg); border-color: var(--line); border-radius: 7px; }
.global-search input { color: var(--ink); }
.global-search input::placeholder { color: var(--text-subtle); }
.global-search kbd { color: var(--text-subtle); background: var(--panel); border-color: var(--line-strong); }
.icon-btn { color: var(--muted); background: transparent; border-color: var(--line); border-radius: 7px; }
.icon-btn:hover { color: var(--ink); background: var(--hover); border-color: var(--line-strong); }
.notification-btn span { background: var(--red); border-color: var(--canvas); }
.avatar { background: var(--brand-gradient); }
.profile-copy strong { color: var(--ink); }
.profile-btn svg, .profile-copy small { color: var(--muted); }
.profile-menu { background: var(--elevated); border-color: var(--line-strong); border-radius: 8px; box-shadow: var(--shadow); }
.profile-menu-user { border-color: var(--line); }
.profile-menu > button:hover { background: var(--red-soft); }

/* Content, cards and controls */
main { min-height: calc(100vh - 70px); padding: 24px 28px 38px; background: var(--bg); }
.view { max-width: 1720px; }
.section-heading { margin-bottom: 17px; }
.section-heading h2 { color: var(--ink); font-size: 16px; }
.section-heading p { color: var(--muted); font-size: 10px; }
.btn {
  min-height: 36px;
  padding: 0 13px;
  color: var(--ink);
  background: var(--panel);
  border-color: var(--line-strong);
  border-radius: 7px;
  box-shadow: none;
}
.btn:hover { color: var(--ink); background: var(--hover); border-color: color-mix(in srgb,var(--blue) 45%,var(--line-strong)); }
.btn.primary { color: #fff; background: var(--brand-gradient); border-color: transparent; box-shadow: 0 7px 16px rgba(99,102,241,.22); }
.btn.primary:hover { background: var(--brand-gradient); border-color: transparent; filter: brightness(1.08); transform: translateY(-1px); }
.btn.danger { color: var(--red); background: var(--red-soft); border-color: color-mix(in srgb,var(--red) 34%,transparent); }
.btn.link { color: var(--blue); background: transparent; }
.btn.small { min-height: 31px; font-size: 10px; }
.metric-grid { gap: 14px; margin-bottom: 18px; }
.metric-card, .summary-strip, .template-card, .role-card, .panel, .data-table-wrap, .settings-nav {
  color: var(--ink);
  background: var(--panel);
  border-color: var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(0,0,0,.08);
}
.metric-card { min-height: 122px; padding: 18px; }
.metric-card::before { width: 3px; background: #10b981; }
.metric-card:nth-child(2)::before { background: #818cf8; }
.metric-card:nth-child(3)::before { background: #f59e0b; }
.metric-card:nth-child(4)::before { background: #f43f5e; }
.metric-card.dashboard-action:hover, .summary-strip.summary-action:hover, .template-card:hover { border-color: color-mix(in srgb,var(--blue) 36%,var(--line)); box-shadow: var(--shadow); transform: translateY(-1px); }
.metric-top, .metric-foot, .metric-value span { color: var(--muted); }
.metric-value strong { color: var(--ink); font-size: 28px; font-variant-numeric: tabular-nums; }
.metric-icon { color: var(--green); background: var(--green-soft); border: 1px solid color-mix(in srgb,var(--green) 22%,transparent); border-radius: 7px; box-shadow: none; }
.metric-icon.blue { color: var(--blue); background: var(--blue-soft); border-color: color-mix(in srgb,var(--blue) 22%,transparent); }
.metric-icon.orange { color: var(--orange); background: var(--orange-soft); border-color: color-mix(in srgb,var(--orange) 22%,transparent); }
.metric-icon.red { color: var(--red); background: var(--red-soft); border-color: color-mix(in srgb,var(--red) 22%,transparent); }
.operational-strip > div { color: var(--ink); background: var(--panel); border-color: var(--line); border-radius: 8px; }
.operational-strip strong { color: var(--ink); }
.operational-strip span { color: var(--muted); }
.panel-header { min-height: 58px; padding: 0 18px; background: transparent; border-color: var(--line); }
.panel-title h3 { color: var(--ink); font-size: 13px; }
.panel-body { padding: 18px; }
.donut::after { background: var(--panel); }
.bar-track { background: var(--elevated); }
.work-bar-row span:first-child, .timeline-copy strong { color: var(--ink); }
.work-bar-row.dashboard-row-action:hover { background: var(--hover); }
.timeline-item::before { background: var(--line); }
.timeline-copy small, .timeline-time { color: var(--muted); }
.toolbar { min-height: 56px; padding: 9px 11px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 5px 16px rgba(0,0,0,.06); }
.search-field, .select, .field input, .field select, .field textarea, .integration-config-fields select, .integration-config-fields input, .chat-composer input {
  color: var(--ink);
  background: var(--bg);
  border-color: var(--line-strong);
  border-radius: 7px;
}
.search-field input { color: var(--ink); background: transparent; }
.search-field input::placeholder, .field input::placeholder, .field textarea::placeholder { color: var(--text-subtle); }
.field label { color: var(--muted); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb,var(--blue) 16%,transparent); }
.segmented { background: var(--bg); border-color: var(--line); border-radius: 7px; }
.segment { color: var(--muted); border-radius: 5px; }
.segment.active { color: var(--ink); background: var(--elevated); box-shadow: 0 1px 5px rgba(0,0,0,.14); }
.subtabs { border-color: var(--line); }
.subtab { color: var(--muted); }
.subtab.active { color: var(--ink); }
.subtab.active::after { background: var(--brand-gradient); }

/* Dense operational tables */
.data-table-wrap { scrollbar-color: color-mix(in srgb,var(--muted) 55%,transparent) var(--bg); }
.data-table { min-width: 1020px; }
.data-table th { height: 44px; padding: 0 15px; color: var(--muted); background: var(--panel-soft); border-color: var(--line); font-size: 10px; font-weight: 680; }
.data-table td { height: 58px; padding: 10px 15px; color: var(--ink); border-color: var(--line); font-size: 11px; }
.data-table tbody tr:hover { background: var(--hover); box-shadow: inset 3px 0 var(--blue); }
.data-table tbody tr.selected { background: var(--blue-soft); box-shadow: inset 3px 0 var(--blue); }
.task-table-scroll .data-table thead th { box-shadow: 0 1px 0 var(--line); }
.task-table-scroll::-webkit-scrollbar-track { background: var(--bg); }
.task-table-scroll::-webkit-scrollbar-thumb { background: color-mix(in srgb,var(--muted) 54%,transparent); border-color: var(--bg); }
.cell-stack strong { color: var(--ink); }
.cell-stack small, .address, .table-link { color: var(--muted); }
.table-link:hover { color: var(--blue); }
.device-icon { color: var(--blue); background: var(--blue-soft); border-color: var(--line); border-radius: 7px; }
.device-icon.software { color: var(--green); background: var(--green-soft); }
.device-icon.security { color: var(--orange); background: var(--orange-soft); }
.table-action { color: var(--muted); border-radius: 6px; }
.table-action:hover { color: var(--blue); background: var(--blue-soft); border-color: transparent; box-shadow: none; }
.status { color: var(--green); background: var(--green-soft); border: 1px solid color-mix(in srgb,var(--green) 22%,transparent); box-shadow: none; }
.status.warning { color: var(--orange); background: var(--orange-soft); border-color: color-mix(in srgb,var(--orange) 24%,transparent); }
.status.danger { color: var(--red); background: var(--red-soft); border-color: color-mix(in srgb,var(--red) 24%,transparent); }
.status.info { color: var(--blue); background: var(--blue-soft); border-color: color-mix(in srgb,var(--blue) 24%,transparent); }
.status.neutral { color: var(--muted); background: var(--hover); border-color: var(--line); }
.priority { color: var(--red); background: var(--red-soft); border-color: color-mix(in srgb,var(--red) 30%,transparent); }
.priority.medium { color: var(--yellow); background: var(--yellow-soft); border-color: color-mix(in srgb,var(--yellow) 30%,transparent); }
.priority.low { color: var(--blue); background: var(--blue-soft); border-color: color-mix(in srgb,var(--blue) 30%,transparent); }
.pagination { color: var(--muted); background: var(--panel-soft); border-color: var(--line); }
.page-btn { color: var(--ink); background: var(--panel); border-color: var(--line-strong); border-radius: 6px; }
.page-btn.active { color: #fff; background: var(--blue); border-color: var(--blue); }
.avatar.mini { border-color: var(--panel); }

/* Forms, workflows and system views */
.form-section { border-color: var(--line); }
.form-section h3, .detail-item strong, .setting-row strong { color: var(--ink); }
.form-section p, .detail-item small, .setting-row small { color: var(--muted); }
.detail-item, .auto-hint, .audit-note, .report-format-fixed, .empty-inline, .empty-state { color: var(--muted); background: var(--panel-soft); border-color: var(--line); }
.auto-hint { color: var(--blue); background: var(--blue-soft); border-color: color-mix(in srgb,var(--blue) 24%,transparent); }
.credential-banner { color: var(--yellow); background: var(--yellow-soft); border-color: color-mix(in srgb,var(--yellow) 28%,transparent); }
.credential-banner small { color: var(--muted); }
.inspection-selection-bar, .task-assignment-banner { color: var(--blue); background: var(--blue-soft); border-color: color-mix(in srgb,var(--blue) 25%,transparent); }
.selection-count, .visible-selection-state { color: var(--blue); background: var(--blue-soft); border-color: color-mix(in srgb,var(--blue) 25%,transparent); }
.inspection-choice, .operator-choice, .metric-device-group, .mapping-editor, .endpoint-editor, .asset-node-card, .cloud-disk-editor, .credential-account-editor, .asset-transfer-item {
  color: var(--ink);
  background: var(--panel);
  border-color: var(--line);
}
.inspection-choice:hover, .operator-choice:hover { background: var(--hover); border-color: var(--line-strong); }
.inspection-choice:has(input:checked), .operator-choice:has(input:checked) { background: var(--blue-soft); border-color: color-mix(in srgb,var(--blue) 48%,transparent); }
.inspection-choice:has(input:checked) .choice-indicator, .operator-choice:has(input:checked) .choice-indicator { background: var(--blue); border-color: var(--blue); }
.workflow-event-icon { color: var(--blue); background: var(--blue-soft); border-color: color-mix(in srgb,var(--blue) 25%,transparent); }
.workflow-event.completed .workflow-event-icon { color: var(--green); background: var(--green-soft); border-color: color-mix(in srgb,var(--green) 25%,transparent); }
.upload-zone, .upgrade-upload-box { color: var(--muted); background: var(--panel-soft); border-color: var(--line-strong); }
.upload-zone:hover { border-color: var(--blue); background: var(--blue-soft); }
.upload-item, .attachment-row { background: var(--panel); border-color: var(--line); }
.settings-link { color: var(--muted); border-radius: 6px; }
.settings-link:hover { color: var(--ink); background: var(--hover); }
.settings-link.active { color: var(--blue); background: var(--blue-soft); }
.setting-row { border-color: var(--line); }
.toggle { background: color-mix(in srgb,var(--muted) 42%,transparent); }
.toggle.on { background: var(--blue); }
.release-note, .task-chat-picker-row, .chat-message, .notification-item { color: var(--ink); background: var(--panel-soft); border-color: var(--line); border-radius: 7px; }
.release-note b, .notification-item strong { color: var(--ink); }
.release-note ul, .release-note > div:first-child small, .task-chat-picker-row small, .notification-item small, .notification-item time { color: var(--muted); }
.release-note > div:first-child strong { color: var(--blue); }
.notification-item:hover { background: var(--hover); border-color: var(--line-strong); }
.notification-item.unread { background: var(--blue-soft); border-left-color: var(--blue); }
.chat-message.mine { color: #fff; background: var(--brand-gradient); border-color: transparent; }
.official-template-notice, .ai-status-bar { color: var(--blue); background: var(--blue-soft); border-color: color-mix(in srgb,var(--blue) 25%,transparent); }
.ai-empty > span { color: var(--blue); background: var(--blue-soft); border-color: color-mix(in srgb,var(--blue) 25%,transparent); }
.ai-suggestions button, .ai-reference, .ai-message { color: var(--ink); background: var(--panel-soft); border-color: var(--line); }
.ai-suggestions button:hover, .ai-reference:hover { color: var(--blue); background: var(--blue-soft); border-color: color-mix(in srgb,var(--blue) 34%,transparent); }

/* Dialogs and feedback */
.modal-layer { background: rgba(3,6,15,.72); backdrop-filter: blur(5px); }
.modal { color: var(--ink); background: var(--panel); border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: 0 28px 90px rgba(0,0,0,.48); }
.modal-header, .modal-footer { background: var(--panel); border-color: var(--line); }
.modal-header h2 { color: var(--ink); }
.modal-header p { color: var(--muted); }
.toast { color: #f1f5f9; background: #11182a; border-color: rgba(129,140,248,.36); border-radius: 8px; box-shadow: 0 18px 48px rgba(0,0,0,.4); }
.toast small { color: #9da8bf; }

@media (max-width: 1240px) and (min-width: 841px) {
  .login-screen { grid-template-columns: minmax(320px,.72fr) minmax(600px,1.28fr); }
  .login-form-area { grid-template-columns: minmax(210px,300px) minmax(360px,420px); gap: 25px; padding-right: 30px; padding-left: 30px; }
  .login-form { padding-right: 27px; padding-left: 27px; }
}

@media (max-width: 1100px) {
  :root[data-theme="dark"], :root[data-theme="light"] { --sidebar-width: 218px; }
  .topbar { padding: 0 20px; }
  main { padding-right: 20px; padding-left: 20px; }
  .global-search { width: min(250px,24vw); }
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 840px) {
  .login-screen { height: auto; min-height: 100dvh; grid-template-columns: 1fr; overflow: visible; }
  .login-context { height: auto; min-height: 230px; padding: 26px 28px 24px; }
  .login-context-copy { margin: 28px 0 0; padding: 0; }
  .login-context-copy h1 { font-size: 30px; }
  .login-context::after, .login-system-state { display: none; }
  .login-form-area { height: auto; min-height: calc(100dvh - 230px); grid-template-columns: minmax(0,480px); grid-template-rows: auto auto auto; justify-content: center; gap: 20px; padding: 28px 20px 34px; }
  .login-brief { grid-column: 1; grid-row: 1; display: block; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
  .login-brief h2 { font-size: 21px; }
  .login-brief p, .login-brief-status { display: none; }
  .login-brief-grid { grid-template-columns: repeat(3,minmax(0,1fr)); margin-top: 18px; border: 0; gap: 6px; }
  .login-brief-grid div { display: block; padding: 10px 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 7px; }
  .login-brief-grid span { display: block; margin-top: 4px; }
  .login-form { grid-column: 1; grid-row: 2; }
  .login-form-area::after { grid-column: 1; grid-row: 3; text-align: center; }
  .login-theme-toggle { top: 16px; right: 16px; color: #d8deed; border-color: rgba(255,255,255,.12); }
  .sidebar { width: min(290px,86vw); box-shadow: 20px 0 50px rgba(0,0,0,.38); }
  .page-shell { margin-left: 0; }
  .topbar { height: 64px; padding: 0 14px; }
  .topbar p, .global-search kbd { display: none; }
  .global-search { width: min(220px,31vw); }
  main { min-height: calc(100vh - 64px); padding: 18px 14px 28px; }
  .metric-grid, .inspection-summary, .role-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-nav { display: flex; gap: 4px; overflow-x: auto; }
  .settings-link { width: auto; flex: 0 0 auto; padding: 0 12px; }
}

@media (max-width: 600px) {
  .login-context { min-height: 190px; padding: 21px 18px 18px; }
  .login-context-copy { margin-top: 24px; }
  .login-context-copy h1 { font-size: 25px; }
  .login-context-copy p { margin-top: 9px; font-size: 11px; }
  .login-form-area { min-height: calc(100dvh - 190px); padding: 22px 12px 30px; }
  .login-brief { display: none; }
  .login-form { grid-row: 1; padding: 24px 17px 20px; }
  .login-form-area::after { grid-row: 2; padding-top: 12px; }
  .login-captcha-row { grid-template-columns: minmax(0,1fr) 132px; }
  .captcha-image-button { width: 132px; grid-template-columns: 102px 28px; }
  .captcha-image-button img, .captcha-image-button > span { width: 102px; }
  .topbar h1 { font-size: 15px; }
  .topbar-actions { gap: 4px; }
  .global-search { display: none; }
  .profile-copy, .profile-btn > svg { display: none; }
  .profile-btn { padding: 0; }
  .section-heading { align-items: stretch; flex-direction: column; }
  .section-actions { width: 100%; }
  .section-actions .btn { flex: 1 1 auto; }
  .metric-grid, .inspection-summary, .role-grid, .template-grid { grid-template-columns: 1fr; }
  .operational-strip { grid-template-columns: 1fr; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .filters { width: 100%; }
  .search-field { min-width: 100%; }
  .select { min-width: calc(50% - 4px); flex: 1; }
  .modal-layer { align-items: flex-end; padding: 0; }
  .modal, .modal.small, .modal.large { width: 100%; max-height: 94dvh; border-radius: 8px 8px 0 0; }
  .modal-header, .modal-footer { padding-right: 16px; padding-left: 16px; }
  .modal-body { padding: 17px 16px; }
  .modal-footer { flex-wrap: wrap; }
  .modal-footer .btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Login deep-dive implementation: one product surface, two clear roles. */
:root[data-theme="dark"] {
  --login-stage: #0d1323;
  --login-feature: #10182c;
  --login-feature-strong: #f1f5f9;
  --login-feature-muted: #9ca8bf;
  --login-form-surface: #131a2e;
}
:root[data-theme="light"] {
  --login-stage: #eef0f8;
  --login-feature: #edf0fb;
  --login-feature-strong: #182033;
  --login-feature-muted: #5f6b82;
  --login-form-surface: #ffffff;
}
.login-screen {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  min-height: 100dvh;
  height: auto;
  padding: clamp(22px, 4vh, 48px) clamp(20px, 4vw, 64px);
  overflow: auto;
  background-color: var(--login-stage);
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
}
.login-screen::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(135deg, color-mix(in srgb, var(--blue) 7%, transparent), transparent 44%, color-mix(in srgb, #06b6d4 5%, transparent));
  mask-image: none;
  opacity: 1;
}
.login-stage {
  position: relative;
  z-index: 1;
  width: min(1040px, 100%);
  display: grid;
  gap: 14px;
}
.login-card {
  min-height: min(600px, calc(100dvh - 96px));
  display: grid;
  grid-template-columns: minmax(360px, 42%) minmax(460px, 58%);
  overflow: hidden;
  background: var(--login-form-surface);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: 0 28px 72px rgba(0,0,0,.32);
}
.login-context {
  position: relative;
  width: auto;
  height: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 38px 40px 32px;
  color: var(--login-feature-strong);
  background: var(--login-feature);
  border-right: 1px solid var(--line);
}
.login-context::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .45;
  background-image: linear-gradient(color-mix(in srgb,var(--blue) 9%,transparent) 1px,transparent 1px),linear-gradient(90deg,color-mix(in srgb,var(--blue) 9%,transparent) 1px,transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg,#000,transparent 84%);
}
.login-context::after { display: none; }
.login-brand, .login-context-copy, .login-system-state { position: relative; z-index: 1; }
.login-brand { gap: 12px; }
.login-brand > div:last-child { display: grid; gap: 3px; }
.login-brand strong { color: var(--login-feature-strong); font-size: 20px; }
.login-brand small { margin: 0; color: var(--login-feature-muted); font-size: 10px; }
.login-context-copy {
  max-width: 350px;
  margin: 28px 0 20px;
  padding: 0;
}
.login-kicker { margin-bottom: 15px; color: #67e8f9; font-size: 9px; letter-spacing: 1.4px; }
:root[data-theme="light"] .login-kicker { color: #0e7490; }
.login-context-copy h1 {
  max-width: none;
  margin: 0;
  color: var(--login-feature-strong);
  font-size: clamp(32px, 3vw, 42px);
  font-weight: 720;
  line-height: 1.2;
  letter-spacing: 0;
  text-shadow: none;
}
.login-context-copy > p {
  max-width: 330px;
  margin: 16px 0 24px;
  color: var(--login-feature-muted);
  font-size: 12px;
  line-height: 1.75;
}
.login-capability-list { display: grid; gap: 8px; }
.login-capability {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  min-height: 55px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: color-mix(in srgb, var(--login-feature-strong) 3%, transparent);
}
.login-capability > span {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: #a5b4fc;
  background: rgba(99,102,241,.13);
  border: 1px solid rgba(129,140,248,.18);
  border-radius: 7px;
}
:root[data-theme="light"] .login-capability > span { color: #4f46e5; }
.login-capability svg { width: 16px; height: 16px; }
.login-capability strong, .login-capability small { display: block; }
.login-capability strong { color: var(--login-feature-strong); font-size: 11px; font-weight: 650; }
.login-capability small { margin-top: 3px; color: var(--login-feature-muted); font-size: 9px; line-height: 1.4; }
.login-system-state {
  grid-template-columns: 9px minmax(0, 1fr);
  gap: 10px;
  padding-top: 18px;
  color: var(--login-feature-strong);
  border-top: 1px solid var(--line);
}
.login-system-state > div { display: grid; gap: 3px; }
.login-system-state strong { font-size: 10px; font-weight: 650; }
.login-system-state small { justify-self: auto; color: var(--login-feature-muted); font-size: 8px; }
.login-form-area {
  width: auto;
  height: auto;
  min-height: 0;
  display: grid;
  grid-template: none;
  place-items: center;
  padding: 42px clamp(42px, 5vw, 70px);
  overflow: visible;
  background: var(--login-form-surface);
}
.login-form-area::after { display: none; content: none; }
.login-form {
  width: min(100%, 420px);
  max-width: 420px;
  display: block;
  grid-column: auto;
  grid-row: auto;
  align-self: auto;
  margin: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
}
.login-form-head { gap: 13px; margin-bottom: 24px; }
.login-icon { width: 44px; height: 44px; border-radius: 8px; }
.login-form-head h2 { font-size: 23px; }
.login-form-head p { margin-top: 4px; color: var(--muted); }
.login-alert {
  margin-bottom: 15px;
  padding: 10px 12px;
  color: var(--red);
  background: var(--red-soft);
  border: 1px solid color-mix(in srgb,var(--red) 36%,transparent);
  border-radius: 7px;
  font-size: 10px;
}
.login-alert.info {
  color: var(--blue);
  background: var(--blue-soft);
  border-color: color-mix(in srgb,var(--blue) 32%,transparent);
}
.login-field { margin-top: 14px; }
.login-field > span { margin-bottom: 7px; color: var(--muted); font-size: 10px; }
.login-field > div {
  height: 44px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  box-shadow: none;
}
.login-field > div:focus-within {
  color: var(--ink);
  background: var(--bg);
  border-color: var(--blue);
  box-shadow: 0 0 0 3px color-mix(in srgb,var(--blue) 18%,transparent);
}
.login-field svg { color: var(--text-subtle); }
.login-field input, .login-field input:focus {
  color: var(--ink);
  background: transparent;
  caret-color: var(--blue);
  box-shadow: none;
}
.login-field input:-webkit-autofill,
.login-field input:-webkit-autofill:hover,
.login-field input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 1000px var(--bg) inset;
  box-shadow: 0 0 0 1000px var(--bg) inset;
  transition: background-color 99999s ease-out 0s;
}
.password-toggle { color: var(--muted); }
.login-captcha-row { grid-template-columns: minmax(0, 1fr) 154px; gap: 10px; }
.captcha-image-button {
  width: 154px;
  height: 44px;
  grid-template-columns: 120px 32px;
  padding: 0;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
}
.captcha-image-button img, .captcha-image-button > span { width: 120px; height: 42px; }
.captcha-image-button img { object-fit: cover; }
.captcha-refresh-icon { width: 15px; height: 15px; color: var(--blue); }
.remember-login { margin: 15px 0 18px; color: var(--muted); }
.login-submit { height: 44px; border-radius: 7px; }
.login-foot { margin-top: 15px; color: var(--text-subtle); }
.login-stage-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 4px;
  color: color-mix(in srgb,var(--login-feature-muted) 78%,transparent);
  font-size: 9px;
}
.login-theme-toggle {
  position: fixed;
  top: 20px;
  right: 22px;
  z-index: 5;
  color: var(--login-feature-muted);
  background: color-mix(in srgb,var(--login-feature) 86%,transparent);
  border-color: var(--line-strong);
}

@media (max-width: 920px) {
  .login-screen { place-items: start center; padding: 20px; }
  .login-stage { width: min(680px, 100%); margin: auto 0; }
  .login-card { min-height: 0; grid-template-columns: 1fr; }
  .login-context { min-height: 210px; padding: 25px 28px 23px; border-right: 0; border-bottom: 1px solid var(--line); }
  .login-context-copy { max-width: none; margin: 28px 0 0; }
  .login-context-copy h1 { font-size: 28px; }
  .login-context-copy > p { max-width: 520px; margin: 10px 0 0; }
  .login-capability-list { display: none; }
  .login-system-state { display: none; }
  .login-form-area { padding: 32px 38px 36px; }
  .login-theme-toggle { top: 14px; right: 14px; }
}

@media (max-width: 520px) {
  .login-screen { padding: 0; background-image: none; }
  .login-stage { width: 100%; min-height: 100dvh; gap: 0; }
  .login-card { min-height: 100dvh; grid-template-rows: auto 1fr; border: 0; border-radius: 0; box-shadow: none; }
  .login-context { min-height: 164px; justify-content: flex-start; padding: 20px 18px 18px; }
  .login-brand .brand-mark { width: 32px; height: 32px; }
  .login-brand strong { font-size: 17px; }
  .login-context-copy { margin-top: 21px; }
  .login-kicker { margin-bottom: 8px; font-size: 8px; }
  .login-context-copy h1 { font-size: 23px; }
  .login-context-copy h1 br { display: none; }
  .login-context-copy > p { margin-top: 7px; font-size: 10px; line-height: 1.55; }
  .login-form-area { align-items: start; padding: 27px 17px 30px; }
  .login-form-head { margin-bottom: 20px; }
  .login-captcha-row { grid-template-columns: minmax(0, 1fr) 132px; }
  .captcha-image-button { width: 132px; grid-template-columns: 101px 29px; }
  .captcha-image-button img, .captcha-image-button > span { width: 101px; }
  .login-stage-foot { display: none; }
  .login-theme-toggle { color: var(--login-feature-muted); }
}

/* Theme integrity for AI and system settings. */
.settings-grid { align-items: start; }
.settings-grid > .panel { width: 100%; min-height: 0; align-self: start; }
.audit-overview {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.audit-overview > div {
  min-width: 0;
  padding: 14px;
  color: var(--ink);
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  border-radius: 7px;
}
.audit-overview > div:nth-child(2) { border-left-color: var(--green); }
.audit-overview > div:nth-child(3) { border-left-color: var(--orange); }
.audit-overview > div:nth-child(4) { border-left-color: var(--red); }
.audit-overview strong { color: var(--ink); }
.audit-overview span { color: var(--muted); }
.dictionary-grid > div {
  color: var(--ink);
  background: var(--panel-soft);
  border-color: var(--line);
  border-radius: 7px;
}
.dictionary-grid span { color: var(--ink); }
.dictionary-grid small { color: var(--muted); }
.settings-grid .data-table .empty-state {
  min-height: 108px;
  background: transparent;
  border: 0;
}
.settings-grid .integration-grid { grid-template-columns: 1fr; }
.integration-grid article {
  grid-template-columns: 36px minmax(0, 1fr) auto;
  color: var(--ink);
  background: var(--panel-soft);
  border-color: var(--line);
}
.integration-grid article > .status {
  grid-column: 3;
  grid-row: 1;
  align-self: start;
  justify-self: end;
}
.integration-grid strong { color: var(--ink); }
.integration-grid small { color: var(--muted); }
.integration-grid code { color: var(--blue); }
.integration-advanced-fields {
  background: var(--bg);
  border-color: var(--line);
}

.ai-view { max-width: 1420px; }
.ai-status-bar {
  color: var(--blue);
  background: var(--blue-soft);
  border-color: color-mix(in srgb, var(--blue) 25%, transparent);
}
.ai-status-bar.warning {
  color: var(--orange);
  background: var(--orange-soft);
  border-color: color-mix(in srgb, var(--orange) 28%, transparent);
}
.ai-mode-switch button.active {
  color: var(--ink);
  background: var(--panel);
  box-shadow: 0 1px 5px rgba(0,0,0,.14);
}
.ai-console {
  display: grid;
  grid-template-rows: minmax(0, auto) auto;
  overflow: hidden;
  background: var(--panel);
}
.ai-conversation {
  height: auto;
  min-height: 0;
  max-height: min(58dvh, 680px);
  padding: 20px;
  overflow-y: auto;
  scrollbar-gutter: stable;
  background: var(--panel-soft);
}
.ai-conversation.is-empty { min-height: 260px; }
.ai-conversation.has-messages { min-height: 330px; }
.ai-empty { min-height: 252px; color: var(--muted); }
.ai-empty > span {
  color: var(--blue);
  background: var(--blue-soft);
  border-color: color-mix(in srgb, var(--blue) 24%, transparent);
  border-radius: 12px;
}
.ai-empty strong { color: var(--ink); }
.ai-suggestions button {
  color: var(--muted);
  background: var(--panel);
  border-color: var(--line-strong);
}
.ai-suggestions button:hover {
  color: var(--blue);
  background: var(--blue-soft);
  border-color: color-mix(in srgb, var(--blue) 34%, transparent);
}
.ai-message {
  width: min(100%, 920px);
  margin-bottom: 18px;
  color: var(--ink);
  background: transparent;
  border: 0;
}
.ai-message.user {
  width: min(92%, 760px);
  grid-template-columns: minmax(0, 1fr) 34px;
  margin-left: auto;
}
.ai-message.user > .avatar { grid-column: 2; grid-row: 1; }
.ai-message.user > div { grid-column: 1; grid-row: 1; }
.ai-answer {
  color: var(--ink);
  background: var(--panel);
  border-color: var(--line);
  box-shadow: 0 4px 14px rgba(0,0,0,.08);
}
.ai-message.user .ai-answer {
  color: var(--ink);
  background: var(--blue-soft);
  border-color: color-mix(in srgb, var(--blue) 24%, transparent);
}
.ai-message.error .ai-answer {
  color: var(--red);
  background: var(--red-soft);
  border-color: color-mix(in srgb, var(--red) 28%, transparent);
}
.ai-avatar { background: var(--brand-gradient); box-shadow: 0 6px 16px rgba(99,102,241,.22); }
.ai-reference {
  color: var(--ink);
  background: var(--panel);
  border-color: var(--line);
}
.ai-reference:hover {
  color: var(--blue);
  background: var(--blue-soft);
  border-color: color-mix(in srgb, var(--blue) 34%, transparent);
}
.ai-reference.external > svg:first-child { color: var(--blue); }
.ai-composer {
  padding: 15px 16px;
  background: var(--panel);
  border-color: var(--line);
}
.ai-composer textarea,
.ai-composer textarea:focus {
  color: var(--ink);
  background: var(--bg);
  border-color: var(--line-strong);
}
.ai-composer textarea::placeholder { color: var(--text-subtle); }
.ai-composer textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 16%, transparent);
}
.ai-image-item { color: var(--ink); background: var(--panel-soft); border-color: var(--line); }
.ai-image-item img { background: var(--bg); }
.ai-config-notice {
  color: var(--muted);
  background: var(--blue-soft);
  border: 1px solid color-mix(in srgb, var(--blue) 22%, transparent);
}
.ai-config-notice svg { color: var(--blue); }

@media (max-width: 760px) {
  .ai-conversation { max-height: none; padding: 15px 12px; }
  .ai-conversation.is-empty, .ai-empty { min-height: 220px; }
  .ai-conversation.has-messages { min-height: 280px; max-height: 56dvh; }
  .ai-message { width: 100%; }
  .ai-message.user { width: 94%; }
  .ai-composer { padding: 13px 12px; }
  .integration-grid article { grid-template-columns: 34px minmax(0, 1fr); }
  .integration-grid article > .status { grid-column: 2; grid-row: auto; justify-self: start; }
  .integration-config-fields { grid-template-columns: 1fr; }
  .integration-config-fields > * { grid-column: 1 / -1; }
}

.handover-action { color: var(--blue); }
.handover-route {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 18px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}
.handover-route > div {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  column-gap: 12px;
}
.handover-route > div > .avatar,
.handover-route > div > svg { grid-row: 1 / span 2; }
.handover-route > div > strong { align-self: end; }
.handover-route > div > small { align-self: start; color: var(--muted); }
.handover-route > svg { justify-self: center; color: var(--blue); }
.handover-target-placeholder > svg { color: var(--blue); }
.handover-impact-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(112px, 1fr));
  gap: 10px;
  margin: 12px 0 18px;
}
.handover-impact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}
.handover-impact-item > span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  color: var(--blue);
  border-radius: 7px;
  background: var(--blue-soft);
}
.handover-impact-item strong { display: block; font-size: 20px; line-height: 1.1; }
.handover-impact-item small { display: block; margin-top: 4px; color: var(--muted); }
.handover-affected-list { display: grid; gap: 8px; margin: -4px 0 18px; }
.handover-affected {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
}
.handover-affected summary,
.handover-history-detail summary { color: var(--blue); cursor: pointer; font-weight: 650; }
.handover-affected > div { display: flex; flex-wrap: wrap; gap: 7px; padding-top: 10px; }
.handover-affected code { padding: 4px 7px; border-radius: 5px; background: var(--bg); }
.handover-confirm {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 14px 0;
  color: var(--ink);
  font-weight: 600;
}
.handover-confirm input { width: 17px; height: 17px; accent-color: var(--blue); }
.handover-table-route { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.handover-table-route svg { width: 15px; color: var(--blue); }
.handover-history-detail { min-width: 130px; }
.handover-history-detail[open] { min-width: min(520px, 48vw); }
.handover-history-detail .handover-impact-grid { grid-template-columns: repeat(5, minmax(82px, 1fr)); margin: 10px 0; }
.handover-history-detail .handover-impact-item { min-height: 58px; padding: 8px; }
.handover-history-detail .handover-impact-item > span { display: none; }
.handover-history-detail p { margin: 8px 0 0; color: var(--muted); }
.field-error { color: var(--red) !important; }

@media (max-width: 900px) {
  .handover-impact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .handover-history-detail .handover-impact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .handover-route { grid-template-columns: 1fr; }
  .handover-route > svg { transform: rotate(90deg); }
  .handover-impact-grid { grid-template-columns: 1fr; }
}

/* Inspection and fault dialogs: keep every surface inside the active theme. */
.modal:has(#inspectionForm),
.modal:has(#faultForm) {
  width: min(1080px, calc(100vw - 40px));
  max-height: min(900px, calc(100vh - 40px));
}

.inspection-form-body,
.fault-form-body {
  color: var(--ink);
  background: var(--panel);
}

.inspection-form-body > .auto-hint {
  margin-bottom: 18px;
}

.inspection-form-body .form-grid,
.fault-form-body > .form-grid {
  gap: 16px;
}

.inspection-form-body .field input,
.inspection-form-body .field select,
.inspection-form-body .field textarea,
.fault-form-body .field input,
.fault-form-body .field select,
.fault-form-body .field textarea {
  color: var(--ink);
  background: var(--bg);
  border-color: var(--line-strong);
}

.inspection-form-body .field input:focus,
.inspection-form-body .field select:focus,
.inspection-form-body .field textarea:focus,
.fault-form-body .field input:focus,
.fault-form-body .field select:focus,
.fault-form-body .field textarea:focus {
  background: var(--bg);
}

.inspection-form-body .inspection-builder-grid {
  grid-template-columns: minmax(0, 1.7fr) minmax(260px, .9fr);
  gap: 16px;
  margin-top: 20px;
}

.inspection-form-body .inspection-select-panel {
  display: flex;
  min-height: 0;
  flex-direction: column;
  background: var(--panel);
  border-color: var(--line);
  box-shadow: 0 7px 20px rgba(0, 0, 0, .12);
}

.inspection-form-body .builder-panel-head {
  min-height: 64px;
  padding: 12px 14px;
  background: var(--panel-soft);
  border-color: var(--line);
}

.inspection-form-body .builder-panel-head h3 {
  color: var(--ink);
  font-size: 12px;
}

.inspection-form-body .builder-panel-head p {
  color: var(--muted);
}

.inspection-form-body .inspection-device-toolbar {
  grid-template-columns: minmax(150px, .85fr) minmax(180px, 1.15fr);
  padding: 11px 11px 0;
  background: var(--panel);
}

.inspection-form-body .inspection-device-toolbar select,
.inspection-form-body .inspection-device-search {
  color: var(--ink);
  background: var(--bg);
  border-color: var(--line-strong);
}

.inspection-form-body .inspection-device-search input {
  color: var(--ink);
  background: transparent;
}

.inspection-form-body .inspection-device-search input::placeholder {
  color: var(--text-subtle);
}

.inspection-form-body .inspection-batch-actions {
  padding-bottom: 1px;
}

.inspection-form-body .visible-selection-state,
.inspection-form-body .selected-asset-summary {
  color: var(--muted);
  background: var(--panel-soft);
  border-color: var(--line);
}

.inspection-form-body .inspection-choice-list,
.inspection-form-body .operator-choice-list {
  max-height: 248px;
  background: var(--bg);
  border-top: 1px solid var(--line);
  overflow-y: auto;
}

.inspection-form-body .inspection-choice-list {
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 8px;
  padding: 11px;
}

.inspection-form-body .operator-choice-list {
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 11px;
}

.inspection-form-body .inspection-choice,
.inspection-form-body .operator-choice {
  color: var(--ink);
  background: var(--panel);
  border-color: var(--line);
}

.inspection-form-body .inspection-choice:hover,
.inspection-form-body .operator-choice:hover {
  background: var(--hover);
  border-color: var(--line-strong);
}

.inspection-form-body .inspection-choice:has(input:checked),
.inspection-form-body .operator-choice:has(input:checked) {
  background: var(--blue-soft);
  border-color: color-mix(in srgb, var(--blue) 48%, transparent);
}

.inspection-form-body .assignment-section {
  margin-top: 18px;
}

.inspection-form-body .assignment-section .form-section,
.inspection-form-body > .form-section {
  margin-top: 18px;
}

.inspection-form-body .device-assignment-row,
.inspection-form-body .metric-device-group {
  color: var(--ink);
  background: var(--panel);
  border-color: var(--line);
}

.inspection-form-body .metric-device-group[open] summary {
  background: var(--panel-soft);
  border-color: var(--line);
}

.fault-form-body > .form-grid {
  align-items: start;
}

.fault-form-body .field.full:has(#faultReviewerChoices) {
  padding: 13px 14px 12px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.fault-form-body #faultReviewerChoices {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
  margin-top: 7px;
}

.fault-form-body #faultReviewerChoices .operator-choice {
  min-height: 48px;
  padding: 8px 9px;
  background: var(--panel);
}

.fault-form-body #faultReviewerChoices .operator-choice:hover {
  background: var(--hover);
}

.fault-form-body #faultReviewerChoices .operator-choice:has(input:checked) {
  background: var(--blue-soft);
}

.fault-form-body .reviewer-sequence-hint {
  margin-top: 8px;
  color: var(--muted);
}

.fault-form-body textarea[name="description"] {
  min-height: 124px;
  line-height: 1.65;
}

.fault-form-body .form-section {
  margin-top: 20px;
}

.fault-form-body .upload-zone,
.fault-form-body .evidence-paste-zone {
  color: var(--muted);
  background: var(--panel-soft);
  border-color: var(--line-strong);
}

.fault-form-body .upload-zone:hover,
.fault-form-body .evidence-paste-zone:focus,
.fault-form-body .evidence-paste-zone:focus-within {
  background: var(--blue-soft);
  border-color: var(--blue);
}

.fault-form-body .upload-zone-copy strong,
.fault-form-body .evidence-paste-zone > span strong {
  color: var(--ink);
}

@media (max-width: 840px) {
  .modal:has(#inspectionForm),
  .modal:has(#faultForm) {
    width: 100%;
    max-height: 94dvh;
  }

  .inspection-form-body .inspection-builder-grid {
    grid-template-columns: 1fr;
  }

  .inspection-form-body .inspection-choice-list,
  .inspection-form-body .operator-choice-list {
    max-height: 220px;
  }
}

@media (max-width: 600px) {
  .inspection-form-body .inspection-device-toolbar {
    grid-template-columns: 1fr;
  }

  .inspection-form-body .inspection-choice-list,
  .fault-form-body #faultReviewerChoices {
    grid-template-columns: 1fr;
  }
}

/* Change, transfer and asset approval dialogs use the same dark/light tokens. */
.modal:has(#changeForm),
.modal:has(#assetTransferForm),
.modal:has(#assetBatchDeleteForm) {
  width: min(1180px, calc(100vw - 40px));
  max-height: min(900px, calc(100vh - 40px));
}

.change-editor-body,
.transfer-form-body,
.asset-batch-delete-body {
  color: var(--ink);
  background: var(--panel);
}

.change-editor-body .change-form-grid,
.change-editor-body .change-plan-form,
.change-editor-body .change-asset-picker,
.transfer-form-body .transfer-asset-choice-list,
.transfer-form-body .transfer-new-asset-editor,
.asset-batch-delete-body .asset-delete-preview {
  color: var(--ink);
  background: var(--panel-soft);
  border-color: var(--line);
}

.change-editor-body .change-form-grid,
.change-editor-body .change-plan-form {
  padding: 18px;
}

.change-editor-body .change-form-grid .field input,
.change-editor-body .change-form-grid .field select,
.change-editor-body .change-plan-form .field textarea,
.change-editor-body .change-asset-controls .search-field,
.change-editor-body .change-asset-controls .select,
.transfer-form-body .field input,
.transfer-form-body .field select,
.transfer-form-body .field textarea,
.transfer-form-body .transfer-asset-filter select,
.asset-batch-delete-body .field textarea {
  color: var(--ink);
  background: var(--bg);
  border-color: var(--line-strong);
}

.change-editor-body .change-form-grid .field input::placeholder,
.change-editor-body .change-plan-form .field textarea::placeholder,
.transfer-form-body .field input::placeholder,
.transfer-form-body .field textarea::placeholder,
.asset-batch-delete-body .field textarea::placeholder {
  color: var(--text-subtle);
}

.change-editor-body .change-asset-picker {
  padding: 14px;
}

.change-editor-body .change-asset-selection-summary {
  color: var(--blue);
  background: var(--blue-soft);
  border: 1px solid color-mix(in srgb, var(--blue) 24%, transparent);
}

.change-editor-body .selection-card > span {
  color: var(--ink);
  background: var(--panel);
  border-color: var(--line);
}

.change-editor-body .selection-card:hover > span {
  background: var(--hover);
  border-color: var(--line-strong);
}

.change-editor-body .selection-card input:checked + span {
  color: var(--ink);
  background: var(--blue-soft);
  border-color: color-mix(in srgb, var(--blue) 48%, transparent);
}

.change-editor-body .change-asset-card em {
  color: var(--muted);
}

.transfer-form-body > .form-grid:first-child {
  align-items: start;
}

.transfer-form-body .transfer-existing-assets {
  min-height: 0;
  padding: 13px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.transfer-form-body .transfer-asset-choice-list {
  max-height: 235px;
  padding: 9px;
  overflow-y: auto;
}

.transfer-form-body .transfer-asset-choice {
  color: var(--ink);
  background: var(--panel);
  border-color: var(--line);
}

.transfer-form-body .transfer-asset-choice:hover {
  background: var(--hover);
  border-color: var(--line-strong);
}

.transfer-form-body .transfer-asset-choice:has(input:checked) {
  color: var(--ink);
  background: var(--blue-soft);
  border-color: color-mix(in srgb, var(--blue) 48%, transparent);
}

.transfer-form-body .transfer-asset-choice small,
.transfer-form-body > small,
.transfer-form-body .transfer-existing-assets > small {
  color: var(--muted);
}

.transfer-form-body .form-section {
  margin-top: 20px;
}

.transfer-form-body .transfer-new-asset-editor {
  padding: 13px;
}

.transfer-form-body .transfer-new-asset-editor h4,
.transfer-form-body .transfer-new-asset-editor strong {
  color: var(--ink);
}

.asset-selection-summary {
  min-width: 180px;
  display: grid;
  gap: 3px;
  margin-left: auto;
  padding: 7px 10px;
  color: var(--blue);
  background: var(--blue-soft);
  border: 1px solid color-mix(in srgb, var(--blue) 22%, transparent);
  border-radius: 7px;
}

.asset-selection-summary strong {
  font-size: 10px;
}

.asset-selection-summary small {
  color: var(--muted);
  font-size: 8px;
  line-height: 1.35;
}

.asset-batch-delete-body .asset-delete-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px;
  max-height: 260px;
  padding: 10px;
  overflow-y: auto;
  border-radius: 8px;
}

.asset-delete-preview > div {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 10px 11px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.asset-delete-preview strong,
.asset-delete-preview small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-delete-preview small {
  color: var(--muted);
  font-size: 9px;
}

.asset-delete-detail-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.asset-delete-detail-list > div {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  color: var(--ink);
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.asset-delete-detail-list small {
  color: var(--muted);
  font-size: 9px;
}

@media (max-width: 840px) {
  .modal:has(#changeForm),
  .modal:has(#assetTransferForm),
  .modal:has(#assetBatchDeleteForm) {
    width: 100%;
    max-height: 94dvh;
  }

  .asset-selection-summary {
    width: 100%;
    margin-left: 0;
  }
}

@media (max-width: 600px) {
  .asset-batch-delete-body .asset-delete-preview,
  .asset-delete-detail-list {
    grid-template-columns: 1fr;
  }
}

/* Search and filter controls must keep one readable surface in every theme. */
:root[data-theme] .global-search,
:root[data-theme] .search-field,
:root[data-theme] .inspection-device-search {
  color: var(--muted);
  background-color: var(--bg);
  border-color: var(--line-strong);
  box-shadow: none;
}

:root[data-theme] .global-search:focus-within,
:root[data-theme] .search-field:focus-within,
:root[data-theme] .inspection-device-search:focus-within {
  color: var(--ink);
  background-color: var(--bg);
  border-color: var(--blue);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 18%, transparent);
  outline: 0;
}

:root[data-theme] .global-search input,
:root[data-theme] .global-search input:hover,
:root[data-theme] .global-search input:focus,
:root[data-theme] .global-search input:focus-visible,
:root[data-theme] .search-field input,
:root[data-theme] .search-field input:hover,
:root[data-theme] .search-field input:focus,
:root[data-theme] .search-field input:focus-visible,
:root[data-theme] .inspection-device-search input,
:root[data-theme] .inspection-device-search input:hover,
:root[data-theme] .inspection-device-search input:focus,
:root[data-theme] .inspection-device-search input:focus-visible {
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  box-shadow: none;
  caret-color: var(--blue);
  -webkit-text-fill-color: var(--ink);
}

:root[data-theme] .global-search input::placeholder,
:root[data-theme] .search-field input::placeholder,
:root[data-theme] .inspection-device-search input::placeholder {
  color: var(--text-subtle);
  opacity: 1;
}

:root[data-theme] .global-search:focus-within svg,
:root[data-theme] .search-field:focus-within svg,
:root[data-theme] .inspection-device-search:focus-within svg {
  color: var(--blue);
}

:root[data-theme] select.select,
:root[data-theme] .inspection-device-toolbar select,
:root[data-theme] .transfer-asset-filter select {
  color: var(--ink);
  background-color: var(--bg);
  border-color: var(--line-strong);
}

:root[data-theme] select.select:focus,
:root[data-theme] .inspection-device-toolbar select:focus,
:root[data-theme] .transfer-asset-filter select:focus {
  color: var(--ink);
  background-color: var(--bg);
  border-color: var(--blue);
  outline: 0;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 18%, transparent);
}

:root[data-theme] select option {
  color: var(--ink);
  background: var(--panel);
}

:root[data-theme] input[type="search"]::-webkit-search-cancel-button {
  cursor: pointer;
  opacity: .68;
}

:root[data-theme="dark"] input[type="search"]::-webkit-search-cancel-button {
  filter: invert(1);
}

/* Seven work-order states use two complete rows instead of leaving one orphan card. */
.inspection-summary.work-order-summary {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.inspection-summary.work-order-summary > .summary-strip {
  grid-column: span 3;
}

.inspection-summary.work-order-summary > .summary-strip:nth-last-child(-n + 3) {
  grid-column: span 4;
}

@media (max-width: 1180px) {
  .inspection-summary.work-order-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inspection-summary.work-order-summary > .summary-strip,
  .inspection-summary.work-order-summary > .summary-strip:nth-last-child(-n + 3) {
    grid-column: auto;
  }

  .inspection-summary.work-order-summary > .summary-strip:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 480px) {
  .inspection-summary.work-order-summary {
    grid-template-columns: 1fr;
  }

  .inspection-summary.work-order-summary > .summary-strip:last-child {
    grid-column: auto;
  }
}

/* Workflow detail surfaces must remain readable in every theme. */
:root[data-theme] .modal .fault-context,
:root[data-theme] .modal .review-group,
:root[data-theme] .modal .inspection-checklist {
  color: var(--ink);
  background: var(--panel-soft);
  border-color: var(--line);
}

:root[data-theme] .modal .fault-description {
  color: var(--ink);
  background: color-mix(in srgb, var(--red) 7%, var(--panel));
  border-left-color: var(--red);
}

:root[data-theme] .modal .order-treatment-highlight {
  color: var(--ink);
  background: color-mix(in srgb, var(--green) 7%, var(--panel));
  border-color: color-mix(in srgb, var(--green) 32%, var(--line));
  border-left-color: var(--green);
}

:root[data-theme] .modal .treatment-content,
:root[data-theme] .modal .upload-file-info strong,
:root[data-theme] .modal .review-group-head strong,
:root[data-theme] .modal .review-group-head span {
  color: var(--ink);
}

:root[data-theme] .modal .review-group-head,
:root[data-theme] .modal .review-group.normal .review-group-head,
:root[data-theme] .modal .inspection-checklist-head {
  color: var(--ink);
  background: color-mix(in srgb, var(--green) 8%, var(--panel));
  border-color: var(--line);
}

:root[data-theme] .modal .review-group.abnormal {
  border-color: color-mix(in srgb, var(--red) 42%, var(--line));
}

:root[data-theme] .modal .review-group.abnormal .review-group-head {
  color: var(--red);
  background: color-mix(in srgb, var(--red) 11%, var(--panel));
}

:root[data-theme] .modal .review-group .data-table-wrap,
:root[data-theme] .modal .review-group .data-table,
:root[data-theme] .modal .order-evidence-section .upload-list {
  color: var(--ink);
  background: var(--panel);
  border-color: var(--line);
}

:root[data-theme] .modal .upload-item,
:root[data-theme] .modal .upload-item.complete,
:root[data-theme] .modal .attachment-row {
  color: var(--ink);
  background: var(--panel);
  border-color: var(--line);
}

:root[data-theme] .modal .upload-item.complete {
  background: color-mix(in srgb, var(--green) 7%, var(--panel));
  border-color: color-mix(in srgb, var(--green) 30%, var(--line));
}

:root[data-theme] .modal .upload-item.failed {
  color: var(--ink);
  background: color-mix(in srgb, var(--red) 9%, var(--panel));
  border-color: color-mix(in srgb, var(--red) 34%, var(--line));
}

:root[data-theme] .modal .upload-file-info small,
:root[data-theme] .modal .attachment-action {
  color: var(--muted);
}

:root[data-theme] .modal .attachment-action:hover {
  color: var(--ink);
  background: var(--hover);
  border-color: var(--line);
}

:root[data-theme] .modal .upload-zone,
:root[data-theme] .modal .evidence-paste-zone,
:root[data-theme] .modal .inspection-readiness {
  color: var(--muted);
  background: var(--panel-soft);
  border-color: var(--line-strong);
}

:root[data-theme] .modal .evidence-paste-zone > span strong {
  color: var(--ink);
}

:root[data-theme] .modal .inspection-checklist .check-row .inspection-measured,
:root[data-theme] .modal .inspection-result-cell {
  color: var(--ink);
  background: var(--bg);
  border-color: var(--line-strong);
}

:root[data-theme] .modal .audit-note,
:root[data-theme] .modal .empty-inline,
:root[data-theme] .modal .knowledge-solution {
  color: var(--muted);
  background: var(--panel-soft);
  border-color: var(--line);
}

:root[data-theme] .modal .audit-note.success-note {
  color: var(--green);
  background: color-mix(in srgb, var(--green) 9%, var(--panel));
  border-color: color-mix(in srgb, var(--green) 32%, var(--line));
}

:root[data-theme] .modal .audit-note.import-error {
  color: var(--red);
  background: color-mix(in srgb, var(--red) 9%, var(--panel));
  border-color: color-mix(in srgb, var(--red) 32%, var(--line));
}

:root[data-theme] .modal .warning-note {
  color: var(--yellow);
  background: var(--yellow-soft);
  border-color: color-mix(in srgb, var(--yellow) 30%, var(--line));
}

:root[data-theme] .modal .workflow-transition {
  color: var(--blue);
  background: var(--blue-soft);
  border: 1px solid color-mix(in srgb, var(--blue) 24%, transparent);
}

:root[data-theme] .modal .workflow-event-body p {
  color: var(--ink);
}

:root[data-theme] .modal .workflow-event:not(:last-child)::before {
  background: var(--line-strong);
}

/* Reference-grade operations shell: hierarchy, density and dashboard rhythm. */
:root[data-theme="dark"] {
  --bg: #060d18;
  --canvas: #080f1d;
  --panel: #111a2f;
  --panel-soft: #152139;
  --elevated: #182540;
  --sidebar: #071925;
  --sidebar-2: #0b2130;
  --ink: #eef4ff;
  --muted: #91a0bb;
  --text-subtle: #667693;
  --line: rgba(105, 151, 203, .13);
  --line-strong: rgba(117, 169, 226, .23);
  --hover: rgba(100, 130, 210, .09);
  --blue: #7f8cff;
  --green: #21c79a;
  --orange: #ffb020;
  --red: #ff6b82;
  --shadow: 0 16px 38px rgba(0, 5, 15, .28), 0 0 0 1px rgba(110, 158, 220, .025);
  --topbar-height: 78px;
}

:root[data-theme="light"] {
  --topbar-height: 78px;
}

:root[data-theme] .sidebar {
  width: var(--sidebar-width);
}

:root[data-theme="dark"] .sidebar {
  color: #d9e5f2;
  background: linear-gradient(180deg, #061925 0%, #071824 62%, #061520 100%);
  border-right-color: rgba(88, 175, 218, .22);
  box-shadow: 14px 0 42px rgba(0, 6, 18, .24);
}

:root[data-theme] .brand {
  min-height: 76px;
  padding: 0 16px 18px;
}

:root[data-theme] .brand-mark {
  width: 42px;
  height: 42px;
}

:root[data-theme] .brand-copy strong {
  font-size: 20px;
  font-weight: 720;
}

:root[data-theme] .brand-copy small {
  margin-top: 5px;
  font-size: 10px;
}

:root[data-theme] .nav-section-label {
  display: none;
}

:root[data-theme] .nav-list {
  gap: 6px;
  margin-top: 22px;
}

:root[data-theme] .nav-item {
  min-height: 44px;
  padding: 0 16px;
}

:root[data-theme] .nav-item span {
  font-size: 13px;
}

:root[data-theme="dark"] .nav-item {
  color: #9eb0c4;
}

:root[data-theme="dark"] .nav-item:hover {
  color: #f2f7ff;
  background: rgba(82, 132, 183, .1);
}

:root[data-theme="dark"] .nav-item.active {
  color: #9ba9ff;
  background: linear-gradient(90deg, rgba(96, 87, 214, .2), rgba(24, 69, 101, .16));
  box-shadow: inset 0 0 0 1px rgba(72, 180, 218, .22);
}

:root[data-theme="dark"] .nav-item.active::before {
  inset: 8px auto 8px 0;
  background: linear-gradient(180deg, #8b5cf6, #22d3ee);
  box-shadow: 0 0 14px rgba(34, 211, 238, .7);
}

:root[data-theme="dark"] .nav-item.active svg {
  color: #5ee7f5;
}

:root[data-theme] .page-shell {
  margin-left: var(--sidebar-width);
}

:root[data-theme] .topbar {
  height: var(--topbar-height);
  padding: 0 32px;
}

:root[data-theme="dark"] .topbar {
  background: rgba(7, 14, 28, .94);
  border-bottom-color: rgba(105, 151, 203, .2);
  box-shadow: 0 8px 30px rgba(0, 5, 16, .12);
}

:root[data-theme] .topbar h1 {
  font-size: 22px;
  font-weight: 720;
}

:root[data-theme] .topbar p {
  margin-top: 6px;
  font-size: 11px;
}

:root[data-theme] .global-search {
  width: min(430px, 31vw);
  height: 44px;
  padding: 0 14px;
}

:root[data-theme] .icon-btn {
  width: 44px;
  height: 44px;
}

:root[data-theme] .profile-btn {
  height: 48px;
  padding: 0 6px;
}

:root[data-theme] .profile-copy strong {
  font-size: 12px;
}

:root[data-theme] main {
  min-height: calc(100vh - var(--topbar-height));
  padding: 30px 32px 48px;
}

:root[data-theme="dark"] main {
  background-color: var(--bg);
  background-image: linear-gradient(rgba(82, 139, 184, .052) 1px, transparent 1px), linear-gradient(90deg, rgba(82, 139, 184, .052) 1px, transparent 1px);
  background-size: 48px 48px;
}

:root[data-theme] .section-heading {
  margin-bottom: 22px;
}

:root[data-theme] .section-heading h2 {
  font-size: 22px;
  font-weight: 720;
}

:root[data-theme] .section-heading p {
  margin-top: 7px;
  font-size: 11px;
}

:root[data-theme] .section-heading > .btn.primary {
  color: var(--ink);
  background: var(--panel);
  border-color: var(--line-strong);
  box-shadow: none;
}

:root[data-theme] .section-heading > .btn.primary:hover {
  color: var(--blue);
  background: var(--blue-soft);
  border-color: color-mix(in srgb, var(--blue) 42%, var(--line));
  filter: none;
}

:root[data-theme] .metric-grid {
  gap: 16px;
  margin-bottom: 22px;
}

:root[data-theme] .metric-card {
  min-height: 148px;
  padding: 22px;
  border-radius: 8px;
}

:root[data-theme="dark"] .metric-card {
  background: linear-gradient(145deg, #111b31 0%, #10182c 100%);
  border-color: rgba(93, 139, 198, .23);
  box-shadow: 0 14px 32px rgba(0, 5, 17, .2), inset 0 1px rgba(255, 255, 255, .018);
}

:root[data-theme] .metric-card::before {
  width: 4px;
}

:root[data-theme] .metric-card.green::before { background: var(--green); }
:root[data-theme] .metric-card.blue::before { background: var(--blue); }
:root[data-theme] .metric-card.orange::before { background: var(--orange); }
:root[data-theme] .metric-card.red::before { background: var(--red); }

:root[data-theme] .metric-top {
  font-size: 12px;
}

:root[data-theme] .metric-icon {
  width: 46px;
  height: 46px;
  border-radius: 8px;
}

:root[data-theme] .metric-icon svg {
  width: 21px;
  height: 21px;
}

:root[data-theme] .metric-value {
  margin-top: 12px;
}

:root[data-theme] .metric-value strong {
  font-size: 34px;
  font-weight: 760;
}

:root[data-theme] .metric-value span {
  font-size: 12px;
}

:root[data-theme] .metric-foot {
  max-width: none;
  min-height: 28px;
  align-items: flex-start;
  margin-top: 12px;
  padding-right: 112px;
  font-size: 10px;
  line-height: 1.45;
  white-space: nowrap;
}

.metric-sparkline {
  position: absolute;
  right: 16px;
  bottom: 17px;
  width: 104px;
  height: 38px;
  color: var(--green);
  opacity: .95;
  pointer-events: none;
}

.metric-sparkline.blue { color: var(--blue); }
.metric-sparkline.orange { color: var(--orange); }
.metric-sparkline.red { color: var(--red); }
.metric-sparkline svg { width: 100%; height: 100%; overflow: visible; }
.metric-sparkline polyline { fill: none; stroke: currentColor; stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }

:root[data-theme] .operational-strip {
  gap: 14px;
  margin-bottom: 22px;
}

:root[data-theme] .operational-strip > div {
  min-height: 52px;
  padding: 0 18px;
}

:root[data-theme="dark"] .operational-strip > div,
:root[data-theme="dark"] .toolbar,
:root[data-theme="dark"] .panel {
  background: #111a2f;
  border-color: rgba(93, 139, 198, .22);
  box-shadow: 0 10px 28px rgba(0, 5, 17, .16);
}

:root[data-theme] .dashboard-grid {
  gap: 18px;
}

:root[data-theme] .dashboard-progress-card .panel-body,
:root[data-theme] .dashboard-todo-card .panel-body {
  min-height: 280px;
}

:root[data-theme] .dashboard-risk-card .panel-body,
:root[data-theme] .dashboard-health-card .panel-body {
  min-height: 250px;
}

:root[data-theme] .dashboard-todo-card .empty-state,
:root[data-theme] .dashboard-risk-card .empty-state {
  min-height: 190px;
}

:root[data-theme] .panel-header {
  min-height: 62px;
  padding: 0 20px;
}

:root[data-theme] .panel-title h3 {
  font-size: 15px;
  font-weight: 720;
}

:root[data-theme] .panel-body {
  padding: 20px;
}

:root[data-theme] .toolbar {
  min-height: 66px;
  padding: 10px 13px;
}

:root[data-theme] .change-filter-toolbar {
  gap: 14px;
}

:root[data-theme] .change-filters {
  min-width: 0;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(230px, 1.45fr) repeat(4, minmax(118px, 1fr)) auto;
  gap: 10px;
}

:root[data-theme] .change-filters .search-field,
:root[data-theme] .change-filters .select {
  width: 100%;
  min-width: 0;
  height: 42px;
}

:root[data-theme] .change-filter-count {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 10px;
}

:root[data-theme] .data-table th {
  height: 50px;
  font-size: 11px;
}

:root[data-theme] .data-table td {
  height: 68px;
  font-size: 12px;
}

:root[data-theme] .cell-stack strong {
  font-size: 12px;
}

:root[data-theme] .cell-stack small {
  font-size: 10px;
}

:root[data-theme] .panel .data-table .empty-state {
  min-height: 180px;
}

:root[data-theme] .pagination {
  min-height: 58px;
  padding: 0 18px;
  font-size: 11px;
}

@media (min-width: 1600px) {
  :root[data-theme="dark"],
  :root[data-theme="light"] {
    --sidebar-width: 320px;
    --topbar-height: 104px;
  }

  :root[data-theme] .brand { min-height: 104px; padding: 0 28px 24px; }
  :root[data-theme] .brand-mark { width: 54px; height: 54px; }
  :root[data-theme] .brand-copy strong { font-size: 25px; }
  :root[data-theme] .brand-copy small { font-size: 12px; }
  :root[data-theme] .nav-list { gap: 8px; margin-top: 28px; }
  :root[data-theme] .nav-item { min-height: 58px; padding: 0 26px; }
  :root[data-theme] .nav-item span { font-size: 16px; }
  :root[data-theme] .nav-item svg { width: 21px; height: 21px; }
  :root[data-theme] .topbar { padding: 0 46px; }
  :root[data-theme] .topbar h1 { font-size: 29px; }
  :root[data-theme] .topbar p { font-size: 13px; }
  :root[data-theme] .global-search { width: 530px; height: 56px; }
  :root[data-theme] .icon-btn { width: 54px; height: 54px; }
  :root[data-theme] .profile-btn { height: 58px; }
  :root[data-theme] .profile-copy strong { font-size: 15px; }
  :root[data-theme] main { padding: 42px 46px 60px; }
  :root[data-theme] .section-heading { margin-bottom: 28px; }
  :root[data-theme] .section-heading h2 { font-size: 28px; }
  :root[data-theme] .section-heading p { font-size: 13px; }
  :root[data-theme] .metric-grid { gap: 22px; margin-bottom: 30px; }
  :root[data-theme] .metric-card { min-height: 190px; padding: 28px; }
  :root[data-theme] .metric-top { font-size: 15px; }
  :root[data-theme] .metric-icon { width: 56px; height: 56px; }
  :root[data-theme] .metric-value strong { font-size: 46px; }
  :root[data-theme] .metric-value span { font-size: 14px; }
  :root[data-theme] .metric-foot { padding-right: 154px; font-size: 12px; }
  .metric-sparkline { right: 22px; bottom: 23px; width: 144px; height: 46px; }
  :root[data-theme] .operational-strip > div { min-height: 62px; padding: 0 24px; }
  :root[data-theme] .operational-strip strong { font-size: 15px; }
  :root[data-theme] .operational-strip span { font-size: 13px; }
  :root[data-theme] .dashboard-progress-card .panel-body,
  :root[data-theme] .dashboard-todo-card .panel-body { min-height: 370px; }
  :root[data-theme] .dashboard-risk-card .panel-body,
  :root[data-theme] .dashboard-health-card .panel-body { min-height: 300px; }
  :root[data-theme] .panel-header { min-height: 72px; padding: 0 28px; }
  :root[data-theme] .panel-title h3 { font-size: 18px; }
  :root[data-theme] .toolbar { min-height: 82px; padding: 13px 17px; }
  :root[data-theme] .change-filters .search-field,
  :root[data-theme] .change-filters .select { height: 50px; font-size: 13px; }
  :root[data-theme] .data-table th { height: 62px; font-size: 13px; }
  :root[data-theme] .data-table td { height: 82px; font-size: 14px; }
  :root[data-theme] .cell-stack strong { font-size: 14px; }
  :root[data-theme] .cell-stack small { font-size: 11px; }
}

@media (max-width: 1400px) and (min-width: 841px) {
  :root[data-theme] .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  :root[data-theme] .change-filter-toolbar { align-items: stretch; flex-direction: column; }
  :root[data-theme] .change-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  :root[data-theme] .change-filters .search-field { grid-column: span 2; }
  :root[data-theme] .change-filter-count { align-self: flex-end; }
}

@media (max-width: 840px) {
  :root[data-theme="dark"],
  :root[data-theme="light"] { --topbar-height: 64px; }
  :root[data-theme] .topbar { height: var(--topbar-height); padding: 0 15px; }
  :root[data-theme] .sidebar { width: min(290px, 86vw); }
  :root[data-theme] .page-shell { margin-left: 0; }
  :root[data-theme] main { padding: 20px 15px 32px; }
  :root[data-theme] .metric-card { min-height: 132px; padding: 18px; }
  :root[data-theme] .metric-value strong { font-size: 30px; }
  :root[data-theme] .change-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  :root[data-theme] .change-filters .search-field { grid-column: 1 / -1; }
  :root[data-theme] .change-filters .btn { width: 100%; }
}

@media (max-width: 560px) {
  :root[data-theme] .topbar { min-width: 0; gap: 8px; }
  :root[data-theme] .topbar-left { min-width: 0; gap: 7px; }
  :root[data-theme] .topbar-left > div { min-width: 62px; }
  :root[data-theme] .topbar h1 { font-size: 16px; white-space: nowrap; }
  :root[data-theme] .topbar-actions { min-width: 0; gap: 2px; }
  :root[data-theme] .topbar .icon-btn { width: 36px; height: 36px; }
  :root[data-theme] .topbar .profile-btn { width: 36px; height: 36px; padding: 0; }
  :root[data-theme] .topbar .avatar { width: 32px; height: 32px; margin: 0; }
  :root[data-theme] .metric-sparkline { width: 82px; opacity: .72; }
  :root[data-theme] .metric-foot { padding-right: 78px; white-space: normal; }
  :root[data-theme] .change-filters { grid-template-columns: 1fr; }
  :root[data-theme] .change-filters .search-field { grid-column: auto; }
}

@media (max-width: 360px) {
  :root[data-theme] .topbar #appThemeToggle { display: none; }
}
