/* ============================================================
   智枢 · 数字员工智能体调度系统
   Design language: Control Deck / Paper + Ink + Aurora
   ============================================================ */
:root {
  --ink: #0a0f1e;
  --ink-2: #0f1730;
  --ink-3: #18213c;
  --paper: #f2f0ea;
  --paper-2: #faf9f6;
  --card: #ffffff;
  --line: #e6e2d8;
  --line-soft: #efecE5;
  --text: #171b2b;
  --muted: #737b8f;
  --muted-2: #9aa0b0;
  --violet: #6c5ce7;
  --violet-2: #8b7bff;
  --indigo: #4a3fd4;
  --cyan: #16c7d9;
  --mint: #2fbf8f;
  --amber: #e2a63b;
  --rose: #ec5c8d;
  --danger: #e0485c;
  --radius: 18px;
  --radius-lg: 24px;
  --shadow-sm: 0 2px 8px rgba(22, 26, 45, .05);
  --shadow: 0 14px 38px rgba(22, 26, 45, .09);
  --shadow-lg: 0 30px 80px rgba(8, 12, 26, .28);
  --font-sans: "HarmonyOS Sans SC", "MiSans", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", "Cascadia Code", Consolas, "Liberation Mono", monospace;
  --sidebar-w: 264px;
}
* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background-color: var(--paper);
  background-image:
    radial-gradient(1100px 500px at 88% -10%, rgba(108, 92, 231, .10), transparent 60%),
    radial-gradient(800px 420px at -5% 10%, rgba(22, 199, 217, .07), transparent 60%),
    linear-gradient(rgba(23, 27, 43, .026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 27, 43, .026) 1px, transparent 1px);
  background-size: auto, auto, 44px 44px, 44px 44px;
  font-size: 14px;
  line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
::selection { background: rgba(108, 92, 231, .22); }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #c9c6be; border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #aaa79f; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

.ic { width: 18px; height: 18px; flex: 0 0 auto; }
.ic-sm { width: 15px; height: 15px; }
.ic-lg { width: 26px; height: 26px; }
.ic-xl { width: 40px; height: 40px; }
.ic-2xl { width: 64px; height: 64px; }

