:root {
  --ink: #3d4653;
  --ink-strong: #2f3742;
  --muted: #7f8997;
  --muted-light: #a7afb9;
  --line: #e7e9ed;
  --line-soft: #f0f1f3;
  --paper: #ffffff;
  --canvas: #f5f6f8;
  --brand: #1684bd;
  --brand-dark: #0f73aa;
  --brand-soft: #edf7fc;
  --green: #36aa78;
  --green-soft: #edf8f2;
  --amber: #e6a23c;
  --amber-soft: #fff7e8;
  --red: #e45a56;
  --red-soft: #fff1f0;
  --cyan: #41a8b8;
  --purple: #8a78bd;
  --sidebar-width: 220px;
  --shadow-xs: 0 1px 2px rgba(40, 55, 72, .03);
  --shadow-md: 0 16px 44px rgba(37, 49, 65, .14);
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body { min-width: 1000px; min-height: 100vh; margin: 0; color: var(--ink); background: var(--canvas); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: var(--brand); }
.hidden { display: none !important; }
.muted { color: var(--muted); }

/* Login */
.login-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(560px, 1.15fr) minmax(430px, .85fr); background: #fff; }
.login-visual { position: relative; isolation: isolate; overflow: hidden; min-height: 680px; display: flex; flex-direction: column; padding: 36px clamp(48px, 6vw, 96px) 30px; color: var(--ink-strong); border-right: 1px solid var(--line); background: #f2f7fa; }
.login-visual::before { content: ""; position: absolute; z-index: -2; inset: 0; background: radial-gradient(circle at 18% 16%, rgba(48,153,203,.13), transparent 26%), radial-gradient(circle at 76% 76%, rgba(74,176,154,.1), transparent 30%), linear-gradient(145deg,#f8fbfc,#eef5f8); }
.login-visual::after { content: ""; position: absolute; z-index: -1; inset: 0; opacity: .32; background-image: linear-gradient(rgba(83,117,138,.08) 1px,transparent 1px),linear-gradient(90deg,rgba(83,117,138,.08) 1px,transparent 1px); background-size: 42px 42px; mask-image: linear-gradient(135deg,#000,transparent 76%); }
.login-brand, .login-mobile-brand, .brand { display: flex; align-items: center; gap: 10px; }
.login-brand b, .login-brand small, .brand b, .brand small { display: block; }
.login-brand b { color: #146c9d; font-size: 18px; letter-spacing: .02em; }
.login-brand small { margin-top: 2px; color: #8ca0ad; font-size: 9px; font-weight: 700; letter-spacing: .13em; }
.brand-symbol { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; color: #fff; font-size: 16px; font-weight: 800; border-radius: 50%; background: var(--brand); box-shadow: none; }
.brand-symbol.small { width: 32px; height: 32px; font-size: 13px; }
.login-visual-copy { width: min(660px,100%); margin: auto 0; padding: 48px 0 30px; }
.product-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; color: #4c7d99; font-size: 12px; border: 1px solid #d9e9f1; border-radius: 3px; background: rgba(255,255,255,.7); }
.product-pill i, .login-secure i, .server-chip i { width: 6px; height: 6px; border-radius: 50%; background: #3aae7d; }
.login-visual-copy h1 { max-width: 600px; margin: 22px 0 14px; color: #2f4352; font-size: clamp(34px,3.6vw,50px); font-weight: 650; line-height: 1.22; letter-spacing: -.035em; }
.login-visual-copy > p { max-width: 560px; margin: 0; color: #728592; font-size: 15px; line-height: 1.75; }
.login-product-preview { width: min(610px,100%); margin-top: 36px; overflow: hidden; color: var(--ink); border: 1px solid #dce5ea; border-radius: 5px; background: #fff; box-shadow: 0 20px 55px rgba(52,79,96,.12); }
.preview-head { height: 44px; display: flex; align-items: center; gap: 11px; padding: 0 14px; border-bottom: 1px solid var(--line); background: #fafbfc; }
.preview-head > span { display: flex; gap: 5px; }
.preview-head > span i { width: 6px; height: 6px; border-radius: 50%; background: #cbd2d8; }
.preview-head > span i:first-child { background: #ef817c; }
.preview-head > span i:nth-child(2) { background: #e8b766; }
.preview-head > span i:last-child { background: #67bc92; }
.preview-head b { font-size: 12px; font-weight: 600; }
.preview-head em { margin-left: auto; color: var(--green); font-size: 10px; font-style: normal; }
.preview-content { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px; background: #f7f8fa; }
.preview-stat { min-height: 84px; padding: 13px; border: 1px solid var(--line); border-radius: 3px; background: #fff; }
.preview-stat span { color: var(--muted); font-size: 10px; }
.preview-stat b { display: block; margin: 9px 0 4px; color: #44515d; font-size: 14px; }
.preview-stat small { color: #a2aab3; font-size: 10px; }
.preview-flow { grid-column: 1/-1; display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 3px; background: #fff; }
.preview-avatar { width: 32px; height: 32px; display: grid; place-items: center; color: #fff; font-size: 11px; border-radius: 50%; background: #76aeca; }
.preview-flow b, .preview-flow small { display: block; }
.preview-flow b { color: #46535f; font-size: 11px; }
.preview-flow small { margin-top: 3px; color: #9aa3ad; font-size: 9px; }
.preview-flow em { color: var(--green); font-size: 10px; font-style: normal; }
.login-visual-foot { display: flex; gap: 26px; color: #80919c; font-size: 10px; }
.login-visual-foot span::before { content: "✓"; margin-right: 6px; color: var(--green); }
.login-panel { position: relative; min-height: 680px; display: grid; place-items: center; padding: 48px; background: #fff; }
.login-card { width: min(390px,100%); padding: 30px 32px; border: 1px solid var(--line); border-radius: 5px; background: #fff; box-shadow: 0 12px 40px rgba(44,60,75,.08); }
.login-mobile-brand { display: none; margin-bottom: 30px; color: #176f9e; }
.login-kicker, .modal-kicker { margin: 0 0 7px; color: var(--brand); font-size: 9px; font-weight: 700; letter-spacing: .14em; }
.login-card h2 { margin: 0; color: #303a45; font-size: 22px; font-weight: 600; }
.login-subtitle { margin: 9px 0 24px; color: var(--muted); font-size: 12px; }
.login-card > label { display: grid; gap: 7px; margin-top: 16px; color: #596471; font-size: 12px; }
.field-control { position: relative; }
.field-control svg { position: absolute; z-index: 1; left: 11px; top: 50%; width: 16px; height: 16px; color: #a2aab4; fill: none; stroke: currentColor; stroke-width: 1.6; transform: translateY(-50%); }
.field-control input { padding-left: 36px; }
.login-submit { display: flex; align-items: center; justify-content: center; gap: 9px; margin-top: 24px; }
.login-submit b { font-size: 16px; font-weight: 400; }
.form-error { min-height: 17px; margin: 9px 0 0; color: var(--red); font-size: 11px; }
.login-secure { display: flex; align-items: center; justify-content: space-between; margin-top: 17px; padding-top: 14px; color: #77838e; font-size: 9px; border-top: 1px solid var(--line-soft); }
.login-secure span { display: inline-flex; align-items: center; gap: 6px; }
.login-secure small { color: #a5adb6; font-size: 9px; }
.login-copyright { position: absolute; bottom: 24px; margin: 0; color: #acb2ba; font-size: 9px; }

/* Shared controls */
label { color: #5c6672; font-size: 12px; font-weight: 500; }
input, select, textarea { width: 100%; min-height: 36px; padding: 7px 10px; color: var(--ink); border: 1px solid #dfe2e7; border-radius: 3px; outline: none; background: #fff; box-shadow: none; transition: border-color .15s, box-shadow .15s; }
input::placeholder, textarea::placeholder { color: #b0b6be; }
input:focus, select:focus, textarea:focus { border-color: #78b5d4; box-shadow: 0 0 0 2px rgba(22,132,189,.08); }
textarea { min-height: 94px; resize: vertical; line-height: 1.55; }
.primary, .secondary, .danger { min-height: 36px; padding: 7px 14px; border: 1px solid transparent; border-radius: 3px; font-size: 12px; font-weight: 500; transition: background .15s,border-color .15s,color .15s; }
.primary { color: #fff; border-color: var(--brand); background: var(--brand); box-shadow: none; }
.primary:hover { border-color: var(--brand-dark); background: var(--brand-dark); }
.primary:disabled { opacity: .6; cursor: wait; }
.secondary { color: #66717d; border-color: #dfe2e7; background: #fff; }
.secondary:hover { color: var(--brand); border-color: #a9cedf; background: #f8fcfe; }
.danger { color: #c94e49; border-color: #f0c8c6; background: #fff; }
.danger:hover { background: var(--red-soft); }
.wide { width: 100%; }

/* Application shell */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-width) minmax(0,1fr); }
.sidebar { position: fixed; z-index: 20; inset: 0 auto 0 0; width: var(--sidebar-width); display: flex; flex-direction: column; overflow-y: auto; padding: 72px 10px 14px; color: #5c6672; background: #fff; border-right: 1px solid #e1e4e8; }
.brand { position: absolute; top: 0; left: 0; right: 0; height: 60px; padding: 0 20px; color: #2f3b46; text-decoration: none; border-bottom: 1px solid var(--line); background: #fff; }
.brand b { color: #176f9f; font-size: 16px; font-weight: 650; letter-spacing: .02em; }
.brand small { margin-top: 2px; color: #9aa4ad; font-size: 8px; font-weight: 600; letter-spacing: .11em; }
#mainNav { display: grid; gap: 2px; }
#mainNav button { position: relative; width: 100%; height: 40px; display: flex; align-items: center; gap: 11px; padding: 0 12px; color: #596572; text-align: left; border: 0; border-radius: 2px; background: transparent; transition: color .15s,background .15s; }
#mainNav button svg { width: 17px; height: 17px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; opacity: .82; }
#mainNav button:first-child svg { fill: currentColor; stroke: none; }
#mainNav button span { font-size: 13px; font-weight: 450; }
#mainNav button:hover { color: #177dac; background: #f7f9fa; }
#mainNav button.active { color: #147eaf; background: #f1f3f5; box-shadow: inset 2px 0 0 #2e97c7; }
#mainNav button.active svg { opacity: 1; }
.nav-label { margin: 15px 12px 5px; color: #a4abb3; font-size: 9px; font-weight: 650; letter-spacing: .08em; }
.sidebar-foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid var(--line-soft); }
.service-state { display: flex; align-items: flex-start; gap: 8px; }
.service-state b, .service-state small { display: block; }
.service-state b { color: #68727d; font-size: 10px; font-weight: 550; }
.service-state small { margin-top: 3px; color: #a2a9b1; font-size: 8px; }
.status-dot { width: 6px; height: 6px; flex: 0 0 auto; margin-top: 3px; border-radius: 50%; background: #3aae7d; box-shadow: 0 0 0 3px rgba(58,174,125,.1); }
.sidebar-foot > p { margin: 12px 0 0 14px; color: #b0b6bd; font-size: 8px; }
.workspace { grid-column: 2; min-width: 0; }
.topbar { position: sticky; z-index: 15; top: 0; height: 60px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.98); }
.topbar-heading { min-width: 0; display: flex; align-items: baseline; gap: 8px; }
.topbar-heading::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 76px; height: 1px; background: var(--brand); opacity: .35; }
.topbar h1 { margin: 0; color: #4a5561; font-size: 14px; font-weight: 550; }
.breadcrumb { margin: 0; color: #a1a8b0; font-size: 10px; }
.breadcrumb::after { content: "/"; margin-left: 8px; color: #d0d4d8; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.server-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; color: #7b858e; font-size: 10px; border: 1px solid var(--line); border-radius: 3px; background: #fafbfc; }
.mobile-link { height: 32px; display: inline-flex; align-items: center; gap: 6px; padding: 0 9px; color: #66717c; font-size: 10px; text-decoration: none; border: 1px solid var(--line); border-radius: 50%; background: #fff; }
.mobile-link:hover { color: var(--brand); border-color: #b8d6e4; background: var(--brand-soft); }
.mobile-link svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.clock { min-width: 104px; color: #929ba4; font-size: 9px; text-align: center; }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 3px 9px 3px 4px; border-left: 1px solid var(--line); }
.user-chip > span:first-child { width: 32px; height: 32px; display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 650; border-radius: 50%; background: var(--brand); }
.user-chip b, .user-chip small { display: block; }
.user-chip b { color: #58636e; font-size: 10px; font-weight: 550; }
.user-chip small { margin-top: 2px; color: #a4abb3; font-size: 8px; }
.icon-button { width: 32px; height: 32px; display: inline-grid; place-items: center; padding: 0; color: #7b858f; border: 1px solid var(--line); border-radius: 50%; background: #fff; box-shadow: none; }
.icon-button:hover { color: var(--brand); border-color: #b8d6e4; background: var(--brand-soft); }
.icon-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.view { min-height: calc(100vh - 60px); padding: 18px 20px 40px; }

/* Page framing */
.page-head { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 13px; }
.page-head h2 { margin: 0 0 4px; color: #3d4651; font-size: 20px; font-weight: 600; letter-spacing: -.015em; }
.page-head p { margin: 0; color: #929aa4; font-size: 11px; line-height: 1.5; }
.page-head.dashboard-head { min-height: 84px; align-items: center; padding: 14px 17px; border: 1px solid var(--line); border-radius: 3px; background: #fff; box-shadow: none; }
.dashboard-head h2 { color: #3b4650; font-size: 18px; font-weight: 550; }
.dashboard-head p { color: #929ba4; }
.dashboard-head .head-status { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 5px; color: #3685aa; font-size: 9px; }
.dashboard-head .head-status i { width: 6px; height: 6px; border-radius: 50%; background: #4ba7ce; }
.actions { display: flex; align-items: center; gap: 7px; }
.toolbar { min-height: 50px; display: flex; align-items: center; gap: 8px; margin-bottom: 12px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 3px; background: #fff; box-shadow: none; }
.toolbar input { width: 270px; }
.toolbar select { width: 150px; }
.toolbar .spacer { flex: 1; }

/* Dashboard */
.metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 11px; margin: 11px 0; }
.metric { position: relative; overflow: hidden; min-height: 106px; padding: 14px 15px; border: 1px solid transparent; border-radius: 3px; background: var(--metric-card,#eef7fc); box-shadow: none; }
.metric::after { content: ""; position: absolute; right: -24px; top: -34px; width: 90px; height: 90px; border: 18px solid rgba(255,255,255,.32); border-radius: 50%; }
.metric-top { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; }
.metric-icon { width: 31px; height: 31px; display: grid; place-items: center; color: var(--metric-ink,#267fa8); border-radius: 50%; background: rgba(255,255,255,.65); }
.metric-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.metric .kicker { color: var(--metric-ink,#267fa8); font-size: 10px; font-weight: 500; }
.metric strong { position: relative; z-index: 1; display: block; margin: 9px 0 4px; color: #3f4a55; font-size: 25px; font-weight: 600; line-height: 1; letter-spacing: -.02em; }
.metric small { position: relative; z-index: 1; color: #85929d; font-size: 9px; }
.metric small b { color: var(--metric-ink,#267fa8); }
.metric.blue { --metric-card:#edf7fd; --metric-ink:#287fa9; }
.metric.green { --metric-card:#edf8f2; --metric-ink:#3c9670; }
.metric.cyan { --metric-card:#eef8f8; --metric-ink:#438f9a; }
.metric.red { --metric-card:#f8f1f1; --metric-ink:#b76865; }
.grid-2 { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(320px,.75fr); gap: 11px; }
.panel { overflow: hidden; border: 1px solid var(--line); border-radius: 3px; background: #fff; box-shadow: none; }
.panel-head { min-height: 50px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 14px; border-bottom: 1px solid var(--line-soft); }
.panel-head h3 { margin: 0; color: #515c67; font-size: 12px; font-weight: 550; }
.panel-head small { color: #a0a7af; font-size: 9px; }
.panel-head a { font-size: 10px; text-decoration: none; }
.panel-body { padding: 14px; }
.funnel { display: grid; gap: 12px; }
.funnel-row { display: grid; grid-template-columns: 68px 1fr 30px; align-items: center; gap: 10px; color: #69737e; font-size: 10px; }
.funnel-row b { color: #58636e; text-align: right; }
.bar { height: 6px; overflow: hidden; border-radius: 99px; background: #f0f2f4; }
.bar i { display: block; height: 100%; min-width: 2px; border-radius: inherit; background: #78b6d3; }
.activity-list { display: grid; }
.activity { position: relative; display: grid; grid-template-columns: 8px 1fr auto; gap: 9px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.activity:last-child { border-bottom: 0; }
.activity > i { width: 6px; height: 6px; margin-top: 4px; border-radius: 50%; background: #e27b76; box-shadow: 0 0 0 3px #fff1f0; }
.activity b { display: block; color: #56616c; font-size: 10px; font-weight: 550; }
.activity p { margin: 4px 0 0; color: #8c959e; font-size: 9px; line-height: 1.5; }
.activity time { color: #a7adb4; font-size: 8px; }

/* Tables */
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 3px; background: #fff; box-shadow: none; }
table { width: 100%; border-collapse: collapse; color: #5b6670; font-size: 10px; white-space: nowrap; }
thead { background: #fafbfc; }
th { height: 39px; padding: 9px 12px; color: #89929c; text-align: left; font-size: 9px; font-weight: 550; letter-spacing: .01em; border-bottom: 1px solid var(--line); }
td { height: 46px; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: #fbfdfe; }
td b { color: #4b5661; font-weight: 550; }
td small { font-size: 8px; }
.table-button { padding: 4px 7px; color: #2984ad; font-size: 9px; border: 1px solid #d7eaf2; border-radius: 2px; background: #f5fbfd; }
.table-button:hover { border-color: #abd2e2; background: #edf8fc; }
.table-button + .table-button { margin-left: 4px; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 7px; color: #77818b; font-size: 8px; font-weight: 550; border-radius: 99px; background: #f2f3f5; }
.badge::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.badge.green { color: #358c68; background: var(--green-soft); }
.badge.red { color: #bd5652; background: var(--red-soft); }
.badge.blue { color: #2c82aa; background: var(--brand-soft); }
.badge.amber { color: #b07831; background: var(--amber-soft); }
.badge.gray { color: #7f8891; background: #f2f3f5; }
.tag { display: inline-block; margin: 1px 3px 1px 0; padding: 2px 6px; color: #69737d; font-size: 8px; border: 1px solid #e4e7ea; border-radius: 2px; background: #fafbfc; }
.empty { min-height: 136px; display: grid; place-content: center; padding: 28px 18px; color: #a7aeb6; text-align: center; font-size: 10px; }
.empty::before { content: ""; width: 34px; height: 34px; margin: 0 auto 9px; border: 1px dashed #d5d9de; border-radius: 50%; background: radial-gradient(circle,#cfd4da 1.5px,transparent 2px); }
.empty b { display: block; margin-bottom: 4px; color: #818b95; font-size: 11px; font-weight: 500; }
td .empty { min-height: 210px; }

/* Conversations and devices */
.conversation-layout { min-height: 620px; display: grid; grid-template-columns: 310px minmax(0,1fr); overflow: hidden; border: 1px solid var(--line); border-radius: 3px; background: #fff; box-shadow: none; }
.conversation-list { border-right: 1px solid var(--line); background: #fff; }
.conversation-list header { padding: 11px; border-bottom: 1px solid var(--line); background: #fafbfc; }
.conversation-list article { padding: 11px 13px; border-bottom: 1px solid var(--line-soft); cursor: pointer; transition: background .12s; }
.conversation-list article:hover, .conversation-list article.active { background: #f2f7fa; }
.conversation-list article.active { box-shadow: inset 2px 0 0 var(--brand); }
.conversation-list article b { display: flex; justify-content: space-between; color: #55616b; font-size: 10px; }
.conversation-list article p { margin: 5px 0 0; color: #8f98a1; font-size: 9px; }
.chat-pane { display: flex; flex-direction: column; min-width: 0; }
.chat-head { min-height: 54px; padding: 11px 15px; border-bottom: 1px solid var(--line); }
.chat-head b { font-size: 12px; font-weight: 550; }
.chat-messages { flex: 1; display: flex; flex-direction: column; gap: 9px; padding: 17px; overflow: auto; background: #f6f7f9; }
.message { max-width: 68%; padding: 9px 11px; border: 1px solid #e6e8eb; border-radius: 3px 10px 10px 10px; background: #fff; box-shadow: none; }
.message.sent { align-self: flex-end; color: #fff; border-color: var(--brand); border-radius: 10px 3px 10px 10px; background: #5aa5c7; }
.message.risk { border-color: #e9a7a3; box-shadow: 0 0 0 2px rgba(228,90,86,.06); }
.message p { margin: 0; font-size: 10px; line-height: 1.6; white-space: pre-wrap; }
.message time { display: block; margin-top: 4px; color: inherit; opacity: .65; font-size: 8px; }
.device-grid { display: grid; grid-template-columns: repeat(3,minmax(250px,1fr)); gap: 11px; }
.device-card { padding: 14px; border: 1px solid var(--line); border-top: 3px solid #cfd5db; border-radius: 3px; background: #fff; box-shadow: none; transition: border-color .15s; }
.device-card:has(.badge.green) { border-top-color: #61b58e; }
.device-card:hover { border-color: #cddfe7; }
.device-card header { display: flex; justify-content: space-between; align-items: flex-start; }
.device-card h3 { margin: 0; color: #4a5560; font-size: 12px; font-weight: 550; }
.device-card dl { display: grid; grid-template-columns: 72px 1fr; gap: 8px; margin: 14px 0; font-size: 9px; }
.device-card dt { color: #a0a7af; }
.device-card dd { margin: 0; color: #69737d; }
.device-card footer { display: flex; flex-wrap: wrap; gap: 5px; padding-top: 11px; border-top: 1px solid var(--line-soft); }

/* Modal and misc */
.modal-backdrop { position: fixed; z-index: 50; inset: 0; display: grid; place-items: center; padding: 24px; background: rgba(36,44,53,.48); backdrop-filter: blur(2px); }
.modal-card { width: min(680px,calc(100vw - 48px)); max-height: calc(100vh - 48px); overflow: auto; border: 1px solid #dfe2e6; border-radius: 5px; background: #fff; box-shadow: var(--shadow-md); }
.modal-card header, .modal-card footer { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; }
.modal-card header { position: sticky; z-index: 2; top: 0; border-bottom: 1px solid var(--line); background: #fff; }
.modal-card header h2 { margin: 0; color: #46515c; font-size: 16px; font-weight: 550; }
.modal-card header .modal-kicker { margin-bottom: 4px; }
.modal-card footer { position: sticky; z-index: 2; bottom: 0; justify-content: flex-end; gap: 7px; border-top: 1px solid var(--line); background: #fff; }
.modal-body { padding: 16px 18px; }
.modal-body label { display: grid; gap: 6px; margin: 0 0 13px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.form-grid .full { grid-column: 1/-1; }
.json-preview { max-height: 240px; overflow: auto; margin: 6px 0 0; padding: 10px; color: #56616b; font: 9px/1.6 ui-monospace,SFMono-Regular,Consolas,monospace; white-space: pre-wrap; word-break: break-all; border: 1px solid var(--line); border-radius: 3px; background: #fafbfc; }
.toast { position: fixed; z-index: 80; right: 20px; bottom: 20px; min-width: 260px; padding: 11px 14px; color: #fff; font-size: 10px; border-radius: 3px; background: #424c56; box-shadow: 0 12px 34px rgba(33,44,55,.2); }
.toast.error { background: #ba514d; }
.risk-rule { display: flex; align-items: center; justify-content: space-between; gap: 13px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.risk-rule:last-child { border: 0; }
.risk-rule b { display: block; color: #56616b; font-size: 10px; font-weight: 550; }
.risk-rule p { margin: 4px 0 0; color: #929ba4; font-size: 8px; }

.module-tabs { min-height: 44px; display: flex; align-items: stretch; gap: 0; margin: 11px 0; padding: 0 10px; overflow-x: auto; border: 1px solid var(--line); border-radius: 3px; background: #fff; }
.module-tabs button { position: relative; min-width: 105px; padding: 0 15px; color: #77818b; font-size: 10px; white-space: nowrap; border: 0; background: transparent; }
.module-tabs button::after { content: ""; position: absolute; right: 13px; bottom: -1px; left: 13px; height: 2px; background: transparent; }
.module-tabs button:hover { color: var(--brand); background: #fbfdfe; }
.module-tabs button.active { color: var(--brand); font-weight: 550; }
.module-tabs button.active::after { background: var(--brand); }
.module-tabs small { display: inline-grid; min-width: 16px; height: 16px; place-items: center; margin-left: 4px; padding: 0 4px; color: #929ba4; font-size: 8px; border-radius: 99px; background: #f1f3f5; }
.module-tabs button.active small { color: var(--brand); background: var(--brand-soft); }
.wechat-panel > .panel { margin-top: 0 !important; }

@media (max-width: 1240px) {
  :root { --sidebar-width: 208px; }
  .clock { display: none; }
  .view { padding-inline: 16px; }
  .device-grid { grid-template-columns: repeat(2,minmax(250px,1fr)); }
}

@media (max-width: 1080px) {
  body { min-width: 940px; }
  :root { --sidebar-width: 194px; }
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .login-screen { grid-template-columns: 1fr 430px; }
  .login-visual { padding-inline: 46px; }
  .server-chip { display: none; }
}

@media (max-width: 760px) {
  body { min-width: 320px; }
  .login-screen { display: block; background: #f4f6f8; }
  .login-visual { display: none; }
  .login-panel { min-height: 100vh; padding: 32px 22px 60px; background: #f4f6f8; }
  .login-mobile-brand { display: flex; }
  .login-copyright { bottom: 16px; }
}
