:root {
  color-scheme: light;
  font-family: Inter, "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
  font-synthesis: none;
  --navy: #111c2f;
  --navy-deep: #0d1728;
  --primary: #2872eb;
  --primary-dark: #1e5fce;
  --canvas: #f3f6fa;
  --surface: #ffffff;
  --ink: #17233b;
  --text: #44536b;
  --muted: #7d8ba0;
  --line: #dde5ef;
  --line-soft: #e9eef5;
  --green: #0ca663;
  --orange: #f28a14;
  --red: #ef414b;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; color: var(--ink); background: var(--canvas); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
code { font-family: "Cascadia Mono", Consolas, monospace; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ui-icon, .button-icon, .status-icon { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ui-icon { width: 20px; height: 20px; }
.button-icon { width: 16px; height: 16px; }
.status-icon { width: 16px; height: 16px; }

/* Application shell */
.app-shell { min-height: 100vh; min-width: 980px; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 30;
  width: 188px; padding: 0 0 18px;
  display: flex; flex-direction: column;
  color: #9caac0;
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%);
  box-shadow: 4px 0 22px rgba(15, 27, 46, .08);
}
.sidebar-brand {
  height: 94px; padding: 0 21px;
  display: flex; align-items: center; gap: 11px;
  color: #fff; border-bottom: 1px solid rgba(255,255,255,.055);
}
.brand-logo { width: 36px; height: 28px; flex: 0 0 auto; fill: #fff; }
.sidebar-brand strong { display: block; font-size: 16px; line-height: 1.15; letter-spacing: -.2px; }
.sidebar-brand span { display: block; margin-top: 4px; color: #d7dfec; font-size: 13px; font-weight: 600; }
.sidebar nav { padding: 0; margin-top: 0; }
.sidebar nav a {
  position: relative; height: 56px; padding: 0 23px;
  display: flex; align-items: center; gap: 15px;
  color: #aeb9cb; font-size: 14px; font-weight: 500;
  transition: color .16s ease, background .16s ease;
}
.sidebar nav a:hover { color: #fff; background: rgba(60, 119, 214, .12); }
.sidebar nav a.active { color: #fff; background: linear-gradient(90deg, rgba(42,113,231,.54), rgba(42,113,231,.22)); }
.sidebar nav a.active::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: #3180ff; }
.sidebar nav .ui-icon { width: 21px; height: 21px; flex: 0 0 auto; }
.sidebar-footer { margin-top: auto; padding: 18px 21px 0; border-top: 1px solid rgba(255,255,255,.07); }
.sidebar-footer > span { display: flex; align-items: center; gap: 8px; color: #8593a9; font-size: 12px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #21c779; box-shadow: 0 0 0 3px rgba(33,199,121,.1); }
.sidebar-footer form { margin-top: 15px; }
.sidebar-footer button { padding: 0; display: inline-flex; align-items: center; gap: 8px; color: #9eabbd; border: 0; background: none; cursor: pointer; font-size: 13px; }
.sidebar-footer button:hover { color: #fff; }

.main-content { min-height: 100vh; margin-left: 188px; display: flex; flex-direction: column; }
.topbar {
  height: 94px; padding: 0 34px 0 40px;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line);
}
.breadcrumb { display: flex; align-items: center; gap: 5px; color: #8a97a9; font-size: 13px; line-height: 1; }
.breadcrumb .ui-icon { width: 13px; height: 13px; }
.topbar h2 { margin: 8px 0 0; color: #101d34; font-size: 27px; line-height: 1; letter-spacing: -.7px; }
.top-actions { display: flex; align-items: center; gap: 12px; color: #27364d; font-size: 14px; font-weight: 600; }
.icon-button { position: relative; width: 40px; height: 40px; margin-right: 12px; display: grid; place-items: center; color: #6d7b90; border: 0; border-radius: 9px; background: transparent; cursor: pointer; }
.icon-button:hover { background: #f2f5f9; }
.notification i { position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; border: 2px solid #fff; border-radius: 50%; background: var(--red); }
.admin-avatar { width: 40px; height: 40px; display: grid; place-items: center; color: #fff; border-radius: 50%; background: linear-gradient(145deg, #347ff3, #2467df); font-size: 15px; font-weight: 600; box-shadow: 0 5px 14px rgba(37,105,225,.2); }
.account-chevron { width: 14px; height: 14px; margin-left: -4px; transform: rotate(90deg); color: #8090a5; }
.admin-menu { position: relative; }
.admin-menu-trigger { padding: 0; display: flex; align-items: center; gap: 12px; color: #27364d; border: 0; background: transparent; cursor: pointer; font-size: 14px; font-weight: 600; }
.admin-menu-trigger[aria-expanded="true"] .account-chevron { transform: rotate(-90deg); }
.admin-dropdown { position: absolute; z-index: 80; top: calc(100% + 13px); right: 0; width: 220px; padding: 8px; display: none; background: #fff; border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 14px 38px rgba(18,35,61,.16); }
.admin-dropdown.open { display: block; }
.admin-dropdown-user { margin: -8px -8px 7px; padding: 14px 15px; display: flex; align-items: center; gap: 11px; border-bottom: 1px solid var(--line-soft); }
.admin-avatar.small { width: 34px; height: 34px; font-size: 13px; }
.admin-dropdown-user strong, .admin-dropdown-user small { display: block; }
.admin-dropdown-user strong { color: #26364e; font-size: 13px; }
.admin-dropdown-user small { margin-top: 3px; color: #8a97a9; font-size: 11px; font-weight: 400; }
.admin-dropdown > a, .admin-dropdown > form button { width: 100%; min-height: 39px; padding: 0 11px; display: flex; align-items: center; gap: 10px; color: #4e5f77; border: 0; border-radius: 6px; background: transparent; cursor: pointer; font-size: 13px; text-align: left; }
.admin-dropdown > a:hover, .admin-dropdown > form button:hover { color: var(--primary); background: #f2f6fc; }
.admin-dropdown > form { margin: 0; }
.admin-dropdown > form button { color: #cf3b46; }
.page-section { flex: 1; padding: 20px 20px 18px; }

/* Dashboard */
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric-card {
  min-height: 142px; padding: 21px 22px;
  display: flex; align-items: flex-start; gap: 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 3px 12px rgba(27, 48, 78, .025);
}
.metric-icon { width: 58px; height: 58px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; }
.metric-icon .ui-icon { width: 29px; height: 29px; stroke-width: 2; }
.metric-card p { margin: 4px 0 10px; color: #627187; font-size: 14px; }
.metric-card strong { display: block; color: #131f36; font-size: 31px; line-height: 1; letter-spacing: -.5px; }
.metric-card small { margin-top: 15px; display: flex; align-items: center; gap: 7px; color: #728198; font-size: 12px; white-space: nowrap; }
.accent-blue .metric-icon { color: #2974ed; background: #e8f1ff; }
.accent-green .metric-icon { color: #08a45f; background: #e5f7ed; }
.accent-orange .metric-icon { color: #ee8812; background: #fff0dc; }
.accent-red .metric-icon { color: #e8414a; background: #ffe7e9; }
.trend-dot { width: 7px; height: 7px; border-radius: 50%; }
.trend-dot.green { background: var(--green); }
.trend-dot.red { background: var(--red); }

.panel { background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 3px 12px rgba(27,48,78,.025); }
.dashboard-table { margin-top: 18px; min-height: 510px; overflow: hidden; }
.panel-heading { min-height: 62px; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line-soft); }
.panel-heading h3 { margin: 0; color: #17233b; font-size: 16px; }
.view-all { display: inline-flex; align-items: center; gap: 2px; color: var(--primary); font-size: 13px; }
.view-all .ui-icon { width: 14px; height: 14px; }
.view-all:hover { color: var(--primary-dark); }
.table-scroll { width: 100%; overflow: auto; scrollbar-width: thin; scrollbar-color: #c8d2df transparent; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { height: 42px; padding: 0 20px; color: #738197; background: #f7f9fc; border-bottom: 1px solid var(--line-soft); font-size: 12px; font-weight: 500; white-space: nowrap; }
td { height: 47px; padding: 8px 20px; color: #405069; border-bottom: 1px solid #e8edf4; font-size: 13px; }
tbody tr { transition: background .13s ease; }
tbody tr:hover { background: #f8faff; }
tbody tr:last-child td { border-bottom: 0; }
.dashboard-table th:nth-child(2), .dashboard-table td:nth-child(2) { width: 31%; }
.dashboard-table th:last-child, .dashboard-table td:last-child { text-align: right; }
.online-pill { display: inline-flex; align-items: center; color: #238055; font-size: 12px; white-space: nowrap; }
.online-pill i { width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: var(--green); }
.dashboard-license-key { color: #53647d; font-size: 12px; font-weight: 500; white-space: nowrap; user-select: all; }
.table-footer { min-height: 50px; padding: 0 20px; display: flex; align-items: center; color: #8794a7; border-top: 1px solid var(--line-soft); font-size: 12px; }
.empty { height: 180px !important; color: #95a1b2; text-align: center !important; }
.service-strip { min-height: 48px; margin-top: 18px; padding: 0 14px; display: flex; align-items: center; justify-content: space-between; color: #76859a; background: #fff; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; }
.service-strip > div { display: flex; align-items: center; gap: 22px; }
.service-strip span { display: flex; align-items: center; gap: 7px; }
.service-primary { color: #159157; font-weight: 600; }
.health-dot { width: 10px; height: 10px; border: 2px solid #fff; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px var(--red); }
.health-dot.ok { background: var(--green); box-shadow: 0 0 0 2px var(--green); }

/* List pages */
.section-toolbar { min-height: 48px; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; }
.section-toolbar h3 { margin: 0; color: #18253d; font-size: 16px; }
.section-toolbar p { margin: 5px 0 0; color: #8795a8; font-size: 12px; }
.table-panel { overflow: hidden; }
.table-panel th { height: 45px; }
.table-panel td { height: 52px; }
.button { min-height: 35px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; color: #56667d; border: 1px solid #d6dfeb; border-radius: 6px; background: #fff; cursor: pointer; font-size: 13px; font-weight: 500; transition: all .15s ease; }
.button:hover { color: var(--primary); border-color: #9cbcf3; }
.button.primary { color: #fff; border-color: var(--primary); background: var(--primary); box-shadow: 0 5px 13px rgba(40,114,235,.16); }
.button.primary:hover { border-color: var(--primary-dark); background: var(--primary-dark); }
.link-button { padding: 0; color: #2872df; border: 0; background: none; cursor: pointer; font-size: 13px; }
.link-button:hover { color: #1757c1; }
.danger-text { color: #d83d47; }
.success-text { color: #118654; }
.actions { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.actions form { display: inline-flex; }
.tag { display: inline-flex; align-items: center; min-height: 23px; padding: 2px 9px; color: #66768c; background: #eef2f6; border-radius: 20px; font-size: 12px; white-space: nowrap; }
.tag.success, .tag.success-soft { color: #0f8350; background: #e4f6ec; }
.tag.success { color: #fff; background: #12a464; }
.tag.warning { color: #bf6a10; background: #fff0db; }
.tag.danger { color: #c8343f; background: #fee8ea; }
.tag.outline { color: #526681; background: #fff; border: 1px solid #d4deea; }
.license-key-full { color: #405776; font-size: 12px; font-weight: 500; letter-spacing: .02em; white-space: nowrap; user-select: all; }
.detail-cell { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* License management */
.license-page { display: flex; flex-direction: column; }
.license-management { flex: 1; min-height: 620px; display: flex; flex-direction: column; }
.license-toolbar { min-height: 92px; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line-soft); }
.license-toolbar h3 { margin: 0; color: #17233b; font-size: 18px; letter-spacing: -.2px; }
.license-toolbar p { margin: 7px 0 0; color: #78879c; font-size: 13px; }
.create-license-button { min-width: 142px; min-height: 46px; font-size: 14px; }
.license-management .table-scroll { flex: 1; }
.license-management th { height: 46px; }
.license-management td { height: 58px; }
.license-management th:nth-child(1), .license-management td:nth-child(1) { width: 5%; }
.license-management th:nth-child(2), .license-management td:nth-child(2) { width: 26%; }
.license-management th:nth-child(3), .license-management td:nth-child(3) { width: 9%; }
.license-management th:nth-child(4), .license-management td:nth-child(4) { width: 6%; }
.license-management th:nth-child(5), .license-management td:nth-child(5) { width: 7%; }
.license-management th:nth-child(6), .license-management td:nth-child(6) { width: 9%; }
.license-management th:nth-child(7), .license-management td:nth-child(7) { width: 15%; }
.license-management th:nth-child(8), .license-management td:nth-child(8) { width: 7%; }
.license-management th:last-child, .license-management td:last-child { width: 16%; }
.license-management .license-key-full { color: #536681; }
.status-tag { gap: 7px; }
.status-tag i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.test-tag { color: #d47709; background: #fff0d8; border-radius: 6px; font-weight: 600; }
.license-management .table-footer { margin-top: auto; min-height: 74px; padding-left: 20px; }

/* Online clients */
.client-page { display: flex; flex-direction: column; }
.client-management { flex: 1; min-height: 620px; display: flex; flex-direction: column; }
.client-toolbar { min-height: 92px; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line-soft); }
.client-toolbar h3 { margin: 0; color: #17233b; font-size: 18px; letter-spacing: -.2px; }
.client-toolbar p { margin: 7px 0 0; color: #78879c; font-size: 13px; }
.refresh-clients-button { min-width: 126px; min-height: 42px; color: var(--primary); border-color: #8fb5f5; font-size: 14px; }
.client-management .table-scroll { flex: 1; }
.client-management th { height: 46px; color: #314158; font-size: 13px; font-weight: 600; }
.client-management td { height: 58px; font-size: 13px; white-space: nowrap; }
.client-management th:nth-child(1), .client-management td:nth-child(1) { width: 8%; }
.client-management th:nth-child(2), .client-management td:nth-child(2) { width: 23%; }
.client-management th:nth-child(3), .client-management td:nth-child(3) { width: 13%; }
.client-management th:nth-child(4), .client-management td:nth-child(4) { width: 9%; }
.client-management th:nth-child(5), .client-management td:nth-child(5) { width: 14%; }
.client-management th:nth-child(6), .client-management td:nth-child(6) { width: 14%; }
.client-management th:nth-child(7), .client-management td:nth-child(7) { width: 7%; }
.client-management th:last-child, .client-management td:last-child { width: 12%; }
.client-management tbody tr:nth-child(2) { background: #f5f9ff; }
.client-online { min-height: 28px; padding: 0 11px; color: #14945b; background: #e5f8ef; border-radius: 16px; font-weight: 600; }
.client-online i { margin-right: 7px; box-shadow: 0 0 0 4px rgba(12,166,99,.08); }
.client-license-key { color: #536681; font-size: 12px; font-weight: 500; letter-spacing: .01em; user-select: all; }
.client-machine { color: #30425d; font-size: 12px; }
.window-count { color: #263a58; font-weight: 600; }
.refresh-window-link { font-size: 13px; font-weight: 500; }
.client-management .table-footer { margin-top: auto; min-height: 70px; color: #536681; font-size: 13px; }
.client-card-list { flex: 1; padding: 16px; overflow: auto; background: #f7f9fc; }
.client-empty { display: grid; place-items: center; min-height: 380px; }
.client-control-card { margin-bottom: 14px; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 3px 12px rgba(27,48,78,.025); }
.client-card-header { min-height: 66px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line-soft); }
.client-identity, .client-global-actions, .window-actions { display: flex; align-items: center; gap: 9px; }
.client-global-actions form, .window-actions form { display: inline-flex; }
.client-global-actions .button { min-height: 33px; padding-inline: 11px; font-size: 12px; }
.client-meta { min-height: 42px; padding: 0 16px; display: flex; align-items: center; gap: 24px; color: #7b899c; background: #fafbfd; border-bottom: 1px solid var(--line-soft); font-size: 11px; }
.client-meta code { color: #536681; }
.window-grid { padding: 7px 16px 12px; }
.window-control-row { min-height: 54px; display: grid; grid-template-columns: 190px minmax(150px,1fr) auto; align-items: center; gap: 16px; border-bottom: 1px solid var(--line-soft); }
.window-control-row:last-child { border-bottom: 0; }
.window-slot { display: flex; align-items: center; gap: 10px; }
.window-slot strong { color: #293b56; font-size: 13px; }
.window-status { min-height: 23px; padding: 0 8px; display: inline-flex; align-items: center; color: #65758b; background: #eef2f6; border-radius: 12px; font-size: 10px; font-weight: 700; }
.window-status-running { color: #118654; background: #e3f6ec; }
.window-status-hit { color: #b96d0c; background: #fff0db; }
.window-status-starting, .window-status-initializing { color: #2768bd; background: #e8f1ff; }
.window-status-error { color: #bd3944; background: #fdebed; }
.window-readiness { display: flex; align-items: center; gap: 7px; overflow: hidden; color: #8491a4; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.readiness-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: #aeb8c5; }
.readiness-dot.ready { background: var(--green); box-shadow: 0 0 0 3px rgba(12,166,99,.1); }
.mini-action { min-height: 29px; padding: 0 9px; color: #53647d; border: 1px solid #d7e0eb; border-radius: 5px; background: #fff; cursor: pointer; font-size: 11px; }
.mini-action:hover { color: var(--primary); border-color: #9cbcf3; background: #f7faff; }
.mini-action.start { color: #fff; border-color: var(--primary); background: var(--primary); }
.mini-action.danger-text { color: #cf3b46; }

/* Audit log */
.audit-page { display: flex; flex-direction: column; }
.audit-management { flex: 1; min-height: 620px; display: flex; flex-direction: column; }
.audit-toolbar { min-height: 92px; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line-soft); }
.audit-toolbar h3 { margin: 0; color: #17233b; font-size: 18px; letter-spacing: -.2px; }
.audit-toolbar p { margin: 7px 0 0; color: #78879c; font-size: 13px; }
.refresh-audit-button { min-width: 126px; min-height: 42px; color: var(--primary); border-color: #8fb5f5; font-size: 14px; }
.audit-management .table-scroll { flex: 1; }
.audit-management th { height: 46px; color: #314158; font-size: 13px; font-weight: 600; }
.audit-management td { height: 58px; font-size: 13px; white-space: nowrap; }
.audit-management th:nth-child(1), .audit-management td:nth-child(1) { width: 7%; }
.audit-management th:nth-child(2), .audit-management td:nth-child(2) { width: 15%; }
.audit-management th:nth-child(3), .audit-management td:nth-child(3) { width: 10%; }
.audit-management th:nth-child(4), .audit-management td:nth-child(4) { width: 14%; }
.audit-management th:nth-child(5), .audit-management td:nth-child(5) { width: 36%; }
.audit-management th:last-child, .audit-management td:last-child { width: 18%; }
.audit-management tbody tr:nth-child(2) { background: #f5f9ff; }
.audit-tag { min-height: 28px; padding: 0 11px; display: inline-flex; align-items: center; border-radius: 16px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.audit-green { color: #128552; background: #dcf4e8; }
.audit-blue { color: #1872d4; background: #dfeeff; }
.audit-orange { color: #d8750b; background: #fff0dc; }
.audit-red { color: #d43d49; background: #fee5e8; }
.audit-amber { color: #c8750d; background: #fff0da; }
.audit-teal { color: #07878b; background: #dff5f4; }
.audit-purple { color: #7850c7; background: #ede5ff; }
.audit-slate { color: #496784; background: #e8eef5; }
.audit-detail { max-width: 480px; overflow: hidden; color: #405069; text-overflow: ellipsis; }
.audit-management .table-footer { margin-top: auto; min-height: 70px; color: #536681; font-size: 13px; }
.task-result-management { flex: 1; min-height: 620px; display: flex; flex-direction: column; }
.task-result-toolbar { min-height: 92px; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line-soft); }
.task-result-toolbar h3 { margin: 0; color: #17233b; font-size: 18px; letter-spacing: -.2px; }
.task-result-toolbar p { margin: 7px 0 0; color: #78879c; font-size: 13px; }
.task-toolbar-actions { display: flex; align-items: center; gap: 9px; }
.task-safety-note { margin: 14px 20px 0; padding: 12px 14px; display: flex; gap: 12px; align-items: center; color: #48627f; background: #f0f6ff; border: 1px solid #d8e7fb; border-radius: 7px; font-size: 12px; }
.task-safety-note strong { color: #245ca8; white-space: nowrap; }
.task-result-management .table-scroll { flex: 1; margin-top: 14px; }
.task-result-management table { min-width: 1120px; }
.task-result-management th { color: #314158; font-size: 12px; font-weight: 600; }
.task-result-management td { height: 60px; font-size: 12px; white-space: nowrap; }
.task-result-management .table-footer { margin-top: auto; min-height: 70px; color: #536681; font-size: 13px; }
.task-actions { display: flex; align-items: center; gap: 10px; }
.task-actions form { display: inline-flex; }
.watch-task-modal { width: 560px; border-radius: 12px; }
.watch-task-modal .modal-body { padding: 4px 24px 24px; }
.watch-task-modal header p { margin: 5px 0 0; color: #8491a4; font-size: 12px; }
.task-execution-id { display: block; margin-top: 4px; color: #91a0b3; font-weight: 400; }
.task-type { color: #3d5d86; font-weight: 600; }
.task-status { min-height: 26px; padding: 0 9px; display: inline-flex; align-items: center; border-radius: 14px; color: #627188; background: #edf1f5; font-size: 11px; font-weight: 700; }
.task-status-completed { color: #168554; background: #e4f6ec; }
.task-status-failed { color: #bd3944; background: #fdebed; }
.task-status-running, .task-status-dispatched, .task-status-acked { color: #2768bd; background: #e8f1ff; }
.task-status-pending { color: #a76b11; background: #fff3dc; }
.task-balance { color: #213c61; }
.mnemonic-hidden { color: #7c5b20; }
.task-fingerprint { color: #536d91; letter-spacing: .4px; user-select: all; }

/* Feedback and overlays */
.toast { position: fixed; z-index: 90; top: 106px; right: 24px; min-width: 280px; padding: 12px 16px; border: 1px solid; border-radius: 7px; box-shadow: 0 12px 32px rgba(29,43,65,.14); font-size: 13px; transition: opacity .3s, transform .3s; }
.toast.success { color: #12633f; background: #edfaf4; border-color: #b9e8d2; }
.toast.error { color: #a52835; background: #fff0f1; border-color: #f3c4ca; }
.toast.hide { opacity: 0; transform: translateY(-8px); pointer-events: none; }
.modal { width: 520px; max-width: calc(100vw - 30px); padding: 0; border: 0; border-radius: 9px; box-shadow: 0 25px 80px rgba(14,27,48,.32); }
.modal::backdrop { background: rgba(11,20,35,.58); }
.modal header, .drawer header { height: 62px; padding: 0 22px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line-soft); }
.modal h3, .drawer h3 { margin: 0; color: #17233b; font-size: 16px; }
.modal header button, .drawer header a { padding: 4px; color: #7f8da0; border: 0; background: none; cursor: pointer; font-size: 24px; }
.modal-body { padding: 9px 22px 24px; }
.modal label { display: block; margin-top: 14px; color: #526178; font-size: 13px; }
.modal input, .modal select { width: 100%; height: 42px; margin-top: 7px; padding: 0 11px; color: #34445d; border: 1px solid #d4deea; border-radius: 6px; outline: none; background: #fff; }
.modal input:focus, .modal select:focus { border-color: #5790ed; box-shadow: 0 0 0 3px rgba(40,114,235,.1); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.modal .check { display: flex; align-items: center; gap: 8px; }
.modal .check input { width: 16px; height: 16px; margin: 0; }
.modal footer { padding: 14px 22px; display: flex; justify-content: flex-end; gap: 9px; border-top: 1px solid var(--line-soft); }
.warning-box { margin-top: 13px; padding: 11px 13px; color: #98570f; background: #fff5e7; border: 1px solid #f0d3aa; border-radius: 6px; font-size: 13px; }
.created-key { margin-top: 16px; padding: 15px; display: flex; align-items: center; justify-content: space-between; gap: 14px; background: #f4f7fb; border: 1px dashed #a9b7c9; border-radius: 7px; }
.created-key code { color: #244b8f; font-size: 14px; font-weight: 700; word-break: break-all; }

/* License form and confirmation dialogs */
.license-form-modal { width: 600px; border-radius: 12px; }
.license-modal-header { min-height: 82px !important; padding: 0 25px !important; }
.modal-heading { display: flex; align-items: center; gap: 13px; }
.modal-heading-icon { width: 40px; height: 40px; display: grid; place-items: center; color: var(--primary); background: #e9f2ff; border-radius: 9px; }
.modal-heading-icon .ui-icon { width: 20px; height: 20px; }
.license-modal-header h3 { font-size: 17px; }
.license-modal-header p { margin: 5px 0 0; color: #8290a3; font-size: 12px; }
.license-modal-body { padding: 9px 25px 24px; }
.modal .license-field { margin-top: 18px; }
.license-field > span { display: block; color: #3e4e66; font-size: 13px; font-weight: 600; }
.license-field > small { display: block; margin-top: 4px; color: #929daf; font-size: 11px; }
.modal .license-field input, .modal .license-field select { height: 44px; margin-top: 8px; }
.license-number-row { gap: 16px; }
.modal .license-check { min-height: 64px; margin-top: 19px; padding: 12px 14px; gap: 11px; background: #f7f9fc; border: 1px solid #e1e7f0; border-radius: 8px; cursor: pointer; }
.modal .license-check input { flex: 0 0 auto; }
.license-check span { display: block; }
.license-check strong { display: block; color: #3e4e66; font-size: 13px; }
.license-check small { display: block; margin-top: 4px; color: #8a97a9; font-size: 11px; }
.license-modal-footer { min-height: 68px; padding: 0 25px !important; align-items: center; }
.license-modal-footer .button { min-width: 96px; min-height: 39px; }
.created-key-modal { width: 540px; border-radius: 12px; }
.created-key-modal > div > header { height: 48px; border-bottom: 0; }
.created-key-body { padding: 0 28px 28px; text-align: center; }
.created-success-icon { width: 58px; height: 58px; margin: 0 auto 16px; display: grid; place-items: center; color: #fff; background: var(--green); border-radius: 50%; box-shadow: 0 8px 22px rgba(12,166,99,.2); }
.created-success-icon .ui-icon { width: 29px; height: 29px; stroke-width: 2.2; }
.created-key-body h3 { margin: 0; font-size: 20px; }
.created-key-body > p { margin: 9px 0 20px; color: #7c899c; font-size: 13px; }
.created-key-modal .created-key { margin-top: 0; text-align: left; }
.created-key-modal footer { min-height: 66px; padding: 0 25px; align-items: center; }
.created-key-modal footer .button { min-width: 90px; }
.confirm-modal { width: 440px; border-radius: 12px; }
.confirm-modal-body { padding: 32px 30px 25px; text-align: center; }
.confirm-warning-icon { width: 54px; height: 54px; margin: 0 auto 17px; display: grid; place-items: center; color: #d48917; background: #fff1d8; border-radius: 50%; font-size: 25px; font-weight: 700; }
.confirm-modal-body h3 { margin: 0; color: #17233b; font-size: 19px; }
.confirm-modal-body p { margin: 11px 0 0; color: #6f7e93; font-size: 13px; line-height: 1.7; }
.confirm-modal footer { min-height: 68px; padding: 0 24px; align-items: center; justify-content: center; }
.confirm-modal footer .button { min-width: 110px; min-height: 40px; }
.danger-button { color: #fff; border-color: #df424d; background: #df424d; box-shadow: 0 5px 13px rgba(223,66,77,.15); }
.danger-button:hover { color: #fff; border-color: #c9343f; background: #c9343f; }
.drawer-backdrop { position: fixed; z-index: 60; inset: 0; background: rgba(11,20,35,.5); }
.drawer { position: fixed; z-index: 70; inset: 0 0 0 auto; width: 620px; max-width: 90vw; background: #fff; box-shadow: -20px 0 60px rgba(14,27,48,.22); }
.drawer-body { padding: 18px; overflow: auto; }
.drawer table { min-width: 560px; }

/* Device bindings drawer */
.binding-drawer { width: 780px; display: flex; flex-direction: column; }
.binding-drawer-header { min-height: 86px !important; padding: 0 28px !important; flex: 0 0 auto; }
.binding-drawer-header h3 { color: #17233b; font-size: 19px; letter-spacing: -.2px; }
.binding-drawer-header p { margin: 7px 0 0; color: #7c899c; font-size: 13px; }
.binding-drawer-header > a { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 7px; font-size: 26px !important; line-height: 1; }
.binding-drawer-header > a:hover { color: #253b5b; background: #f1f5fa; }
.binding-drawer-body { flex: 1; padding: 22px 24px; background: #f4f7fb; }
.binding-license-summary { min-height: 98px; padding: 20px 22px; display: flex; align-items: center; justify-content: space-between; gap: 24px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 3px 12px rgba(27,48,78,.025); }
.binding-key-block { min-width: 0; }
.binding-key-block span, .binding-quota span { display: block; margin-bottom: 9px; color: #8491a4; font-size: 12px; }
.binding-key-block code { display: block; overflow: hidden; color: #405b81; font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; user-select: all; }
.binding-quota { flex: 0 0 auto; min-width: 100px; padding-left: 24px; border-left: 1px solid var(--line-soft); }
.binding-quota strong { color: #17233b; font-size: 20px; }
.binding-list-panel { margin-top: 18px; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 3px 12px rgba(27,48,78,.025); }
.binding-list-heading { min-height: 72px; padding: 0 20px; display: flex; align-items: center; border-bottom: 1px solid var(--line-soft); }
.binding-list-heading h4 { margin: 0; color: #17233b; font-size: 15px; }
.binding-list-heading p { margin: 6px 0 0; color: #8794a7; font-size: 12px; }
.binding-list-panel table { min-width: 700px; }
.binding-list-panel th { height: 44px; padding: 0 14px; color: #53647d; font-size: 12px; font-weight: 600; }
.binding-list-panel td { height: 55px; padding: 8px 14px; font-size: 12px; white-space: nowrap; }
.binding-list-panel th:nth-child(1), .binding-list-panel td:nth-child(1) { width: 20%; }
.binding-list-panel th:nth-child(2), .binding-list-panel td:nth-child(2) { width: 23%; }
.binding-list-panel th:nth-child(3), .binding-list-panel td:nth-child(3) { width: 23%; }
.binding-list-panel th:nth-child(4), .binding-list-panel td:nth-child(4) { width: 14%; }
.binding-list-panel th:last-child, .binding-list-panel td:last-child { width: 20%; text-align: right; }
.binding-machine { color: #405b81; font-size: 12px; }
.binding-status { min-height: 25px; padding: 0 9px; display: inline-flex; align-items: center; gap: 7px; border-radius: 14px; font-size: 12px; font-weight: 600; }
.binding-status i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.binding-status.active { color: #168554; background: #e4f6ec; }
.binding-status.revoked { color: #7d899b; background: #eef2f6; }
.binding-no-action { color: #9ba6b5; }
.binding-notice { margin-top: 18px; padding: 13px 15px; display: flex; align-items: flex-start; gap: 10px; color: #7c6642; background: #fff8ec; border: 1px solid #f0debd; border-radius: 7px; }
.binding-notice > span { width: 20px; height: 20px; flex: 0 0 auto; display: grid; place-items: center; color: #fff; background: #e3a13d; border-radius: 50%; font-size: 12px; font-weight: 700; }
.binding-notice p { margin: 1px 0 0; font-size: 12px; line-height: 1.55; }
.binding-drawer-footer { min-height: 70px; padding: 0 24px; display: flex; align-items: center; justify-content: flex-end; flex: 0 0 auto; background: #fff; border-top: 1px solid var(--line-soft); }
.binding-drawer-footer .button { min-width: 86px; }

/* Login */
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(430px, 1fr) minmax(430px, .78fr); background: #f4f7fa; }
.login-brand-panel { position: relative; overflow: hidden; padding: 70px; display: flex; flex-direction: column; justify-content: center; color: #fff; background: linear-gradient(150deg, #121f35 0%, #172b4a 60%, #1c3964 100%); }
.login-brand-panel::after { content: ""; position: absolute; left: 12%; width: 390px; height: 390px; border: 1px solid rgba(92,151,239,.16); border-radius: 50%; box-shadow: 0 0 0 66px rgba(69,131,226,.05), 0 0 0 138px rgba(69,131,226,.025); }
.login-brand-mark { z-index: 1; width: 62px; height: 62px; display: grid; place-items: center; color: #1a5fcd; background: #fff; border-radius: 13px; box-shadow: 0 18px 42px rgba(0,0,0,.22); font-size: 32px; font-weight: 900; }
.login-brand-panel h2 { z-index: 1; margin: 25px 0 9px; font-size: 30px; letter-spacing: -.5px; }
.login-brand-panel p { z-index: 1; margin: 0; color: #b9c7da; font-size: 14px; }
.login-card { align-self: center; justify-self: center; width: min(390px, calc(100vw - 36px)); padding: 39px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 22px 65px rgba(24,42,69,.11); }
.brand-mark { width: 46px; height: 46px; display: grid; place-items: center; color: var(--primary); background: #eaf2ff; border-radius: 9px; }
.brand-mark svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.eyebrow { margin: 22px 0 7px; color: var(--primary); font-size: 12px; font-weight: 700; }
.login-card h1 { margin: 0 0 7px; color: #17233b; font-size: 26px; }
.login-subtitle { margin: 0 0 23px; color: #8a97a9; font-size: 13px; }
.login-card label { display: block; margin-top: 13px; color: #536178; font-size: 13px; }
.login-card input { width: 100%; height: 43px; margin-top: 7px; padding: 0 12px; color: #35445c; border: 1px solid #d4deea; border-radius: 6px; outline: none; }
.login-card input:focus { border-color: #5790ed; box-shadow: 0 0 0 3px rgba(40,114,235,.1); }
.login-button { width: 100%; height: 44px; margin-top: 19px; }
.security-note { margin: 16px 0 0; color: #9ba6b5; font-size: 12px; text-align: center; }
.form-error { padding: 10px 12px; color: #b02a35; background: #fff0f1; border: 1px solid #f2c6cb; border-radius: 6px; font-size: 12px; }
.login-notice { margin-bottom: 12px; padding: 10px 12px; color: #12633f; background: #edfaf4; border: 1px solid #b9e8d2; border-radius: 6px; font-size: 12px; }

/* Account password */
.account-page { display: grid; place-items: start center; padding-top: 32px; }
.password-panel { width: 620px; max-width: 100%; overflow: hidden; }
.password-panel-header { min-height: 92px; padding: 0 26px; display: flex; align-items: center; gap: 14px; border-bottom: 1px solid var(--line-soft); }
.password-icon { width: 44px; height: 44px; display: grid; place-items: center; color: var(--primary); background: #e9f2ff; border-radius: 10px; }
.password-panel-header h3 { margin: 0; color: #17233b; font-size: 18px; }
.password-panel-header p { margin: 6px 0 0; color: #8491a4; font-size: 12px; }
.password-form { padding: 8px 26px 25px; }
.password-form label { display: block; margin-top: 19px; }
.password-form label > span { display: block; color: #3e4e66; font-size: 13px; font-weight: 600; }
.password-form label > small { display: block; margin-top: 5px; color: #929daf; font-size: 11px; }
.password-form input { width: 100%; height: 44px; margin-top: 9px; padding: 0 12px; color: #34445d; border: 1px solid #d4deea; border-radius: 6px; outline: none; }
.password-form input:focus { border-color: #5790ed; box-shadow: 0 0 0 3px rgba(40,114,235,.1); }
.password-security-note { margin-top: 21px; padding: 13px 15px; display: flex; align-items: flex-start; gap: 10px; color: #765f3c; background: #fff8ec; border: 1px solid #f0debd; border-radius: 7px; }
.password-security-note > span { width: 20px; height: 20px; flex: 0 0 auto; display: grid; place-items: center; color: #fff; background: #dfa03f; border-radius: 50%; font-size: 12px; font-weight: 700; }
.password-security-note p { margin: 1px 0 0; font-size: 12px; line-height: 1.55; }
.password-actions { margin: 25px -26px -25px; padding: 15px 26px; display: flex; justify-content: flex-end; gap: 9px; border-top: 1px solid var(--line-soft); }
.password-actions .button { min-width: 100px; min-height: 40px; }

/* Client updates */
.update-page { display: flex; flex-direction: column; }
.update-grid { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 16px; }
.release-list-panel, .force-update-panel { overflow: hidden; }
.update-panel-heading { min-height: 92px; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line-soft); }
.update-panel-heading h3 { margin: 0; color: #17233b; font-size: 17px; }
.update-panel-heading p { margin: 6px 0 0; color: #8794a7; font-size: 12px; line-height: 1.5; }
.release-list-panel table { min-width: 760px; }
.release-list-panel th, .release-list-panel td { padding-inline: 16px; }
.release-list-panel td form { display: inline-flex; }
.force-update-panel > form { padding: 5px 20px 22px; }
.force-update-panel select { width: 100%; height: 44px; margin-top: 9px; padding: 0 34px 0 12px; color: #34445d; background: #fff; border: 1px solid #d4deea; border-radius: 6px; outline: none; }
.force-update-panel select:focus { border-color: #5790ed; box-shadow: 0 0 0 3px rgba(40,114,235,.1); }
.update-warning { margin-top: 18px; padding: 13px 14px; color: #765f3c; background: #fff8ec; border: 1px solid #f0debd; border-radius: 7px; }
.update-warning strong { font-size: 12px; }
.update-warning p { margin: 5px 0 0; font-size: 12px; line-height: 1.6; }
.force-update-button { width: 100%; margin-top: 18px; }
.publish-release-modal { width: 590px; border-radius: 12px; }
.publish-release-modal .modal-body { padding: 4px 24px 24px; }
.publish-release-modal input[type=file] { width: 100%; height: auto; margin-top: 9px; padding: 10px; color: #56657a; background: #f8fafc; border: 1px solid #d4deea; border-radius: 6px; }

/* Service unavailable */
.unavailable-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.unavailable-card { width: 450px; max-width: 100%; padding: 40px; text-align: center; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 20px 60px rgba(24,42,69,.12); }
.unavailable-card .brand-mark { margin: auto; }
.unavailable-card h1 { margin: 21px 0 9px; }
.unavailable-card p { margin: 0 0 22px; color: var(--muted); }
.unavailable-card form { display: inline; margin-left: 8px; }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(40,114,235,.26); outline-offset: 2px; }
.input-suffix { position: relative; }
.input-suffix input { width: 100%; padding-right: 42px !important; }
.input-suffix > span { position: absolute; right: 13px; top: 50%; color: #8491a4; font-size: 13px; font-weight: 600; transform: translateY(-50%); pointer-events: none; }

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .update-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app-shell { min-width: 0; }
  .sidebar { width: 72px; }
  .sidebar-brand { justify-content: center; padding: 0; }
  .sidebar-brand > div, .sidebar nav a span, .sidebar-footer > span, .sidebar-footer button span { display: none; }
  .sidebar nav a { justify-content: center; padding: 0; }
  .sidebar-footer { padding-inline: 0; text-align: center; }
  .sidebar-footer button { margin: auto; }
  .main-content { margin-left: 72px; }
  .topbar { padding-inline: 22px; }
}
@media (max-width: 620px) {
  .top-actions > span, .account-chevron, .breadcrumb { display: none; }
  .topbar { height: 74px; }
  .topbar h2 { margin: 0; font-size: 22px; }
  .page-section { padding: 14px; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 124px; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .service-strip { align-items: flex-start; flex-direction: column; gap: 10px; padding-block: 12px; }
  .drawer { max-width: calc(100vw - 34px); }
}