/* ---------- Shell ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 60;
  width: var(--sidebar-w);
  background:
    radial-gradient(500px 260px at 20% 0%, rgba(108, 92, 231, .30), transparent 65%),
    radial-gradient(420px 320px at 100% 70%, rgba(22, 199, 217, .12), transparent 60%),
    linear-gradient(180deg, #0b1022 0%, #080d1b 100%);
  color: #dfe3f2;
  display: flex; flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, .06);
  transition: width .25s ease, transform .25s ease;
}
.sidebar::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.024) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.024) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, #000, transparent 70%);
}
.brand {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 12px;
  padding: 24px 22px 20px;
}
.brand-mark {
  width: 40px; height: 40px; border-radius: 13px; flex: 0 0 auto;
  background: conic-gradient(from 210deg, #6c5ce7, #16c7d9, #6c5ce7);
  display: grid; place-items: center;
  box-shadow: 0 8px 24px rgba(108, 92, 231, .45), inset 0 0 0 1px rgba(255,255,255,.18);
}
.brand-mark svg { width: 24px; height: 24px; }
.brand-text strong { display: block; font-size: 17px; letter-spacing: .16em; color: #fff; font-weight: 700; }
.brand-text span { display: block; font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .14em; color: rgba(223, 227, 242, .46); margin-top: 4px; }
.nav-scroll { position: relative; z-index: 1; flex: 1; overflow-y: auto; padding: 4px 12px 18px; }
.nav-scroll::-webkit-scrollbar { width: 4px; }
.nav-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border: 0; }
.nav-group { margin-top: 18px; }
.nav-label {
  display: flex; align-items: center; gap: 8px;
  padding: 0 10px 8px; font-size: 10.5px; letter-spacing: .12em; color: rgba(223,227,242,.36);
}
.nav-label::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(255,255,255,.08), transparent); }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 11px;
  height: 41px; padding: 0 12px; margin: 2px 0; border-radius: 11px;
  color: rgba(223, 227, 242, .64); font-size: 13px; transition: .18s ease;
}
.nav-item .ic { opacity: .8; width: 17px; height: 17px; }
.nav-item:hover { color: #fff; background: rgba(255, 255, 255, .055); }
.nav-item.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(108, 92, 231, .32), rgba(108, 92, 231, .05));
  box-shadow: inset 0 0 0 1px rgba(139, 123, 255, .18);
}
.nav-item.active::before {
  content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0;
  background: linear-gradient(#8b7bff, #16c7d9); box-shadow: 0 0 14px rgba(139, 123, 255, .9);
}
.nav-item.active .ic { color: #b7aaff; opacity: 1; }
.nav-item .nav-badge { margin-left: auto; font-family: var(--font-mono); font-size: 10px; background: rgba(236, 92, 141, .18); color: #ff9dbc; padding: 1px 7px; border-radius: 20px; }
.sidebar-foot { position: relative; z-index: 1; padding: 14px 16px 18px; border-top: 1px solid rgba(255,255,255,.07); }
.env-chip { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 10px; color: rgba(223,227,242,.46); letter-spacing: .06em; }
.env-chip .dot { width: 6px; height: 6px; border-radius: 50%; background: #2fbf8f; box-shadow: 0 0 10px #2fbf8f; }
.sidebar-toggle { position: absolute; right: 14px; top: 30px; z-index: 2; width: 26px; height: 26px; border-radius: 8px; border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.04); color: rgba(223,227,242,.7); display: grid; place-items: center; }
.sidebar-toggle:hover { background: rgba(255,255,255,.1); }
body.sidebar-collapsed .sidebar { width: 78px; }
body.sidebar-collapsed .brand-text, body.sidebar-collapsed .nav-label, body.sidebar-collapsed .nav-item span, body.sidebar-collapsed .nav-badge, body.sidebar-collapsed .env-chip span { display: none; }
body.sidebar-collapsed .brand { padding: 24px 0 20px; justify-content: center; }
body.sidebar-collapsed .nav-item { justify-content: center; padding: 0; }
body.sidebar-collapsed .nav-group { margin-top: 10px; }
body.sidebar-collapsed .nav-label { display: block; height: 1px; padding: 0; margin: 10px 12px; background: rgba(255,255,255,.08); }
body.sidebar-collapsed .nav-label::after { display: none; }
body.sidebar-collapsed .sidebar-foot { display: none; }
body.sidebar-collapsed .main { margin-left: 78px; }

.main { margin-left: var(--sidebar-w); min-width: 0; flex: 1; transition: margin-left .25s ease; }
.topbar {
  position: sticky; top: 0; z-index: 40;
  height: 68px; display: flex; align-items: center; gap: 18px;
  padding: 0 30px;
  background: rgba(250, 249, 246, .82);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(23, 27, 43, .07);
}
.crumb { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); min-width: 0; }
.crumb .sep { opacity: .4; }
.crumb strong { color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-search {
  margin-left: auto; display: flex; align-items: center; gap: 8px;
  height: 38px; width: 250px; padding: 0 12px; border: 1px solid var(--line); border-radius: 11px;
  background: rgba(255,255,255,.7); color: var(--muted);
}
.top-search input { border: 0; background: transparent; outline: 0; width: 100%; font-size: 12.5px; }
.top-search kbd { font-family: var(--font-mono); font-size: 9px; padding: 2px 5px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted-2); background: #fff; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.live-pill { display: flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: 10px; color: #207a5e; background: rgba(47,191,143,.10); border: 1px solid rgba(47,191,143,.22); padding: 6px 10px; border-radius: 20px; letter-spacing: .06em; }
.live-pill i { width: 6px; height: 6px; border-radius: 50%; background: #2fbf8f; box-shadow: 0 0 0 0 rgba(47,191,143,.5); animation: pulse 1.8s infinite; }
.icon-btn {
  position: relative; width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--line);
  background: rgba(255,255,255,.72); display: grid; place-items: center; color: #4d5468; transition: .18s;
}
.icon-btn:hover { background: #fff; border-color: #d6d1c4; color: var(--violet); }
.mobile-menu { display: none; }
.icon-btn .ind { position: absolute; top: 7px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--rose); border: 1.5px solid #fff; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 4px 10px 4px 4px; border: 1px solid var(--line); border-radius: 30px; background: rgba(255,255,255,.7); }
.user-chip small { display: block; font-size: 9.5px; color: var(--muted); line-height: 1.2; }
.user-chip strong { display: block; font-size: 12px; line-height: 1.3; }
.user-chip > .ic { color: var(--muted); width: 14px; }
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 10px); min-width: 258px; z-index: 80;
  background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg);
  padding: 8px; display: none; animation: dropIn .16s ease;
}
.dropdown.open .dropdown-menu { display: block; }
.dd-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 10px; font-size: 11px; color: var(--muted); letter-spacing: .08em; border-bottom: 1px solid var(--line-soft); margin-bottom: 4px; }
.dd-item { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; font-size: 12.5px; color: #333a4e; }
.dd-item:hover { background: #f7f5ff; }
.dd-item .ic { color: var(--violet); }
.dd-item small { display: block; color: var(--muted); font-size: 10.5px; }
.dd-foot { border-top: 1px solid var(--line-soft); padding: 8px; margin-top: 4px; }
.notice { display: flex; gap: 10px; padding: 10px; border-radius: 10px; }
.notice:hover { background: #faf9f6; }
.notice .ic { color: var(--amber); }
.notice b { display: block; font-size: 12px; font-weight: 600; }
.notice span { font-size: 10.5px; color: var(--muted); }
.notice em { font-style: normal; margin-left: auto; font-size: 9.5px; color: var(--muted-2); white-space: nowrap; }

.content { padding: 26px 30px 46px; max-width: 1680px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.eyebrow { font-family: var(--font-mono); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--violet); display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.eyebrow::before { content: ""; width: 18px; height: 1px; background: var(--violet); }
.page-head h1 { font-size: 26px; letter-spacing: -.02em; font-weight: 700; line-height: 1.25; }
.page-head p { margin-top: 6px; font-size: 12.5px; color: var(--muted); max-width: 780px; }
.ph-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 15px; border-radius: 10px; border: 1px solid transparent;
  font-size: 12.5px; font-weight: 600; white-space: nowrap; transition: .18s; background: #fff;
}
.btn .ic { width: 16px; height: 16px; }
.btn-primary {
  color: #fff; background: linear-gradient(135deg, #7c66ff, #5847d8);
  box-shadow: 0 9px 22px rgba(108, 92, 231, .28), inset 0 1px 0 rgba(255,255,255,.2);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 13px 28px rgba(108, 92, 231, .34); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #141c34; }
.btn-ghost { border-color: var(--line); background: rgba(255,255,255,.66); color: #3d4356; }
.btn-ghost:hover { background: #fff; border-color: #d4cfc2; }
.btn-plain { background: transparent; color: var(--muted); }
.btn-plain:hover { color: var(--violet); background: rgba(108,92,231,.06); }
.btn-danger { background: rgba(224,72,92,.09); color: #c23245; border-color: rgba(224,72,92,.18); }
.btn-danger:hover { background: rgba(224,72,92,.15); }
.btn-sm { height: 31px; padding: 0 10px; font-size: 11.5px; border-radius: 8px; }
.btn-xs { height: 27px; padding: 0 9px; font-size: 11px; border-radius: 7px; gap: 5px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ---------- Cards / panels ---------- */
.card {
  position: relative; background: var(--card); border: 1px solid rgba(23,27,43,.075);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card-pad { padding: 20px; }
.panel-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 0; }
.panel-head h3 { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.panel-head p { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.panel-head .ph-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.panel-body { padding: 18px 20px 20px; }
.section-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; color: var(--muted-2); }
.card-accent { overflow: hidden; }
.card-accent::before { content: ""; position: absolute; left: 20px; right: 20px; top: 0; height: 2px; background: linear-gradient(90deg, var(--violet), var(--cyan), transparent); opacity: .8; }
.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-4 { grid-template-columns: repeat(4, 1fr); }
.g-5 { grid-template-columns: repeat(5, 1fr); }
.g-6 { grid-template-columns: repeat(6, 1fr); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ---------- Stats ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.stat-tile {
  position: relative; overflow: hidden; padding: 16px 17px 15px;
  border-radius: 16px; background: #fff; border: 1px solid rgba(23,27,43,.075);
  box-shadow: var(--shadow-sm); transition: .2s;
}
.stat-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-tile::after { content: ""; position: absolute; right: -28px; top: -34px; width: 92px; height: 92px; border-radius: 50%; background: var(--tone, var(--violet)); opacity: .07; }
.st-top { display: flex; align-items: center; gap: 8px; }
.st-icon { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: color-mix(in srgb, var(--tone, var(--violet)) 12%, white); color: var(--tone, var(--violet)); }
.st-icon .ic { width: 15px; height: 15px; }
.st-label { font-size: 11.5px; color: var(--muted); }
.st-value { margin-top: 10px; font-family: var(--font-mono); font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.st-value small { font-size: 11px; font-weight: 500; color: var(--muted); margin-left: 3px; font-family: var(--font-sans); }
.st-foot { margin-top: 7px; font-size: 10.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.st-foot b { color: var(--tone, var(--violet)); font-weight: 600; }
.tone-violet { --tone: #6c5ce7; }
.tone-cyan { --tone: #0fa9bb; }
.tone-mint { --tone: #23a97c; }
.tone-amber { --tone: #d1952c; }
.tone-rose { --tone: #e0527f; }
.tone-ink { --tone: #39415c; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 10.5px; font-weight: 600; white-space: nowrap; }
.badge i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.b-ok { color: #1f8f68; background: rgba(47,191,143,.12); }
.b-warn { color: #b47714; background: rgba(226,166,59,.14); }
.b-danger { color: #c43346; background: rgba(224,72,92,.11); }
.b-info { color: #4b56b8; background: rgba(108,92,231,.11); }
.b-muted { color: #767d8e; background: rgba(115,123,143,.10); }
.b-violet { color: #6a4fd6; background: rgba(139,123,255,.14); }
.prio { display: inline-flex; align-items: center; height: 21px; padding: 0 7px; border-radius: 5px; font-size: 10.5px; font-weight: 700; letter-spacing: .02em; }
.p-danger { color: #c43346; background: rgba(224,72,92,.11); }
.p-warn { color: #ad7212; background: rgba(226,166,59,.16); }
.p-info { color: #4b56b8; background: rgba(108,92,231,.10); }
.p-muted { color: #767d8e; background: rgba(115,123,143,.10); }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 5px; font-size: 10.5px; background: #f5f3ed; color: #5e6577; border: 1px solid #ece8de; }
.tag-more { color: var(--violet); background: rgba(108,92,231,.07); border-color: rgba(108,92,231,.14); }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }

/* ---------- Avatars ---------- */
.avatar { display: inline-grid; place-items: center; border-radius: 50%; object-fit: cover; flex: 0 0 auto; background: #e9e6de; border: 1.5px solid rgba(255,255,255,.8); }
.av-xs { width: 24px; height: 24px; font-size: 10px; }
.av-sm { width: 32px; height: 32px; font-size: 12px; }
.av-md { width: 40px; height: 40px; font-size: 14px; }
.av-lg { width: 56px; height: 56px; font-size: 18px; }
.av-xl { width: 76px; height: 76px; font-size: 24px; }
.av-text { color: #fff; background: linear-gradient(135deg, hsl(var(--av-h, 250) 68% 62%), hsl(calc(var(--av-h, 250) + 38) 72% 52%)); font-weight: 600; }
.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person b { display: block; font-size: 12.5px; font-weight: 600; color: var(--text); }
.person small { display: block; font-size: 10.5px; color: var(--muted); }
.person > div { min-width: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Filter / Table ---------- */
.filter-bar {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  padding: 12px 14px; margin-bottom: 14px;
  background: rgba(255,255,255,.7); border: 1px solid rgba(23,27,43,.07); border-radius: 14px;
}
.search-box { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 11px; min-width: 250px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--muted); }
.search-box input { border: 0; outline: 0; width: 100%; font-size: 12px; background: transparent; }
.search-box:focus-within { border-color: var(--violet-2); box-shadow: 0 0 0 3px rgba(108,92,231,.09); }
.select-box { position: relative; display: flex; align-items: center; height: 36px; border: 1px solid var(--line); border-radius: 9px; background: #fff; padding: 0 9px; gap: 6px; }
.select-box > span { font-size: 10.5px; color: var(--muted-2); white-space: nowrap; }
.select-box select { appearance: none; border: 0; outline: 0; font-size: 12px; background: transparent; padding-right: 16px; min-width: 68px; color: #333a4e; }
.select-box .ic { width: 12px; height: 12px; color: var(--muted-2); position: absolute; right: 8px; pointer-events: none; }
.table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid rgba(23,27,43,.08); background: #fff; }
table.data { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 860px; }
table.data th {
  text-align: left; padding: 11px 14px; font-size: 10px; font-weight: 600; letter-spacing: .08em; color: #8b90a0;
  background: #fbfaf7; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data td { padding: 11px 14px; border-bottom: 1px solid #f1eee6; vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: .15s; }
table.data tbody tr:hover { background: #faf8ff; }
table.data .strong { font-weight: 600; color: #1b2033; }
table.data .mono { font-family: var(--font-mono); font-size: 11px; color: #5d6478; }
table.data .sub { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
table.data td.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.cell-main { display: flex; align-items: center; gap: 9px; min-width: 0; }
.cell-main .txt { min-width: 0; }
.cell-main b { display: block; font-size: 12.5px; font-weight: 600; color: #1b2033; }
.cell-main small { display: block; font-size: 10.5px; color: var(--muted); }
.row-actions { display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
.act {
  width: 28px; height: 28px; border-radius: 7px; border: 1px solid transparent; background: transparent;
  display: inline-grid; place-items: center; color: #7d8496;
}
.act .ic { width: 14px; height: 14px; }
.act:hover { background: #f3f0ff; color: var(--violet); border-color: rgba(108,92,231,.12); }
.act.danger:hover { background: #fff1f3; color: var(--danger); border-color: rgba(224,72,92,.15); }
.act-text { width: auto; padding: 0 8px; font-size: 11px; gap: 4px; display: inline-flex; }
.link { color: var(--violet); font-weight: 600; cursor: pointer; }
.link:hover { text-decoration: underline; }
.pbar { height: 5px; border-radius: 4px; background: #eeebe3; overflow: hidden; min-width: 56px; }
.pbar span { display: block; height: 100%; border-radius: 4px; background: var(--violet); }
.pbar-ok span { background: linear-gradient(90deg, #2fbf8f, #57d3a6); }
.pbar-warn span { background: linear-gradient(90deg, #e2a63b, #f0c368); }
.pbar-danger span { background: linear-gradient(90deg, #e0485c, #f07a8b); }
.pbar-violet span { background: linear-gradient(90deg, #6c5ce7, #9d8cff); }
.progress-cell { display: flex; align-items: center; gap: 8px; min-width: 96px; }
.progress-cell span { font-family: var(--font-mono); font-size: 10px; color: var(--muted); }
.pager { display: flex; align-items: center; justify-content: space-between; padding: 14px 4px 0; font-size: 11px; color: var(--muted); }
.pager-btns { display: flex; gap: 4px; }
.pg-btn { min-width: 28px; height: 28px; padding: 0 7px; border: 1px solid var(--line); border-radius: 7px; display: inline-grid; place-items: center; background: #fff; font-size: 11px; }
.pg-btn:hover { border-color: var(--violet-2); color: var(--violet); }
.pg-btn.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.pg-btn.disabled { opacity: .4; pointer-events: none; }
.empty { padding: 48px 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 7px; color: var(--muted); }
.empty strong { font-size: 13px; color: #3c4356; }
.empty span { font-size: 11px; }
.empty-orb { width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; background: linear-gradient(145deg, #f3f0ff, #eef9fb); color: #8b8fa6; margin-bottom: 4px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 3px; padding: 4px; background: #f3f1ea; border-radius: 11px; width: max-content; max-width: 100%; overflow-x: auto; }
.tab { height: 30px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; font-size: 11.5px; color: #697083; white-space: nowrap; }
.tab.active { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 2px 7px rgba(23,27,43,.08); }
.seg { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.seg a, .seg button { position: relative; padding: 9px 14px 11px; border: 0; background: none; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.seg a.active, .seg button.active { color: var(--ink); font-weight: 600; }
.seg a.active::after, .seg button.active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; background: var(--violet); border-radius: 2px; }
.seg .count { font-family: var(--font-mono); font-size: 9.5px; background: #ece9e0; color: #6c7286; border-radius: 10px; padding: 1px 6px; margin-left: 5px; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.col-12 { grid-column: span 12; }
.col-6 { grid-column: span 6; }
.col-4 { grid-column: span 4; }
.col-3 { grid-column: span 3; }
.field > label { font-size: 11px; color: #697083; font-weight: 600; display: flex; align-items: center; gap: 4px; }
.field > label em { color: var(--danger); font-style: normal; }
.field input, .field select, .field textarea {
  height: 40px; border: 1px solid var(--line); border-radius: 9px; background: #fdfcf9; padding: 0 11px; font-size: 12.5px; outline: 0; width: 100%; transition: .16s;
}
.field textarea { height: auto; min-height: 92px; padding: 10px 11px; resize: vertical; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--violet-2); background: #fff; box-shadow: 0 0 0 3px rgba(108,92,231,.09); }
.field .hint { font-size: 10px; color: var(--muted-2); }
.field input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--violet); }
.check-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; max-height: 320px; overflow: auto; }
.check-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fdfcf9; font-size: 11.5px; }
.check-item input { width: 14px; height: 14px; accent-color: var(--violet); }
.switch { position: relative; width: 38px; height: 21px; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; }
.switch span { position: absolute; inset: 0; border-radius: 20px; background: #d9d5ca; transition: .2s; }
.switch span::after { content: ""; position: absolute; width: 15px; height: 15px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--mint); }
.switch input:checked + span::after { transform: translateX(17px); }

/* ---------- Agents / Cards ---------- */
.cards-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; }
.agent-card { position: relative; overflow: hidden; border-radius: 18px; background: #fff; border: 1px solid rgba(23,27,43,.08); box-shadow: var(--shadow-sm); transition: .22s; }
.agent-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: rgba(108,92,231,.22); }
.agent-cover { position: relative; height: 132px; background: radial-gradient(280px 160px at 50% 20%, rgba(108,92,231,.30), transparent 70%), linear-gradient(145deg, #101730, #1d2550); display: grid; place-items: center; }
.agent-cover::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 22px 22px; mask-image: radial-gradient(circle at 50% 40%, #000, transparent 75%); }
.agent-cover .avatar { width: 86px; height: 86px; border: 2px solid rgba(255,255,255,.24); box-shadow: 0 14px 32px rgba(0,0,0,.35); }
.agent-cover .agent-status { position: absolute; top: 12px; right: 12px; }
.agent-cover .agent-code { position: absolute; left: 14px; top: 13px; font-family: var(--font-mono); font-size: 9px; color: rgba(255,255,255,.5); letter-spacing: .08em; }
.agent-body { padding: 14px 16px 15px; }
.agent-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.agent-title h3 { font-size: 15.5px; font-weight: 700; letter-spacing: -.01em; }
.agent-title p { font-size: 11px; color: var(--muted); margin-top: 2px; }
.agent-title .av-load { font-family: var(--font-mono); font-size: 10px; color: var(--muted); text-align: right; }
.agent-title .av-load b { display: block; font-size: 15px; color: var(--text); }
.agent-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 10px 0 12px; height: 48px; overflow: hidden; }
.agent-metrics { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid #f0ede5; padding-top: 11px; gap: 4px; }
.agent-metrics div { text-align: center; }
.agent-metrics b { display: block; font-family: var(--font-mono); font-size: 13px; font-weight: 700; }
.agent-metrics span { display: block; font-size: 9.5px; color: var(--muted); margin-top: 1px; }
.agent-loadbar { margin-top: 10px; display: flex; align-items: center; gap: 8px; }
.agent-loadbar .pbar { flex: 1; }
.agent-card .card-menu { position: absolute; right: 9px; bottom: 9px; opacity: 0; transition: .2s; }
.agent-card:hover .card-menu { opacity: 1; }

.policy-card { position: relative; overflow: hidden; border-radius: 18px; background: #fff; border: 1px solid rgba(23,27,43,.08); box-shadow: var(--shadow-sm); transition: .22s; }
.policy-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.policy-card .watermark { position: absolute; right: 10px; top: -16px; font-family: var(--font-mono); font-size: 74px; font-weight: 700; color: rgba(108,92,231,.05); letter-spacing: -.08em; }
.policy-body { position: relative; padding: 18px; }
.policy-type { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .08em; color: var(--violet); }
.policy-card h3 { font-size: 15px; margin-top: 8px; font-weight: 700; }
.policy-card p { font-size: 11.5px; color: var(--muted); margin-top: 6px; line-height: 1.65; min-height: 38px; }
.policy-rules { margin-top: 12px; padding: 10px 0 0; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: 6px; }
.policy-rule { display: flex; align-items: center; gap: 7px; font-size: 10.5px; color: #5e6578; }
.policy-rule i { width: 4px; height: 4px; border-radius: 50%; background: var(--cyan); }
.policy-foot { display: flex; align-items: center; gap: 8px; padding: 11px 18px; background: #fbfaf7; border-top: 1px solid var(--line-soft); }
.policy-foot .spacer { flex: 1; }
.policy-stat { font-family: var(--font-mono); font-size: 9.5px; color: var(--muted); }

.skill-card { padding: 16px; border-radius: 16px; background: #fff; border: 1px solid rgba(23,27,43,.08); box-shadow: var(--shadow-sm); transition: .2s; }
.skill-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.skill-head { display: flex; align-items: center; gap: 10px; }
.skill-glyph { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-family: var(--font-mono); font-size: 15px; font-weight: 700; }
.skill-head h3 { font-size: 13px; font-weight: 700; }
.skill-head small { font-size: 10px; color: var(--muted); }
.skill-head .badge { margin-left: auto; }
.skill-desc { margin: 10px 0 12px; font-size: 10.5px; color: var(--muted); line-height: 1.6; min-height: 32px; }
.skill-cover { display: flex; align-items: center; gap: 8px; }
.skill-cover .pbar { flex: 1; }
.skill-cover span { font-family: var(--font-mono); font-size: 10px; color: var(--muted); }
.skill-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; font-size: 9.5px; color: var(--muted-2); }

/* ---------- Kanban ---------- */
.kanban { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; align-items: start; }
.kb-col { background: rgba(255,255,255,.52); border: 1px solid rgba(23,27,43,.07); border-radius: 16px; padding: 12px; min-height: 380px; }
.kb-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 11px; }
.kb-head b { font-size: 12px; }
.kb-head .count { font-family: var(--font-mono); font-size: 9.5px; color: var(--muted); background: #eeece5; border-radius: 9px; padding: 1px 6px; }
.kb-head .dotc { width: 7px; height: 7px; border-radius: 50%; background: var(--kc, var(--violet)); }
.kb-card { background: #fff; border: 1px solid rgba(23,27,43,.075); border-radius: 12px; padding: 12px; margin-bottom: 9px; box-shadow: 0 1px 3px rgba(23,27,43,.04); cursor: grab; transition: .18s; }
.kb-card:hover { box-shadow: var(--shadow); border-color: rgba(108,92,231,.2); }
.kb-card .kb-title { font-size: 12px; font-weight: 600; line-height: 1.45; display: flex; gap: 7px; }
.kb-card .kb-title .prio { flex: 0 0 auto; }
.kb-meta { display: flex; align-items: center; gap: 6px; margin-top: 9px; font-size: 9.5px; color: var(--muted); flex-wrap: wrap; }
.kb-foot { display: flex; align-items: center; gap: 6px; margin-top: 9px; padding-top: 9px; border-top: 1px dashed var(--line); }
.kb-foot .person small { display: none; }
.kb-foot .person b { font-size: 10px; }
.kb-foot .spacer { flex: 1; }
.kb-empty { padding: 22px 8px; text-align: center; color: var(--muted-2); font-size: 10.5px; border: 1px dashed var(--line); border-radius: 10px; }

/* ---------- Detail / timeline ---------- */
.detail-hero { display: flex; align-items: center; gap: 14px; padding: 2px 0 16px; }
.detail-hero .avatar { width: 60px; height: 60px; }
.detail-hero h3 { font-size: 18px; font-weight: 700; }
.detail-hero p { font-size: 11px; color: var(--muted); margin-top: 3px; }
.detail-hero .dh-right { margin-left: auto; text-align: right; }
.d-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: 12px; overflow: hidden; }
.d-row { display: flex; gap: 14px; padding: 11px 14px; background: #fff; }
.d-label { width: 98px; flex: 0 0 auto; font-size: 10.5px; color: var(--muted); }
.d-value { font-size: 12px; color: #2a3042; min-width: 0; }
.d-value.pre { white-space: pre-wrap; line-height: 1.7; }
.d-value.full { grid-column: span 2; }
.d-row.full { grid-column: span 2; }
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 1px; background: linear-gradient(var(--violet), var(--line)); }
.tl-item { position: relative; padding: 0 0 18px; }
.tl-item::before { content: ""; position: absolute; left: -20px; top: 4px; width: 9px; height: 9px; border-radius: 50%; background: #fff; border: 2px solid var(--violet); box-shadow: 0 0 0 3px rgba(108,92,231,.1); }
.tl-item:last-child { padding-bottom: 0; }
.tl-item b { font-size: 12px; font-weight: 600; }
.tl-item time { font-family: var(--font-mono); font-size: 9.5px; color: var(--muted-2); margin-left: 8px; }
.tl-item p { font-size: 11px; color: var(--muted); margin-top: 4px; }
.tl-item .who { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; color: #5f6678; margin-top: 5px; background: #f6f4ee; padding: 2px 7px; border-radius: 5px; }
.json-block { background: #0f1424; color: #c8d3ea; border-radius: 10px; padding: 14px; font-family: var(--font-mono); font-size: 11px; line-height: 1.75; overflow: auto; max-height: 320px; }
.json-key { color: #8b7bff; }
.json-str { color: #7ddfc2; }
.steps { display: flex; gap: 0; margin: 4px 0 18px; }
.step { flex: 1; position: relative; text-align: center; font-size: 10px; color: var(--muted); }
.step::before { content: ""; position: absolute; top: 12px; left: -50%; width: 100%; height: 2px; background: var(--line); z-index: 0; }
.step:first-child::before { display: none; }
.step i { position: relative; z-index: 1; display: grid; place-items: center; width: 25px; height: 25px; margin: 0 auto 6px; border-radius: 50%; background: #eeece5; color: #8b90a0; font-style: normal; font-size: 10px; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.step.done i { background: var(--mint); color: #fff; box-shadow: 0 0 0 1px var(--mint); }
.step.current i { background: var(--violet); color: #fff; box-shadow: 0 0 0 4px rgba(108,92,231,.13); }
.step.done::before, .step.current::before { background: linear-gradient(90deg, var(--mint), var(--violet)); }
.step b { display: block; font-size: 10.5px; color: #3f4658; font-weight: 600; }
.sync-row { display: flex; gap: 7px; flex-wrap: wrap; padding-top: 14px; margin-top: 4px; border-top: 1px dashed var(--line); }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(8, 11, 22, .52); backdrop-filter: blur(5px);
  animation: fadeIn .18s ease;
}
.modal {
  position: relative; width: min(720px, 96vw); max-height: 88vh; display: flex; flex-direction: column;
  background: #fdfcf9; border-radius: 20px; box-shadow: var(--shadow-lg); overflow: hidden;
  animation: modalIn .24s cubic-bezier(.2,.9,.25,1);
  border: 1px solid rgba(255,255,255,.5);
}
.modal::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, var(--violet), var(--cyan), transparent); z-index: 2; }
.modal.wide { width: min(1040px, 96vw); }
.modal.narrow { width: min(520px, 96vw); }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 22px 14px; border-bottom: 1px solid var(--line-soft); background: #fff; }
.modal-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(145deg, rgba(108,92,231,.13), rgba(22,199,217,.10)); color: var(--violet); flex: 0 0 auto; }
.modal-head h3 { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.modal-head p { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.modal-close { margin-left: auto; width: 30px; height: 30px; border-radius: 8px; border: 0; background: #f4f2ec; color: #6f7688; display: grid; place-items: center; }
.modal-close:hover { background: #ebe8df; color: var(--text); }
.modal-body { padding: 18px 22px 22px; overflow-y: auto; }
.modal-foot { display: flex; align-items: center; gap: 8px; justify-content: flex-end; padding: 13px 22px; border-top: 1px solid var(--line-soft); background: #fbfaf7; }
.modal-foot .left { margin-right: auto; font-size: 10.5px; color: var(--muted); }
.modal-overlay.stacked { background: rgba(8, 11, 22, .35); }
.modal-overlay.stacked .modal { transform: scale(.965) translateY(-10px); filter: brightness(.96); }
.modal-overlay.stacked { pointer-events: none; }
.modal-overlay.stacked + .modal-overlay { pointer-events: auto; }
.modal .mtabs { display: flex; gap: 2px; padding: 4px; background: #f2f0e9; border-radius: 10px; margin-bottom: 16px; width: max-content; max-width: 100%; overflow-x: auto; }
.modal .mtabs button { height: 28px; padding: 0 12px; border: 0; background: none; border-radius: 7px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.modal .mtabs button.active { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 2px 6px rgba(23,27,43,.07); }
.mtab-pane { display: none; }
.mtab-pane.active { display: block; animation: fadeIn .16s; }
.confirm-text { font-size: 13px; line-height: 1.7; color: #3d4356; }
.confirm-text b { color: var(--danger); }
.form-error { margin-top: 10px; padding: 9px 12px; border-radius: 8px; background: #fff1f3; color: #b32a3d; font-size: 11px; display: none; }
.form-error.show { display: block; }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; right: 22px; bottom: 22px; z-index: 300; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; min-width: 240px; max-width: 380px; padding: 11px 14px; border-radius: 11px; background: #101528; color: #f2f4fb; box-shadow: var(--shadow-lg); font-size: 12px; animation: toastIn .24s ease; }
.toast .ic { color: #5be0b7; }
.toast.error .ic { color: #ff8496; }
.toast .toast-close { margin-left: auto; background: none; border: 0; color: rgba(255,255,255,.5); display: grid; place-items: center; }

/* ---------- Dashboard ---------- */
.hero-panel {
  position: relative; overflow: hidden; border-radius: 24px; padding: 24px 26px; margin-bottom: 16px;
  background:
    radial-gradient(600px 300px at 80% 0%, rgba(108, 92, 231, .55), transparent 65%),
    radial-gradient(500px 300px at 55% 110%, rgba(22, 199, 217, .22), transparent 65%),
    linear-gradient(125deg, #0b1022, #151d3c 60%, #1b2350);
  color: #fff; box-shadow: 0 22px 50px rgba(10, 15, 30, .3);
  display: grid; grid-template-columns: 1.2fr 1fr 1.1fr; gap: 24px; align-items: center;
}
.hero-panel::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 30px 30px; mask-image: radial-gradient(circle at 70% 30%, #000, transparent 80%); }
.hero-panel::after { content: ""; position: absolute; right: -80px; top: -120px; width: 320px; height: 320px; border-radius: 50%; border: 1px solid rgba(255,255,255,.08); box-shadow: 0 0 0 30px rgba(255,255,255,.02), 0 0 0 70px rgba(255,255,255,.018); }
.hero-copy { position: relative; z-index: 1; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .16em; color: rgba(255,255,255,.55); }
.hero-copy h2 { font-size: 25px; line-height: 1.3; margin: 10px 0 8px; letter-spacing: -.02em; }
.hero-copy p { font-size: 11.5px; color: rgba(255,255,255,.55); max-width: 400px; }
.hero-tags { display: flex; gap: 7px; margin-top: 15px; flex-wrap: wrap; }
.hero-tag { font-size: 9.5px; padding: 4px 9px; border-radius: 20px; border: 1px solid rgba(255,255,255,.14); color: rgba(255,255,255,.68); background: rgba(255,255,255,.04); }
.health-ring { position: relative; z-index: 1; display: flex; align-items: center; gap: 16px; }
.ring-chart { position: relative; width: 132px; height: 132px; }
.ring-chart svg { transform: rotate(-90deg); }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-center b { font-family: var(--font-mono); font-size: 27px; letter-spacing: -.03em; }
.ring-center span { font-size: 9px; color: rgba(255,255,255,.45); letter-spacing: .08em; margin-top: 1px; }
.health-list { display: flex; flex-direction: column; gap: 9px; }
.hl-item { font-size: 10.5px; color: rgba(255,255,255,.55); display: flex; align-items: center; gap: 7px; }
.hl-item i { width: 5px; height: 5px; border-radius: 50%; background: var(--cyan); }
.hl-item b { margin-left: auto; font-family: var(--font-mono); color: #fff; font-size: 11px; }
.hero-mini { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hm-card { padding: 12px 13px; border-radius: 13px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); backdrop-filter: blur(6px); }
.hm-card small { font-size: 9px; color: rgba(255,255,255,.5); display: block; }
.hm-card b { font-family: var(--font-mono); font-size: 19px; display: block; margin-top: 4px; letter-spacing: -.02em; }
.hm-card span { font-size: 9px; color: #6ee7c9; }
.dash-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 16px; }
.chart-box { position: relative; width: 100%; height: 220px; }
.chart-box svg { width: 100%; height: 100%; overflow: visible; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 10px; color: var(--muted); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; }
.bar-list { display: flex; flex-direction: column; gap: 12px; }
.bar-item .bl-top { display: flex; align-items: center; gap: 8px; font-size: 11px; margin-bottom: 5px; }
.bar-item .bl-top b { font-weight: 600; }
.bar-item .bl-top span { margin-left: auto; font-family: var(--font-mono); font-size: 10px; color: var(--muted); }
.feed { display: flex; flex-direction: column; gap: 2px; max-height: 286px; overflow-y: auto; }
.feed-item { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line-soft); }
.feed-item:last-child { border-bottom: 0; }
.feed-ico { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: 0 0 auto; background: rgba(108,92,231,.08); color: var(--violet); }
.feed-ico .ic { width: 14px; height: 14px; }
.feed-item b { display: block; font-size: 11.5px; font-weight: 600; }
.feed-item span { display: block; font-size: 10px; color: var(--muted); margin-top: 1px; }
.feed-item time { margin-left: auto; font-family: var(--font-mono); font-size: 9px; color: var(--muted-2); white-space: nowrap; }
.donut-wrap { display: flex; align-items: center; gap: 16px; }
.donut-wrap .legend { flex-direction: column; gap: 8px; }
.donut-wrap .legend div { display: flex; align-items: center; }
.donut-wrap .legend b { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--text); padding-left: 18px; }
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.quick-item { display: flex; flex-direction: column; gap: 7px; padding: 11px; border: 1px solid var(--line); border-radius: 11px; font-size: 10.5px; color: #4a5164; background: #fdfcf9; transition: .16s; }
.quick-item:hover { border-color: rgba(108,92,231,.3); background: #faf8ff; color: var(--violet); }
.quick-item .ic { color: var(--violet); }

/* ---------- Monitor ---------- */
.monitor-stage {
  position: relative; border-radius: 22px; padding: 22px; overflow: hidden; color: #dce3f5;
  background:
    radial-gradient(700px 360px at 25% 0%, rgba(108,92,231,.28), transparent 60%),
    radial-gradient(600px 360px at 90% 80%, rgba(22,199,217,.15), transparent 60%),
    linear-gradient(150deg, #080d1c, #0d1428);
  border: 1px solid rgba(255,255,255,.07);
}
.monitor-stage::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 32px 32px; pointer-events: none; }
.ms-head { position: relative; display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.ms-head h2 { font-size: 18px; letter-spacing: .04em; color: #fff; }
.ms-head p { font-family: var(--font-mono); font-size: 9.5px; color: rgba(220,227,245,.42); letter-spacing: .1em; margin-top: 3px; }
.ms-live { margin-left: auto; display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 10px; color: #66e3bb; background: rgba(47,191,143,.08); border: 1px solid rgba(47,191,143,.2); padding: 6px 11px; border-radius: 20px; }
.ms-stats { position: relative; display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 16px; }
.ms-stat { padding: 12px 14px; border-radius: 12px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); }
.ms-stat span { font-size: 9px; color: rgba(220,227,245,.45); letter-spacing: .04em; }
.ms-stat b { display: block; font-family: var(--font-mono); font-size: 21px; color: #fff; margin-top: 5px; letter-spacing: -.02em; }
.ms-stat b em { font-style: normal; font-size: 9px; color: #66e3bb; margin-left: 3px; }
.ms-grid { position: relative; display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; }
.ms-panel { border-radius: 14px; background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.08); padding: 14px; }
.ms-panel h4 { font-size: 10.5px; color: rgba(220,227,245,.7); letter-spacing: .08em; display: flex; align-items: center; gap: 7px; margin-bottom: 12px; }
.ms-panel h4 .ic { color: #8b7bff; width: 14px; height: 14px; }
.ms-agent-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-height: 342px; overflow-y: auto; }
.ms-agent { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 9px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.06); }
.ms-agent .avatar { width: 28px; height: 28px; }
.ms-agent b { font-size: 10px; display: block; color: #e9eefb; }
.ms-agent small { font-size: 8px; color: rgba(220,227,245,.4); display: block; }
.ms-agent .m-load { margin-left: auto; font-family: var(--font-mono); font-size: 9px; color: #8ee8cf; }
.ms-agent.busy .m-load { color: #f3c36c; }
.ms-agent.off .m-load { color: #ff8fa0; }
.ms-feed { display: flex; flex-direction: column; gap: 7px; max-height: 342px; overflow-y: auto; }
.ms-feed-item { font-size: 9.5px; color: rgba(220,227,245,.62); display: flex; gap: 7px; padding: 7px 8px; border-radius: 7px; background: rgba(255,255,255,.03); }
.ms-feed-item i { width: 4px; height: 4px; border-radius: 50%; background: #8b7bff; margin-top: 5px; flex: 0 0 auto; }
.ms-feed-item time { margin-left: auto; font-family: var(--font-mono); font-size: 8px; color: rgba(220,227,245,.3); white-space: nowrap; }
.ms-chart { height: 150px; }
.ms-orbit { position: relative; height: 250px; display: grid; place-items: center; }
.orbit-svg { width: 100%; height: 100%; }

/* ---------- Flow canvas ---------- */
.flow-shell { display: grid; grid-template-columns: 250px 1fr; gap: 14px; }
.flow-list { display: flex; flex-direction: column; gap: 5px; max-height: 560px; overflow-y: auto; }
.flow-item { padding: 11px 12px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; }
.flow-item:hover { background: #f7f5ef; }
.flow-item.active { background: #fff; border-color: rgba(108,92,231,.24); box-shadow: var(--shadow-sm); }
.flow-item b { font-size: 11.5px; display: block; }
.flow-item small { font-size: 9.5px; color: var(--muted); display: block; margin-top: 2px; }
.flow-item .fi-meta { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.canvas-card { position: relative; overflow: hidden; min-height: 560px; background: #fbfaf7; }
.flow-canvas { position: relative; width: 100%; height: 560px; overflow: auto; background-image: radial-gradient(circle, rgba(23,27,43,.13) 1px, transparent 1px); background-size: 20px 20px; }
.flow-canvas-inner { position: relative; width: 1600px; height: 560px; }
.flow-node {
  position: absolute; width: 152px; padding: 10px 12px; border-radius: 11px; background: #fff;
  border: 1px solid rgba(23,27,43,.12); box-shadow: 0 6px 18px rgba(23,27,43,.08); cursor: grab;
  transition: box-shadow .15s, border-color .15s; user-select: none;
}
.flow-node:hover { border-color: rgba(108,92,231,.45); box-shadow: 0 10px 24px rgba(108,92,231,.15); }
.flow-node.dragging { cursor: grabbing; box-shadow: 0 18px 40px rgba(23,27,43,.2); z-index: 5; }
.flow-node .fn-icon { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; background: rgba(108,92,231,.1); color: var(--violet); margin-bottom: 6px; }
.flow-node .fn-icon .ic { width: 13px; height: 13px; }
.flow-node.trigger .fn-icon { background: rgba(47,191,143,.12); color: #1f9d74; }
.flow-node.end .fn-icon { background: rgba(236,92,141,.1); color: #d34877; }
.flow-node b { font-size: 10.5px; display: block; line-height: 1.4; }
.flow-node small { display: block; font-size: 8.5px; color: var(--muted); margin-top: 3px; }
.flow-node .fn-port { position: absolute; right: -5px; top: 50%; width: 9px; height: 9px; border-radius: 50%; background: #fff; border: 2px solid var(--violet); transform: translateY(-50%); }
.flow-node .fn-del { position: absolute; right: 4px; top: 4px; width: 16px; height: 16px; border: 0; border-radius: 4px; background: transparent; color: var(--muted-2); display: none; place-items: center; font-size: 11px; }
.flow-node:hover .fn-del { display: grid; }
.flow-lines { position: absolute; inset: 0; pointer-events: none; }
.flow-toolbar { position: absolute; left: 14px; bottom: 14px; display: flex; gap: 7px; z-index: 3; }
.flow-hint { position: absolute; right: 14px; bottom: 14px; font-size: 9.5px; color: var(--muted-2); }

/* ---------- Login ---------- */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1.08fr .92fr; background: #f4f2ec; }
.auth-art {
  position: relative; overflow: hidden; padding: 42px 52px; color: #fff; display: flex; flex-direction: column;
  background:
    radial-gradient(900px 500px at 20% 10%, rgba(108, 92, 231, .45), transparent 60%),
    radial-gradient(700px 500px at 90% 80%, rgba(22, 199, 217, .18), transparent 60%),
    linear-gradient(145deg, #080d1c, #131a36);
}
.auth-art::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size: 42px 42px; mask-image: radial-gradient(circle at 50% 40%, #000, transparent 80%); }
.auth-orbit { position: absolute; right: -120px; bottom: -140px; width: 560px; height: 560px; border-radius: 50%; border: 1px solid rgba(255,255,255,.08); box-shadow: 0 0 0 60px rgba(255,255,255,.018), 0 0 0 130px rgba(255,255,255,.014), 0 0 0 210px rgba(255,255,255,.01); }
.auth-orbit::after { content: ""; position: absolute; left: 90px; top: 40px; width: 12px; height: 12px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 20px var(--cyan); }
.auth-art .brand { padding: 0; position: relative; z-index: 1; }
.auth-copy { position: relative; z-index: 1; margin-top: auto; max-width: 520px; }
.auth-copy .hero-eyebrow { color: rgba(255,255,255,.45); }
.auth-copy h1 { font-size: 38px; line-height: 1.25; letter-spacing: -.02em; margin: 14px 0 14px; font-weight: 700; }
.auth-copy h1 em { font-style: normal; color: #a99cff; }
.auth-copy p { font-size: 13px; color: rgba(255,255,255,.5); line-height: 1.8; }
.auth-metrics { display: flex; gap: 30px; margin-top: 30px; position: relative; z-index: 1; }
.auth-metric b { font-family: var(--font-mono); font-size: 22px; display: block; }
.auth-metric span { font-size: 9.5px; color: rgba(255,255,255,.4); letter-spacing: .06em; }
.auth-art-foot { position: relative; z-index: 1; margin-top: auto; padding-top: 30px; font-family: var(--font-mono); font-size: 9px; color: rgba(255,255,255,.28); letter-spacing: .08em; }
.auth-form-side { display: flex; align-items: center; justify-content: center; padding: 40px; }
.auth-card { width: min(400px, 100%); }
.auth-card .eyebrow { color: var(--violet); }
.auth-card h2 { font-size: 25px; letter-spacing: -.02em; margin: 6px 0 5px; }
.auth-card > p { font-size: 11.5px; color: var(--muted); margin-bottom: 22px; }
.auth-form { display: flex; flex-direction: column; gap: 13px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-field label { font-size: 10.5px; font-weight: 600; color: #5f6678; letter-spacing: .02em; }
.auth-input { position: relative; display: flex; align-items: center; }
.auth-input > .ic { position: absolute; left: 13px; color: #9aa0b0; width: 16px; height: 16px; }
.auth-input input { width: 100%; height: 46px; border: 1px solid #ddd8cc; border-radius: 11px; background: #fff; padding: 0 42px 0 40px; font-size: 13px; outline: 0; transition: .16s; }
.auth-input input:focus { border-color: var(--violet-2); box-shadow: 0 0 0 4px rgba(108,92,231,.09); }
.auth-input .peek { position: absolute; right: 8px; width: 30px; height: 30px; border: 0; background: none; color: #9aa0b0; display: grid; place-items: center; }
.auth-row { display: flex; align-items: center; justify-content: space-between; font-size: 10.5px; color: var(--muted); margin: 2px 0 4px; }
.auth-row label { display: flex; align-items: center; gap: 6px; }
.auth-check { width: 14px; height: 14px; accent-color: var(--violet); }
.auth-submit { height: 46px; border-radius: 11px; font-size: 13px; margin-top: 2px; }
.auth-alt { text-align: center; font-size: 11px; color: var(--muted); margin-top: 18px; }
.auth-alt a { color: var(--violet); font-weight: 600; }
.auth-note { display: flex; gap: 8px; padding: 10px 12px; background: #f1eee6; border-radius: 9px; font-size: 10px; color: #777e90; line-height: 1.6; margin-top: 18px; }
.auth-error { padding: 9px 12px; border-radius: 8px; background: #fff0f2; color: #b32a3d; font-size: 11px; }
.auth-copyright { text-align: center; font-size: 9.5px; color: var(--muted-2); margin-top: 26px; letter-spacing: .03em; }
.auth-back { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--muted); margin-bottom: 20px; }
.auth-back:hover { color: var(--violet); }

/* ---------- Misc ---------- */
.two-col { display: grid; grid-template-columns: 1.4fr .9fr; gap: 16px; }
.kpi-inline { display: flex; gap: 18px; flex-wrap: wrap; }
.kpi-inline div { display: flex; flex-direction: column; gap: 1px; }
.kpi-inline b { font-family: var(--font-mono); font-size: 20px; letter-spacing: -.02em; }
.kpi-inline span { font-size: 9.5px; color: var(--muted); }
.toolbar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }
.bulkbar { display: none; align-items: center; gap: 10px; padding: 9px 13px; border-radius: 10px; background: #f3f0ff; border: 1px solid rgba(108,92,231,.16); font-size: 11px; color: #5a4cc9; margin-bottom: 10px; }
.bulkbar.show { display: flex; }
.bulkbar b { font-family: var(--font-mono); }
.selection-cell { width: 34px; }
.chk { width: 14px; height: 14px; accent-color: var(--violet); }
.rank { font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--muted-2); }
.rank.r1 { color: #d3a029; } .rank.r2 { color: #8b93a8; } .rank.r3 { color: #b97a4b; }
.rank-medal { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: #f3f1ea; }
.rank-medal.r1 { background: linear-gradient(145deg, #fff1c9, #f5d987); color: #996c00; }
.rank-medal.r2 { background: linear-gradient(145deg, #f0f2f6, #d9dee8); color: #626b7f; }
.rank-medal.r3 { background: linear-gradient(145deg, #f8e6d8, #eac8ae); color: #95603a; }
.ring-mini { width: 44px; height: 44px; position: relative; }
.ring-mini svg { transform: rotate(-90deg); }
.ring-mini b { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-mono); font-size: 9.5px; }
.setting-row { display: flex; align-items: center; gap: 14px; padding: 15px 4px; border-bottom: 1px solid var(--line-soft); }
.setting-row:last-child { border-bottom: 0; }
.setting-row .sr-main { flex: 1; min-width: 0; }
.setting-row b { font-size: 12.5px; display: block; font-weight: 600; }
.setting-row small { font-size: 10px; color: var(--muted); display: block; margin-top: 2px; }
.setting-input { width: 118px; height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; font-family: var(--font-mono); font-size: 12px; text-align: right; background: #fdfcf9; }
.setting-unit { font-size: 10px; color: var(--muted); width: 40px; }
.integration-card { padding: 16px; border-radius: 16px; border: 1px solid rgba(23,27,43,.08); background: #fff; box-shadow: var(--shadow-sm); transition: .2s; }
.integration-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.int-head { display: flex; align-items: center; gap: 10px; }
.int-logo { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; background: var(--intc, #6c5ce7); }
.int-head b { font-size: 12.5px; display: block; }
.int-head small { font-size: 9.5px; color: var(--muted); }
.int-head .badge { margin-left: auto; }
.int-endpoint { margin: 10px 0; font-family: var(--font-mono); font-size: 9.5px; color: #767d8e; background: #f8f6f1; border: 1px solid #efebe2; padding: 6px 8px; border-radius: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.int-stats { display: flex; align-items: center; gap: 16px; padding-top: 10px; border-top: 1px dashed var(--line); }
.int-stats div b { display: block; font-family: var(--font-mono); font-size: 12px; }
.int-stats div span { font-size: 9px; color: var(--muted); }
.int-foot { display: flex; gap: 6px; margin-top: 12px; }
.alert-strip { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 14px; border-radius: 11px; background: linear-gradient(90deg, rgba(236,92,141,.09), rgba(226,166,59,.06)); border: 1px solid rgba(236,92,141,.16); font-size: 11px; color: #8c415a; }
.alert-strip .ic { color: var(--rose); }
.alert-strip b { color: #7c2e46; }
.alert-strip .spacer { flex: 1; }
.audit-json { font-family: var(--font-mono); font-size: 10px; color: #6b7280; background: #f8f6f1; padding: 6px 8px; border-radius: 6px; max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bottleneck-card { padding: 16px; border-radius: 15px; background: #fff; border: 1px solid rgba(23,27,43,.08); box-shadow: var(--shadow-sm); border-left: 3px solid var(--sev, var(--amber)); }
.bottleneck-card h4 { font-size: 12.5px; display: flex; gap: 7px; align-items: flex-start; }
.bottleneck-card p { font-size: 10.5px; color: var(--muted); margin-top: 7px; line-height: 1.65; }
.bottleneck-card .sugg { margin-top: 9px; padding: 8px 10px; border-radius: 8px; background: #f8f6f0; font-size: 10px; color: #616879; line-height: 1.6; }
.bottleneck-card .sugg b { color: #3f4658; }
.sev-high { --sev: #e0485c; } .sev-mid { --sev: #e2a63b; } .sev-low { --sev: #2fbf8f; }
.org-tabs { margin-bottom: 18px; }
.table-note { font-size: 10.5px; color: var(--muted); padding: 10px 2px 0; }

@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(47,191,143,.45); } 70% { box-shadow: 0 0 0 7px rgba(47,191,143,0); } 100% { box-shadow: 0 0 0 0 rgba(47,191,143,0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes dropIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes dash { to { stroke-dashoffset: 0; } }
@keyframes floatY { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* ---------- Responsive ---------- */
@media (max-width: 1440px) {
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .cards-grid { grid-template-columns: repeat(3, 1fr); }
  .hero-panel { grid-template-columns: 1.1fr 1fr; }
  .hero-mini { display: none; }
  .ms-stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1200px) {
  .g-4, .g-5, .g-6 { grid-template-columns: repeat(2, 1fr); }
  .dash-grid, .two-col, .ms-grid { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: repeat(2, 1fr); }
  .flow-shell { grid-template-columns: 1fr; }
  .flow-list { flex-direction: row; overflow-x: auto; max-height: none; }
  .flow-item { min-width: 190px; }
  .monitor-stage .ms-stats { grid-template-columns: repeat(3, 1fr); }
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 980px) {
  .sidebar { transform: translateX(-100%); }
  body.sidebar-mobile-open .sidebar { transform: none; }
  .mobile-menu { display: grid; }
  .main { margin-left: 0 !important; }
  .top-search { display: none; }
  .content { padding: 20px 18px 40px; }
  .topbar { padding: 0 18px; }
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .page-head { flex-direction: column; align-items: flex-start; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .g-2, .g-3, .g-4 { grid-template-columns: 1fr; }
  .span-2, .span-3, .span-4 { grid-column: auto; }
  .hero-panel { grid-template-columns: 1fr; }
  .health-ring { justify-content: flex-start; }
  .d-grid { grid-template-columns: 1fr; }
  .d-row.full, .d-value.full { grid-column: auto; }
  .check-list { grid-template-columns: 1fr; }
  .form-grid .col-6, .form-grid .col-4, .form-grid .col-3 { grid-column: span 12; }
}
@media (max-width: 640px) {
  .cards-grid, .stat-grid, .kanban { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 21px; }
  .top-actions .live-pill { display: none; }
  .user-chip div { display: none; }
  .modal-overlay { padding: 12px; }
  .modal { max-height: 94vh; }
  .auth-form-side { padding: 24px; }
  .hero-copy h2 { font-size: 20px; }
  .ms-agent-grid { grid-template-columns: repeat(2, 1fr); }
  .ms-stats { grid-template-columns: repeat(2, 1fr) !important; }
}
