:root {
  font-family: 'Segoe UI', 'Microsoft YaHei UI', 'PingFang SC', sans-serif;
  color: #162534;
  background: #f2f5f8;
  font-size: 16px;
  font-synthesis: none;
  --ink: #162534;
  --muted: #536576;
  --line: #dce5ec;
  --panel: #ffffff;
  --sidebar: #101f2e;
  --teal: #086c63;
  --mint: #8ce8d1;
  --light-teal: #e5f6f1;
  --danger: #a52c36;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: var(--teal); }
button:disabled { opacity: .65; cursor: wait; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #02a387; outline-offset: 3px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.8rem, 3.3vw, 2.52rem); line-height: 1.24; letter-spacing: -.055em; }
h2 { font-size: 1.18rem; letter-spacing: -.03em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

.layout { display: grid; grid-template-columns: 231px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--sidebar); color: #f2f7fc; padding: 32px 18px 20px; display: flex; flex-direction: column; gap: 36px; position: sticky; top: 0; height: 100vh; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; color: inherit; font-size: 1.125rem; font-weight: 750; letter-spacing: -.04em; }
.sidebar .brand { align-self: flex-start; margin-left: 9px; }
.brand-mark { width: 32px; height: 32px; background: var(--mint); border-radius: 9px; display: inline-grid; place-items: center; color: #152f32; flex: 0 0 auto; }
.brand-mark::before { content: ''; width: 0; height: 0; border-top: 6px solid transparent; border-bottom: 6px solid transparent; border-left: 9px solid currentColor; transform: translateX(1px); }
.nav { display: grid; align-content: start; gap: 4px; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 8px; color: #c0ceda; line-height: 1.15; font-size: .9375rem; text-decoration: none; transition: background .15s ease, color .15s ease; }
.nav-link:hover { background: #1b3044; color: #fff; }
.nav-link[aria-current="page"] { background: #213c4b; color: #b0f4df; font-weight: 700; }
.nav-link.management-start { margin-top: 14px; box-shadow: 0 -9px 0 -8px #2c4353; }

.icon { width: 17px; height: 17px; flex: 0 0 17px; position: relative; color: inherit; display: inline-block; }
.icon::before, .icon::after { content: ''; position: absolute; }
.icon.grid::before { inset: 1px; background: linear-gradient(currentColor 0 0) left top, linear-gradient(currentColor 0 0) right top, linear-gradient(currentColor 0 0) left bottom, linear-gradient(currentColor 0 0) right bottom; background-size: 6px 6px; background-repeat: no-repeat; }
.icon.people::before { width: 8px; height: 8px; left: 5px; top: 0; border: 1.5px solid; border-radius: 50%; }
.icon.people::after { inset: 9px 1px 0; border: 1.5px solid; border-radius: 7px 7px 2px 2px; }
.icon.layers::before { inset: 3px 3px 6px; border: 1.5px solid; transform: rotate(45deg) skew(-11deg, -11deg); }
.icon.layers::after { inset: 8px 4px 2px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg) skew(-11deg, -11deg); }
.icon.device::before { inset: 1px 0 5px; border: 1.5px solid; border-radius: 3px; }
.icon.device::after { left: 4px; right: 4px; bottom: 1px; border-bottom: 1.5px solid; }
.icon.upload::before { inset: 2px 5px 7px; border: solid currentColor; border-width: 1.5px 0 0 1.5px; transform: rotate(45deg); }
.icon.upload::after { inset: 8px 1px 1px; border: solid currentColor; border-width: 0 1.5px 1.5px; border-radius: 0 0 3px 3px; }
.icon.clip::before, .icon.browser::before { inset: 1px 0; border: 1.5px solid; border-radius: 3px; }
.icon.clip::after { top: 5px; left: 7px; border-top: 3.5px solid transparent; border-bottom: 3.5px solid transparent; border-left: 5px solid currentColor; }
.icon.browser::after { left: 2px; right: 2px; top: 5px; border-top: 1.5px solid; }
.icon.list::before { inset: 0 1px; border: 1.5px solid; border-radius: 3px; }
.icon.list::after { inset: 5px 5px; border-block: 1.5px solid; }
.icon.folder::before { inset: 4px 0 1px; border: 1.5px solid; border-radius: 2px; }
.icon.folder::after { inset: 1px 8px 11px 1px; border: 1.5px solid; border-radius: 2px 2px 0 0; }
.icon.rotate::before { inset: 1px; border: 1.5px solid; border-right-color: transparent; border-radius: 50%; }
.icon.rotate::after { top: 1px; right: 1px; width: 5px; height: 5px; border: solid; border-width: 0 1.5px 1.5px 0; }
.icon.plus::before { inset: 8px 2px auto; border-top: 1.5px solid; }
.icon.plus::after { inset: 2px auto 2px 8px; border-left: 1.5px solid; }

.main-shell { display: flex; min-width: 0; flex-direction: column; }
.topbar { background: var(--panel); min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px clamp(18px, 4vw, 46px); border-bottom: 1px solid var(--line); font-size: .9375rem; }
#current-view { font-weight: 700; }
.top-actions, .user-chip, .actions { display: flex; align-items: center; gap: 10px; }
.top-actions, .actions { flex-wrap: wrap; }
.user-chip { padding-left: 10px; border-left: 1px solid var(--line); color: var(--muted); min-width: 0; }
#username { max-width: 10rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { background: #e8f0f7; color: #304d68; border-radius: 50%; display: grid; place-items: center; min-width: 29px; min-height: 29px; font-weight: 750; }
.role-chip { padding: 3px 7px; background: var(--light-teal); color: var(--teal); border-radius: 6px; font-size: .8125rem; font-weight: 650; white-space: nowrap; }
.basic-settings { margin-bottom: 1rem; }
.basic-settings > p { padding: 0 1.25rem .9rem; }
.basic-values { display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; margin: 0; padding: 1.25rem; }
.basic-values dt { color: var(--muted); font-size: .875rem; }
.basic-values dd { margin: .35rem 0 0; font-weight: 700; font-size: 1.125rem; }
.page { margin: 0 auto; width: 100%; max-width: 1550px; padding: clamp(23px, 4.2vw, 52px) clamp(18px, 4vw, 46px) 50px; }
.page-header { display: flex; gap: 16px; align-items: end; justify-content: space-between; margin-bottom: 26px; }
.page-header p { margin-top: 8px; line-height: 1.55; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; border-radius: 8px; border: 1px solid transparent; background: transparent; padding: 8px 13px; white-space: nowrap; color: var(--ink); font-size: .875rem; font-weight: 650; text-decoration: none; }
.button.primary { background: var(--teal); color: #fff; }
.button.primary:hover { background: #055b53; }
.button.secondary { background: #fff; border-color: var(--line); }
.button.secondary:hover { background: #f1f6f7; }
.button.quiet { min-height: 34px; padding: 6px 9px; color: #465a6a; }
.button.quiet:hover { background: #edf3f6; color: var(--ink); }
.button.danger { background: var(--danger); color: #fff; }
.button.danger-text { color: var(--danger); }
.button.danger-text:hover { background: #fbecef; }

.hero { background: #152d3b; color: #fff; border-radius: 17px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, .77fr); gap: 28px; align-items: center; padding: clamp(24px, 3.5vw, 42px); min-height: 231px; overflow: hidden; }
.hero h2 { font-size: clamp(1.56rem, 2.6vw, 2.14rem); margin: 10px 0; }
.hero p { color: #cddce6; max-width: 440px; line-height: 1.55; }
.hero .actions { margin-top: 20px; }
.hero .button.primary { color: #16382f; background: var(--mint); }
.hero .button.primary:hover { background: #b3f1e1; }
.hero .button.secondary { background: transparent; color: #e4eff4; border-color: #688698; }
.hero .button.secondary:hover { background: #254758; }
.device-hero { min-height: 154px; }
.device-hero h2 { margin-top: 0; }
.device-hero .actions { margin-top: 0; justify-content: flex-end; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 18px 0; }
.metric, .panel { border: 1px solid var(--line); background: var(--panel); border-radius: 13px; min-width: 0; }
.metric { display: grid; padding: 17px 18px 15px; min-height: 117px; text-decoration: none; color: var(--ink); }
.metric[href]:hover { border-color: #78bfb3; }
.metric-label { display: flex; align-items: center; gap: 8px; font-size: .875rem; font-weight: 650; }
.metric-label .icon { color: var(--teal); }
.metric strong { display: block; font-size: 1.85rem; line-height: 1.3; font-variant-numeric: tabular-nums; }
.metric .small { color: var(--muted); }
.team-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: -4px; }
.employee-workspace { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.employee-account-panel { grid-column: 1 / -1; }
.employee-daily-panel { margin-bottom: 15px; }
.employee-dashboard-panel .panel-header > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; }
.employee-dashboard-panel .panel-header .count { margin-left: 0; }
.employee-dashboard-panel .empty { min-height: 150px; }
.employee-dashboard-panel .table-scroll { max-height: 290px; border-radius: 0 0 12px 12px; }
.employee-dashboard-panel table { border-collapse: separate; border-spacing: 0; }
.employee-dashboard-panel th, .employee-dashboard-panel td { padding: 9px 12px; }
.employee-dashboard-panel thead th { position: sticky; top: 0; background: #f5f8fa; }
.employee-dashboard-panel td { min-width: 0; }
.employee-dashboard-panel tbody th { color: var(--ink); white-space: normal; min-width: 135px; overflow-wrap: anywhere; }
.employee-dashboard-panel tbody tr + tr th { border-top: 1px solid #e6edf2; }
.employee-dashboard-panel .subline { display: block; margin-top: 3px; color: var(--muted); font-size: .8125rem; font-weight: 400; }
.view-trends { margin: 24px 0 18px; }
.view-trends-header { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 11px; }
.view-trends-header label { display: flex; align-items: center; font-size: .875rem; }
.view-trends-header select { width: auto; }
.trend-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.trend-card { padding: 15px 16px 12px; }
.trend-card h3 { font-size: 1rem; }
.trend-card canvas { display: block; width: 100%; height: 190px; margin-top: 4px; border-radius: 4px; }
.trend-card canvas:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; }
.trend-value { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin: 5px 0 4px; font-size: .875rem; }
.trend-value strong { font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.trend-point { min-height: 2.1rem; color: var(--muted); font-size: .875rem; line-height: 1.5; padding: 4px 0; }
.trend-details { font-size: .875rem; }
.trend-details summary { cursor: pointer; color: var(--teal); }
.trend-details .table-scroll { max-height: 230px; overflow: auto; margin-top: 7px; }
.trend-details td, .trend-details th { padding: 7px 9px; }
.trend-details th { text-align: left; }
.trend-empty { min-height: 185px; display: grid; gap: 7px; place-content: center; text-align: center; color: var(--muted); padding: 14px; }
.trend-empty strong { color: var(--ink); }
.trend-error { grid-column: 1 / -1; }
.activity { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 15px; }
.dashboard-recent-videos { grid-template-columns: minmax(0, 1fr); }
.panel-header, .toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 17px; border-bottom: 1px solid var(--line); }
.panel-header .button { margin-right: -5px; }
.empty { display: grid; justify-items: center; align-content: center; gap: 8px; min-height: 220px; padding: 25px 16px; color: var(--muted); text-align: center; }
.empty .empty-icon { width: 42px; height: 42px; background: var(--light-teal); color: var(--teal); display: grid; place-items: center; border-radius: 11px; }
.empty strong { color: var(--ink); }
.empty p { max-width: 44ch; line-height: 1.5; font-size: .875rem; }
.empty .button { margin-top: 5px; }
.activity .empty { min-height: 159px; }
.activity .empty .empty-icon { display: none; }
.recent { padding: 0 17px; list-style: none; margin: 0; }
.recent li { min-height: 63px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 0; }
.recent li + li { border-top: 1px solid var(--line); }
.recent li > div { display: grid; gap: 3px; min-width: 0; }
.recent li strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .875rem; }

.toolbar { flex-wrap: wrap; justify-content: flex-start; }
.toolbar input, .toolbar select { max-width: 100%; min-height: 38px; width: auto; }
.toolbar input[type='search'] { width: min(320px, 100%); }
.count { color: var(--muted); font-size: .875rem; margin-left: auto; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .875rem; }
thead { background: #f5f8fa; }
th, td { padding: 13px 16px; vertical-align: middle; }
th { color: #3c5365; font-weight: 700; white-space: nowrap; }
td { border-top: 1px solid #e6edf2; min-width: 94px; }
tr:first-child td { border-top: 0; }
td.wide { min-width: 195px; max-width: 340px; }
td.compact, th.compact { min-width: 0; width: 42px; }
td.row-actions { min-width: 136px; white-space: nowrap; }
td .subline { display: block; margin-top: 3px; color: var(--muted); font-size: .8125rem; overflow-wrap: anywhere; }
td .breakable { overflow-wrap: anywhere; }
td.numeric { min-width: 68px; font-variant-numeric: tabular-nums; }
.pill { display: inline-block; border-radius: 100px; padding: 3px 8px; color: #3f5667; background: #eaf0f5; font-size: .8125rem; font-weight: 650; white-space: nowrap; }
.pill.good { background: #e5f6ee; color: #236749; }
.pill.wait { background: #fff1d9; color: #805315; }
.pill.bad { background: #fce8ec; color: #9b323e; }
.pill.progress { background: #e3efff; color: #285b91; }

.device-callout { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; padding: 15px 17px; margin-bottom: 16px; border-radius: 12px; background: #e6f4f0; border: 1px solid #c4e6df; }
.device-callout p { margin-top: 5px; line-height: 1.5; }
.device-callout > div:first-child { flex: 1 1 330px; }
.device-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 0 16px; }
.device-metrics > div { min-width: 0; padding: 13px 15px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.device-metrics dt { margin-bottom: 7px; color: var(--muted); font-size: .875rem; }
.device-metrics dd { margin: 0; color: var(--ink); font-size: 1.5rem; font-weight: 750; font-variant-numeric: tabular-nums; line-height: 1; }
.device-code { display: flex; align-items: center; gap: 5px; min-width: 160px; }
.device-code code { overflow-wrap: anywhere; font-size: .875rem; }
.device-code .button { flex: 0 0 auto; min-height: 32px; padding: 4px 7px; }
.device-error { min-width: 160px; }
.collector-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 335px), 1fr)); gap: 12px; padding: 12px; }
.collector-card { display: grid; align-content: start; gap: 10px; min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 14px; background: #fcfdfe; }
.collector-card-header { display: flex; justify-content: space-between; align-items: start; gap: 9px; }
.collector-card-header h3 { font-size: 1.05rem; overflow-wrap: anywhere; }
.collector-card-header .pill { flex: 0 0 auto; }
.collector-card-header .device-code { min-width: 0; flex-wrap: wrap; }
.collector-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; margin: 0; }
.collector-details dt, .collector-gauge h4 { font-size: .8125rem; color: var(--muted); }
.collector-details dd { margin: 3px 0 0; font-size: .875rem; font-weight: 600; overflow-wrap: anywhere; }
.collector-usage { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.collector-gauge { min-width: 0; border: 1px solid var(--line); padding: 7px; border-radius: 7px; background: #fff; }
.collector-gauge h4 { margin: 0 0 3px; }
.collector-gauge strong { font-size: .95rem; font-variant-numeric: tabular-nums; }
.collector-gauge progress, .collector-gauge-missing { display: block; width: 100%; height: 6px; margin-top: 6px; border: 0; border-radius: 4px; background: #e1eaf0; color: var(--teal); appearance: none; }
.collector-gauge progress::-webkit-progress-bar { border-radius: 4px; background: #e1eaf0; }
.collector-gauge progress::-webkit-progress-value { border-radius: 4px; background: var(--teal); }
.collector-gauge progress::-moz-progress-bar { border-radius: 4px; background: var(--teal); }
.collector-gauge p, .collector-report { color: var(--muted); font-size: .8125rem; line-height: 1.45; }
.collector-gauge p { margin-top: 5px; }
.collector-note, .collector-error { font-size: .875rem; overflow-wrap: anywhere; }
.collector-error { color: #9b323e; background: #fce8ec; border-radius: 6px; padding: 7px 8px; }
.collector-error span { display: block; margin-top: 3px; font-size: .8125rem; }
.collector-actions { display: flex; flex-wrap: wrap; gap: 3px; border-top: 1px solid var(--line); padding-top: 6px; }
.collector-actions .button { padding: 5px 8px; min-height: 32px; }
.uploader-account-toggle { display: flex; align-items: center; gap: 6px; padding-block: 6px; white-space: nowrap; }
.uploader-account-toggle input { margin: 0; }
.uploader-account-list { min-width: 170px; max-height: 8rem; margin: 0; padding: 0; overflow: auto; overflow-wrap: anywhere; list-style: none; }
.uploader-account-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.uploader-account-list li + li { margin-top: 5px; }
.uploader-account-list .button { min-height: 28px; padding: 3px 5px; }
.account-email { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; }
.account-email .button { min-height: 32px; padding: 4px 6px; }
.account-daily { white-space: nowrap; font-variant-numeric: tabular-nums; }
.account-note { min-width: 115px; max-width: 240px; }
.account-filter-panel, .account-list { margin-bottom: 14px; }
.user-stats-filter-panel { margin-bottom: 14px; }
.user-stats-search { display: grid; grid-template-columns: minmax(150px, 1.3fr) repeat(2, minmax(115px, .85fr)) max-content; align-items: end; gap: 12px; padding: 14px 17px; }
.group-filter-panel { margin-bottom: 14px; }
.group-search, .group-pagination { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 14px 17px; }
.group-search label { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.group-search input[type='search'] { width: min(270px, 100%); }
.group-list .panel-header { flex-wrap: wrap; }
.group-list h1 { font-size: 1.05rem; }
.group-list-table th, .group-list-table td { padding: 10px 11px; }
.group-list-table .group-id { min-width: 48px; font-variant-numeric: tabular-nums; }
.group-list-table .group-name, .group-list-table .group-note { min-width: 115px; overflow-wrap: anywhere; }
.group-list-table .group-members { min-width: 175px; max-width: 245px; }
.group-list-table .group-date { white-space: nowrap; font-variant-numeric: tabular-nums; }
.group-list-table .row-actions .button { min-height: 32px; padding: 4px 6px; }
.group-member-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.group-member-tag { max-width: 100%; padding: 2px 6px; border-radius: 5px; font-size: .8125rem; overflow-wrap: anywhere; }
.group-member-tag.source { color: #13625a; background: #e2f4ef; }
.group-member-tag.account { color: #594e81; background: #eeeafa; }
.group-account-summary { display: grid; gap: 6px; }
.group-account-summary ul { display: grid; gap: 4px; margin: 3px 0 0; padding: 0; overflow-wrap: anywhere; list-style: none; }
.group-account-summary li { font-size: .8125rem; line-height: 1.45; }
.group-detail { display: grid; gap: 16px; margin: 0; }
.group-detail dt { margin-bottom: 5px; font-weight: 650; }
.group-detail dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.group-pagination { justify-content: flex-end; }
.group-pagination select { width: auto; }
.group-pagination .actions { align-items: center; }
.account-search { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 14px; padding: 14px 17px; align-items: end; }
.account-filter-keyword { max-width: 440px; }
.account-search-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.account-extra-filters { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.account-list-toolbar { flex-wrap: wrap; }
.account-list-toolbar .actions { margin-left: auto; }
.account-list-toolbar select { width: auto; max-width: 100%; }
.account-list-toolbar h2 { font-size: 1.02rem; }
.account-list-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.bulk-account-actions { display: flex; flex-wrap: wrap; gap: 7px; padding: 9px 17px; border-bottom: 1px solid var(--line); background: #eef6f5; }
.bulk-account-actions .button { min-height: 34px; padding: 5px 10px; }
.account-list-table { border-collapse: separate; border-spacing: 0; }
.account-list-table th, .account-list-table td { padding: 8px 10px; }
.account-list-table td { min-width: 68px; }
.account-list-table td.wide { min-width: 180px; max-width: 235px; }
.account-list-table td.compact { min-width: 34px; }
.account-list-table .account-email { gap: 0 5px; }
.account-list-table .account-email .button { min-height: 28px; padding: 3px 5px; }
.account-list-table th:last-child, .account-list-table td.row-actions { position: sticky; right: 0; z-index: 1; background: var(--panel); box-shadow: -6px 0 10px #263c4a14; }
.account-list-table th:last-child { z-index: 2; }
.account-list-table td.row-actions .button { min-height: 31px; padding: 4px 6px; }
.account-masked { font-size: .875rem; letter-spacing: .08em; color: var(--muted); white-space: nowrap; }
.account-language { padding: 3px; border: 1px solid transparent; border-radius: 7px; background: transparent; text-align: left; white-space: nowrap; }
.account-language:hover { background: #edf3f6; }
.device-form-heading { padding-top: 10px; border-top: 1px solid var(--line); font-size: 1rem; }
.collector-range { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.device-test-result { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 9px; }
.device-profile-list { padding-left: 20px; max-height: 230px; overflow-y: auto; }
.device-profile-list li { margin-block: 7px; }

.auth-view { min-height: 100vh; display: grid; place-items: center; padding: 28px; }
.auth-frame { max-width: 930px; width: 100%; min-height: 478px; display: grid; grid-template-columns: 1.05fr 1fr; overflow: hidden; border: 1px solid var(--line); border-radius: 21px; background: #fff; box-shadow: 0 22px 50px #0d2d491c; }
.auth-cover { position: relative; overflow: hidden; background: #152d3b; color: #fff; padding: clamp(25px, 5vw, 48px); }
.auth-cover .brand { position: relative; z-index: 1; }
.auth-heading { color: #fff; font-weight: 750; font-size: clamp(2.1rem, 5vw, 3.25rem); line-height: 1.18; letter-spacing: -.055em; margin: 70px 0 17px; position: relative; z-index: 1; }
.auth-cover p { position: relative; z-index: 1; max-width: 24em; color: #d2e3ec; line-height: 1.55; }
.auth-decoration { position: absolute; width: 370px; height: 290px; right: -177px; bottom: -90px; transform: rotate(-22deg); color: #8ce8d1; opacity: .4; }
.auth-decoration span { position: absolute; inset: 0; display: block; border: 1px solid; border-radius: 25px; }
.auth-decoration span:nth-child(2) { inset: 20px; }
.auth-decoration span:nth-child(3) { inset: 40px; }
.auth-main { padding: clamp(26px, 5vw, 52px); align-self: center; }
.auth-main h1 { font-size: 2rem; }
.auth-main p.muted { margin: 9px 0 24px; line-height: 1.5; }
.auth-main form { display: grid; gap: 14px; }
.auth-main form .button { margin-top: 6px; }

dialog { color: var(--ink); width: min(560px, calc(100% - 28px)); max-height: calc(100% - 28px); padding: 0; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 24px 80px #0d2d4955; overflow: auto; }
dialog::backdrop { background: #10223293; }
.dialog-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 19px; border-bottom: 1px solid var(--line); background: #fff; }
.icon-button { width: 36px; height: 36px; border: 0; border-radius: 7px; background: #edf3f6; color: var(--ink); font-size: 1.7rem; line-height: 1; }
.icon-button:hover { background: #dce7ef; }
#dialog-content { padding: 18px 19px 20px; }
#dialog-content > p, .dialog-note { line-height: 1.6; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.source-editor .form-grid, .account-editor .form-grid { grid-template-columns: minmax(0, 1fr); }
.account-import-notice { padding: 10px 12px; border: 1px solid #c9def2; border-radius: 8px; background: #eef6fd; color: #22496b; font-size: .875rem; line-height: 1.55; }
.form-grid > .full { grid-column: 1 / -1; }
label { display: grid; gap: 6px; font-size: .875rem; font-weight: 650; }
input:not([type='checkbox']), select, textarea { width: 100%; min-width: 0; padding: 8px 10px; border: 1px solid #c7d5df; border-radius: 7px; background-color: #fff; color: var(--ink); }
input:not([type='checkbox']), select { min-height: 40px; }
select { appearance: none; padding-right: 31px; background-image: linear-gradient(45deg, transparent 50%, #4c6576 50%), linear-gradient(135deg, #4c6576 50%, transparent 50%); background-position: calc(100% - 16px) center, calc(100% - 11px) center; background-size: 5px 5px; background-repeat: no-repeat; }
textarea { min-height: 76px; resize: vertical; }
.checkbox { display: flex; align-items: start; gap: 8px; line-height: 1.5; }
input[type='checkbox'] { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--teal); flex: 0 0 auto; }
.form-actions { margin-top: 17px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
dialog:has(.group-form) { width: min(780px, calc(100% - 28px)); }
dialog:has(.group-editor) { width: min(800px, calc(100% - 28px)); }
.group-editor .form-grid, .group-bulk-pickers { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.group-editor textarea { min-height: 56px; }
.field-required { color: var(--danger); }
.group-form .form-grid > label { grid-column: 1 / -1; }
.group-rules { padding: 10px 12px; border-radius: 8px; background: var(--light-teal); color: var(--ink); font-size: .875rem; line-height: 1.55; }
.member-picker { min-inline-size: 0; padding: 8px 12px 12px; border: 1px solid var(--line); border-radius: 10px; }
.member-picker legend { padding-inline: 4px; color: var(--ink); font-size: .9375rem; font-weight: 700; }
.member-toolbar { display: flex; align-items: center; justify-content: space-between; min-height: 36px; margin-bottom: 7px; color: var(--muted); font-size: .875rem; }
.member-toolbar .button { min-height: 32px; padding: 4px 8px; }
.member-options { max-height: 176px; margin-top: 6px; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.member-option { display: flex; align-items: flex-start; gap: 8px; padding: 8px 4px; min-width: 0; font-weight: 400; line-height: 1.4; cursor: pointer; }
.member-option + .member-option { border-top: 1px solid var(--line); }
.member-option > span, .member-chip > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.member-option .subline { display: block; color: var(--muted); font-size: .8125rem; }
.member-option:has(input:disabled) { color: var(--muted); cursor: default; }
.member-option:has(input:focus-visible) { background: var(--light-teal); }
.member-empty { padding: 10px 4px 4px; color: var(--muted); font-size: .875rem; line-height: 1.55; }
.member-empty a { color: var(--teal); text-decoration: underline; }
.member-hint { margin-top: 9px; color: var(--muted); font-size: .875rem; line-height: 1.55; }
.member-chips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 88px; margin-bottom: 8px; overflow: auto; }
.member-chip { display: flex; align-items: center; gap: 7px; max-width: 100%; padding: 4px 8px; border: 1px solid #c4e6df; border-radius: 6px; background: var(--light-teal); color: var(--teal); font-size: .8125rem; text-align: left; }
.member-chip:hover { border-color: var(--teal); }
.member-dropdown { padding: 0; border: 0; }
.member-dropdown legend { padding: 0; margin-bottom: 6px; font-size: .875rem; }
.member-select-bar { display: flex; align-items: center; gap: 5px; min-height: 40px; padding: 3px 8px; border: 1px solid #c7d5df; border-radius: 7px; }
.member-select-bar:focus-within { border-color: var(--teal); }
.member-select-bar .member-chips { margin: 0; }
.member-select-bar .member-chip { padding: 2px 6px; }
.member-select-toggle { display: flex; flex: 1; align-items: center; justify-content: space-between; min-height: 32px; padding: 3px; border: 0; background: transparent; color: var(--muted); text-align: left; }
.member-select-bar:has(.member-chips:not([hidden])) .member-select-toggle { justify-content: flex-end; }
.member-select-bar:has(.member-chips:not([hidden])) .member-select-toggle span:first-child { display: none; }
.member-select-choices { margin-top: 5px; padding: 4px 10px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); }
.member-dropdown .member-hint { margin-top: 4px; }
.group-upload-assignments { min-inline-size: 0; margin: 0; padding: 8px 12px 12px; border: 1px solid var(--line); border-radius: 9px; background: #f7fbfa; }
.group-upload-assignments legend { padding-inline: 4px; color: var(--ink); font-size: .9375rem; font-weight: 700; }
.group-upload-assignments > .member-hint { margin-top: 0; }
.group-upload-rows { max-height: 294px; padding-right: 4px; overflow: auto; overscroll-behavior: contain; }
.group-upload-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 5px 12px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.group-upload-row > span { overflow-wrap: anywhere; }
.group-upload-row .subline { display: block; margin-top: 3px; }
.source-mode { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .875rem; }
.mode-hint { color: var(--muted); line-height: 1.55; }
.token-field { margin-top: 13px; }
.secret-username { margin-top: 10px; overflow-wrap: anywhere; }
.form-error { color: var(--danger); font-size: .875rem; padding: 8px 10px; border-radius: 7px; background: #fce8ec; line-height: 1.45; }
.toast { position: fixed; bottom: 23px; right: 23px; z-index: 8; background: #152d3b; color: #fff; padding: 11px 16px; font-size: .9375rem; border-radius: 9px; box-shadow: 0 8px 24px #152d3b3b; max-width: min(450px, calc(100vw - 46px)); overflow-wrap: anywhere; }
.toast.bad { background: #8a2430; }
.error-panel { border: 1px solid #f1cbd1; color: #8a2430; border-radius: 10px; padding: 15px; background: #fff5f6; }
.error-panel .button { margin-left: 7px; }

@media (max-width: 1050px) {
  .layout { grid-template-columns: 190px minmax(0, 1fr); }
  .sidebar { padding-inline: 13px; }
  .page, .topbar { padding-inline: 22px; }
  .hero { grid-template-columns: minmax(0, 1fr) minmax(200px, .82fr); padding: 24px; }
  .metrics { gap: 10px; }
  .metric { padding-inline: 12px; }
  .employee-dashboard-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .user-stats-search { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; }
  .employee-workspace { grid-template-columns: minmax(0, 1fr); }
  .account-extra-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trend-grid { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 12px 13px 9px; gap: 12px; }
  .sidebar .brand { margin-left: 0; }
  .nav { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 3px; }
  .nav-link { padding: 10px; white-space: nowrap; }
  .nav-link.management-start { margin-top: 0; margin-left: 8px; box-shadow: -8px 0 0 -7px #2c4353; }
  .page-header { align-items: start; flex-direction: column; }
  .topbar { min-height: 53px; }
  .page { padding-top: 22px; }
  .auth-frame { min-height: 0; }
  .auth-cover, .auth-main { padding: 25px; }
  .auth-heading { margin-top: 43px; }
}

@media (max-width: 520px) {
  .group-upload-row { grid-template-columns: minmax(0, 1fr); }
  .account-search { grid-template-columns: minmax(0, 1fr); }
  .account-search-actions { order: 1; }
  .user-stats-search { grid-template-columns: minmax(0, 1fr); }
  .device-hero .actions { justify-content: flex-start; }
  .page, .topbar { padding-inline: 14px; }
  .hero, .activity, .auth-frame { grid-template-columns: 1fr; }
  .hero { gap: 18px; padding: 19px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .device-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .collector-range { grid-template-columns: 1fr; }
  .auth-view { padding: 13px; }
  .auth-heading { margin: 17px 0 10px; }
  .user-chip { border-left: 0; padding-left: 0; }
  #username { display: none; }
  .top-actions { gap: 4px; }
  .toast { bottom: 14px; right: 14px; }
  .form-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
