:root {
  color-scheme: light;
  --ink:#191d31; --muted:#626a7f; --soft:#737b90; --bg:#f6f7fa;
  --line:#e6e8f0; --white:#fff; --accent:#5145cd; --accent-dark:#4035ae;
  --indigo:#ece9ff; --green:#087655; --green-bg:#e4f7ef; --blue:#3162b6; --blue-bg:#eaf2ff;
  --ochre:#925918; --ochre-bg:#fff3dd; --red:#a8374d; --red-bg:#fce8ee;
  --radius:13px; --shadow:0 2px 4px #2d325507;
  font-family:"Segoe UI",system-ui,-apple-system,sans-serif;
  font-size:16px; line-height:1.5;
}
* {box-sizing:border-box}
html {scroll-behavior:smooth}
body {margin:0;background:var(--bg);color:var(--ink)}
button,input,select,textarea {font:inherit}
button,a,input,select,textarea { -webkit-tap-highlight-color:transparent }
button {cursor:pointer}
button:disabled {cursor:not-allowed;opacity:.5}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible {outline:3px solid #9b92ff;outline-offset:2px}
a {color:inherit;text-decoration:none}
h1,h2,h3,p {margin:0}
h1 {font-size:2rem;line-height:1.15;letter-spacing:-.04em;font-weight:720}
h2 {font-size:1.06rem;letter-spacing:-.014em;line-height:1.3}
small,.muted {color:var(--muted)}
[hidden] {display:none!important}
.icon {width:19px;height:19px;flex:none;vertical-align:middle;stroke:currentColor;stroke-width:1.65;fill:none;stroke-linecap:round;stroke-linejoin:round}
.initial {min-height:100vh;display:grid;place-items:center;color:var(--muted)}
.shell {min-height:100vh;display:grid;grid-template-columns:238px minmax(0,1fr)}
.sidebar {position:sticky;top:0;align-self:start;height:100dvh;display:flex;flex-direction:column;background:var(--white);border-right:1px solid var(--line);z-index:4}
.brand {display:flex;align-items:center;gap:11px;padding:25px 22px 25px;height:82px}
.brand-name {font-size:1.14rem;font-weight:760;letter-spacing:-.035em;line-height:1.15}
.brand-sub {font-size:.67rem;letter-spacing:.06em;color:var(--muted);font-weight:660;margin-top:4px;white-space:nowrap}
.brand-mark {background:#fff;position:relative;overflow:hidden;width:40px;height:40px;flex:none;border:1px solid #e4e5ee;border-radius:10px}
.brand-mark img {position:absolute;width:122px;height:122px;left:-41px;top:-32px}
.nav {padding:19px 12px;display:grid;gap:5px}
.nav-label {padding:0 12px 7px;color:var(--soft);font-size:.73rem;letter-spacing:.08em;font-weight:700}
.nav a {display:flex;align-items:center;gap:12px;border-radius:8px;padding:11px 12px;color:#535a70;font-size:.9rem;font-weight:560}
.nav a:hover {background:#f4f4f9;color:var(--ink)}
.nav a[aria-current=page] {background:#eeecff;color:#4638bc;font-weight:700}
.nav .icon {width:19px;height:19px}
.sidebar-bottom {margin-top:auto;padding:15px 16px}
.workspace-switch {width:100%;text-align:left;background:#f8f8fc;border:1px solid #eaebf4;border-radius:9px;display:flex;align-items:center;gap:9px;padding:10px;color:var(--ink)}
.workspace-switch:hover {border-color:#bcb6ee}
.workspace-switch .icon {color:var(--accent)}
.workspace-switch strong,.workspace-switch small {display:block}
.workspace-switch strong {font-size:.82rem}
.workspace-switch small {font-size:.72rem}
.workspace-switch .chev {margin-left:auto}
.side-user {margin-top:17px;padding-top:14px;border-top:1px solid var(--line);display:flex;gap:9px;align-items:center}
.side-user .who {min-width:0;flex:1}
.side-user strong {display:block;font-size:.86rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.side-user small {display:block;font-size:.75rem}
.avatar {display:grid;place-items:center;background:#eceaff;color:#5043bd;border-radius:50%;width:35px;height:35px;font-size:.78rem;font-weight:730;flex:none}
.topbar {height:65px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 30px;background:#fff;border-bottom:1px solid var(--line)}
.crumb {display:flex;gap:10px;align-items:center;color:var(--muted);font-size:.87rem}
.crumb strong {color:var(--ink);font-weight:660}
.crumb .icon {width:14px;height:14px;color:#9ca1af}
.top-right {display:flex;align-items:center;gap:11px}
.space-tag {border:1px solid #dedafa;background:#f6f4ff;color:#5348ad;border-radius:20px;display:inline-flex;align-items:center;gap:7px;padding:5px 10px;font-size:.78rem;font-weight:650;white-space:nowrap}
.space-tag.live {color:var(--green);border-color:#cce9df;background:#effaf5}
.dot {width:7px;height:7px;background:currentColor;border-radius:50%;display:inline-block;flex:none}
.content {padding:27px 30px 36px;max-width:1740px;margin-inline:auto}
.page-head {display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:22px}
.page-head p {color:var(--muted);margin-top:7px;font-size:.92rem}
.actions {display:flex;align-items:center;gap:9px;flex-wrap:wrap}
.btn {border:1px solid var(--line);background:#fff;color:#3e455b;border-radius:8px;min-height:41px;padding:8px 13px;display:inline-flex;align-items:center;justify-content:center;gap:7px;font-size:.88rem;font-weight:650;white-space:nowrap;transition:background .15s,border .15s}
.btn:hover {background:#f3f3fa;border-color:#d4d5e4}
.btn.primary {background:var(--accent);border-color:var(--accent);color:#fff;box-shadow:0 2px 3px #4d3eb328}
.btn.primary:hover {background:var(--accent-dark);border-color:var(--accent-dark)}
.btn.danger {color:var(--red);border-color:#eed1db}
.btn.danger:hover {background:var(--red-bg)}
.btn .icon {width:17px;height:17px}
.btn.compact {min-height:35px;padding:5px 10px}
.icon-btn {display:inline-grid;place-items:center;width:36px;height:36px;border:0;background:transparent;border-radius:8px;color:var(--muted);flex:none}
.icon-btn:hover {background:#f0eff9;color:var(--accent)}
.link {padding:0;border:0;background:none;color:var(--accent);font-weight:670;font-size:.87rem}
.link:hover {text-decoration:underline;text-underline-offset:4px}
.mobile-menu,.nav-backdrop {display:none}
.metrics {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:16px}
.metric {text-align:left;border:1px solid var(--line);border-radius:var(--radius);background:white;box-shadow:var(--shadow);padding:15px 16px;display:flex;justify-content:space-between;align-items:flex-start;gap:7px;min-width:0;transition:border .15s,transform .15s}
.metric:hover {border-color:#bab1f3;transform:translateY(-2px)}
.metric span:first-child {min-width:0}
.metric-label {font-size:.84rem;font-weight:620;color:var(--muted);display:block}
.metric-value {font-size:1.82rem;font-weight:730;line-height:1.2;letter-spacing:-.04em;display:block;margin-top:6px}
.badge-icon {display:grid;place-items:center;width:39px;height:39px;border-radius:9px;background:var(--indigo);color:var(--accent);flex:none}
.badge-icon.green {background:var(--green-bg);color:var(--green)}
.badge-icon.blue {background:var(--blue-bg);color:var(--blue)}
.badge-icon.ochre {background:var(--ochre-bg);color:var(--ochre)}
.badge-icon.red {background:var(--red-bg);color:var(--red)}
.panel {border:1px solid var(--line);background:#fff;border-radius:var(--radius);box-shadow:var(--shadow);min-width:0}
.analytics {display:grid;grid-template-columns:1.12fr 1fr;gap:15px;margin-bottom:17px}
.analytics .panel {padding:16px 17px}
.panel-head {display:flex;justify-content:space-between;align-items:center;gap:10px}
.panel-head p {font-size:.81rem;color:var(--muted);margin-top:4px}
.panel-head .plain-icon {color:#797e97}
.stack {height:12px;display:flex;gap:3px;border-radius:5px;overflow:hidden;background:#f0f1f6;margin:15px 0 11px}
.stack span {border-radius:2px;background:var(--tone)}
.legend {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:3px 16px}
.legend button,.department-bar {display:flex;align-items:center;gap:8px;border:0;background:none;padding:3px 0;color:#515a70;font-size:.81rem;text-align:left}
.legend button:hover,.department-bar:hover {color:var(--accent)}
.legend .dot {color:var(--tone);width:8px;height:8px}
.legend strong,.department-bar strong {margin-left:auto;color:var(--ink);font-size:.79rem;white-space:nowrap}
.dept-chart {margin-top:9px;display:grid;gap:4px}
.department-bar {display:grid;grid-template-columns:78px 1fr 32px;width:100%;gap:10px}
.track {height:6px;background:#f0effa;border-radius:10px;overflow:hidden}
.track span {display:block;height:100%;background:#766ae1;border-radius:10px}
.table-panel {overflow:hidden}
.table-head {display:flex;align-items:center;justify-content:space-between;padding:16px 17px 12px;gap:12px}
.table-head .title-meta {display:flex;align-items:center;gap:8px}
.count {font-size:.76rem;background:#f0eff9;color:#584e8f;border-radius:16px;padding:2px 7px;font-weight:650;white-space:nowrap}
.filterbar {display:flex;gap:8px;flex-wrap:wrap;padding:0 17px 13px}
.field-control,input:not([type=checkbox]),select,textarea {min-width:0;border:1px solid #dfe2ed;border-radius:8px;min-height:40px;padding:8px 10px;background:#fff;color:var(--ink);font-size:.89rem}
input::placeholder,textarea::placeholder {color:#777e91}
select {appearance:none;padding-right:29px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23626981' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 8px center}
.search {position:relative;min-width:215px;flex:1}
.search .icon {position:absolute;left:10px;top:10px;color:#777d92;pointer-events:none}
.search input {width:100%;padding-left:35px}
.table-scroll {overflow:auto}
table {width:100%;border-collapse:collapse;text-align:left;font-size:.86rem;white-space:nowrap}
thead {background:#f8f9fc;color:#545c72;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
th {font-weight:660;padding:10px 13px}
td {padding:11px 13px;border-bottom:1px solid #eff0f5}
th:first-child,td:first-child {padding-left:17px}
th:last-child,td:last-child {padding-right:17px}
tbody tr:last-child td {border-bottom:0}
tbody tr.clickable {cursor:pointer}
tbody tr.clickable:hover {background:#faf9ff}
td .device-name {color:var(--ink);font-weight:690}
td .device-name:hover {color:var(--accent)}
.device-cell {display:flex;gap:9px;align-items:center}
.device-cell .badge-icon {width:33px;height:33px;background:#f1effa;color:#6659bb}
.device-cell .icon {width:17px;height:17px}
.device-cell small {display:block;font-size:.73rem;margin-top:2px}
.status {display:inline-flex;align-items:center;gap:6px;border-radius:20px;color:var(--fg);background:var(--tag);padding:4px 9px;font-size:.77rem;font-weight:670;white-space:nowrap}
.status .dot {width:6px;height:6px}
.pagination {display:flex;align-items:center;justify-content:space-between;border-top:1px solid var(--line);padding:11px 17px;gap:10px;color:var(--muted);font-size:.82rem}
.pagination button {width:32px;height:32px}
.pagination .pages {display:flex;align-items:center;gap:6px}
.pagination .size {min-height:33px;padding-block:3px;font-size:.8rem}
.empty {text-align:center;padding:34px 18px 38px;color:var(--muted);white-space:normal}
.empty .badge-icon {margin:0 auto 11px}
.empty h3 {font-size:1rem;color:var(--ink);margin-bottom:4px}
.empty p {font-size:.87rem}
.empty .btn {margin-top:12px}
.toast {position:fixed;bottom:22px;right:22px;max-width:min(440px,calc(100% - 44px));background:#242243;color:#fff;border-radius:10px;padding:11px 17px;box-shadow:0 8px 30px #201b4640;z-index:10;font-size:.9rem}
dialog {padding:0;border:1px solid var(--line);border-radius:15px;box-shadow:0 22px 70px #15132d30;width:min(620px,calc(100% - 26px));max-height:min(90dvh,880px);color:var(--ink)}
dialog.wide {width:min(835px,calc(100% - 26px))}
dialog::backdrop {background:#15172e70;backdrop-filter:blur(2px)}
.dialog-head {position:sticky;top:0;z-index:2;background:white;display:flex;justify-content:space-between;align-items:center;gap:10px;border-bottom:1px solid var(--line);padding:15px 19px}
.dialog-head h2 {font-size:1.26rem}
.dialog-body {padding:18px 20px}
.dialog-foot {position:sticky;bottom:0;background:white;z-index:2;border-top:1px solid var(--line);padding:12px 19px;display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap}
.form-grid {display:grid;grid-template-columns:1fr 1fr;gap:13px 14px}
.form-grid label,.form-stack label {font-size:.875rem;font-weight:650;display:grid;gap:5px;align-content:start}
.form-grid .span {grid-column:1/-1}
.form-grid input,.form-grid select,.form-grid textarea,.form-stack input {width:100%;font-weight:400}
.form-grid textarea {resize:vertical;min-height:71px}
.form-stack {display:grid;gap:13px}
.form-error {color:#a32745;background:#fff0f3;border-radius:7px;padding:7px 10px;margin:13px 0 0;font-size:.86rem}
.dialog-intro {color:var(--muted);font-size:.9rem;margin-bottom:14px}
.detail-title {display:flex;align-items:center;gap:12px;margin-bottom:16px}
.detail-title h3 {font-size:1.23rem}
.detail-title p {font-size:.84rem;color:var(--muted);margin-top:3px}
.detail-title .status {margin-left:auto}
.details {display:grid;grid-template-columns:1fr 1fr;gap:0;margin:0;border:1px solid var(--line);border-radius:9px;overflow:hidden}
.details div {padding:10px 12px;border-bottom:1px solid var(--line);min-width:0}
.details dt {font-size:.77rem;font-weight:650;color:var(--muted)}
.details dd {margin:4px 0 0;font-size:.88rem;overflow-wrap:anywhere;white-space:pre-wrap}
.details .span {grid-column:1/-1}
.details div:last-child {border-bottom:none}
.history {margin-top:18px}
.history h3 {font-size:.93rem;margin-bottom:5px}
.history button {display:flex;justify-content:space-between;text-align:left;width:100%;border:0;background:#f7f7fc;color:#5245b0;border-radius:7px;margin-top:5px;padding:7px 9px;font-size:.85rem}
.workspace-option {width:100%;display:flex;align-items:center;gap:11px;text-align:left;padding:13px;border:1px solid var(--line);background:white;border-radius:9px;color:var(--ink);margin:0 0 8px}
.workspace-option:hover {border-color:#a59bed;background:#f9f7ff}
.workspace-option small {display:block}
.pick-title {font-weight:700;font-size:.88rem;display:flex;align-items:center;justify-content:space-between;gap:8px;margin:14px 0 7px}
.pick-list {max-height:190px;overflow:auto;border:1px solid var(--line);border-radius:8px;margin-top:7px}
.pick-row {display:flex;align-items:center;gap:8px;padding:9px 10px;border-bottom:1px solid var(--line);cursor:pointer;font-size:.86rem}
.pick-row:last-child {border-bottom:0}
.pick-row:hover {background:#f8f7ff}
.pick-row small {margin-left:auto}
.check-line {display:flex;align-items:center;gap:7px;margin-top:12px;font-size:.88rem;font-weight:650}
input[type=checkbox] {accent-color:var(--accent);width:16px;height:16px;flex:none}
.form-block {padding:11px;background:#f7f7fc;border-radius:8px;margin-top:10px}
.login {min-height:100dvh;display:grid;grid-template-columns:minmax(0,1fr) minmax(340px,1fr);background:#fff}
.login-main {padding:35px clamp(24px,6vw,88px);display:flex;flex-direction:column;min-width:0}
.login-brand {display:flex;align-items:center;gap:12px;font-weight:750;font-size:1.27rem}
.login-card {width:min(100%,390px);margin:auto; padding:36px 0}
.login-card h1 {font-size:2.24rem}
.login-card p {margin:8px 0 25px;color:var(--muted)}
.login-card input {height:46px}
.login-card .btn {width:100%;height:46px;margin-top:5px}
.login-footer {font-size:.79rem;color:var(--muted)}
.password {position:relative}
.password input {padding-right:43px}
.password button {position:absolute;right:5px;top:5px}
.login-visual {display:flex;flex-direction:column;justify-content:center;align-items:flex-start;overflow:hidden;position:relative;color:white;padding:60px clamp(30px,6vw,88px);background:radial-gradient(ellipse at 90% 0,#5548bc 0,transparent 63%),#262252}
.login-visual::after {pointer-events:none;content:"";position:absolute;inset:0;background-image:linear-gradient(#c4bbff15 1px,transparent 1px),linear-gradient(90deg,#c4bbff15 1px,transparent 1px);background-size:39px 39px;mask-image:linear-gradient(135deg,transparent 15%,black 90%)}
.logo-full {display:block;position:relative;width:154px;height:67px;overflow:hidden;border-radius:7px;background:#fff;z-index:1;margin-bottom:25px;box-shadow:0 6px 16px #18133d45}
.logo-full img {width:147px;left:3px;top:-40px;position:absolute}
.login-visual h2 {font-size:clamp(2.1rem,4vw,4rem);line-height:1.1;letter-spacing:-.05em;max-width:520px;z-index:1}
.login-visual p {color:#e0ddff;max-width:385px;margin-top:16px;font-size:1rem;z-index:1}
.login-stats {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:min(100%,395px);gap:10px;margin-top:28px;z-index:1}
.login-stat {display:flex;gap:9px;align-items:center;padding:12px;background:#ffffff10;border:1px solid #ffffff26;border-radius:9px;font-size:.87rem;color:#f0edff}
#print-area {display:none}
@media(max-width:1150px) {
  .shell{grid-template-columns:205px minmax(0,1fr)}
  .brand{padding-left:15px}.content,.topbar{padding-left:20px;padding-right:20px}
}
@media(max-width:880px) {
  .shell{display:block}.sidebar{display:none;position:fixed;left:0;width:235px;box-shadow:8px 0 30px #0002}
  .sidebar.open{display:flex}.mobile-menu{display:inline-grid;margin-left:-7px}.topbar{height:58px}
  .crumb{margin-right:auto}.nav-backdrop.open{display:block;position:fixed;inset:0;background:#17152d66;z-index:3;border:0}
}
@media(max-width:620px) {
  h1{font-size:1.65rem}.content{padding:17px 12px 27px}.topbar{padding:0 12px;gap:6px}
  .page-head{display:block;margin-bottom:14px}.page-head .actions{margin-top:12px}.page-head p{font-size:.86rem}
  .metrics{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-bottom:11px}
  .metric{padding:10px}.metric-value{font-size:1.5rem}.badge-icon{width:34px;height:34px}
  .metric-label{font-size:.79rem}.analytics{grid-template-columns:1fr;gap:10px;margin-bottom:11px}
  .analytics .panel{padding:13px}.crumb .crumb-root,.crumb .crumb-sep{display:none}
  .filterbar{padding:0 11px 10px;gap:6px}.filterbar .search{flex:1 1 100%}.filterbar select{max-width:100%;flex:1 1 120px}
  .table-head,.pagination{padding-inline:11px}.pagination{flex-wrap:wrap}
  .login{grid-template-columns:minmax(0,1fr)}.login-visual{display:none}.login-main{min-height:100dvh}
  .form-grid{gap:10px}.dialog-body{padding:13px}.dialog-head,.dialog-foot{padding:11px 13px}
  td,th{padding-inline:10px}
}
@media(prefers-reduced-motion:reduce) {
  html{scroll-behavior:auto} *,*::before,*::after{transition:none!important}
}
@media print {
  body{background:#fff;color:#000}
  #app,dialog,#toast{display:none!important}
  #print-area{display:block;padding:18px;font:12pt "Segoe UI",sans-serif}
  #print-area h1{text-align:center;margin:22px 0 14px;font-size:20pt}
  #print-area p{margin:6px 0}
  #print-area img{width:100px;height:65px;object-fit:cover}
  #print-area table{margin:15px 0;border:1px solid #999;white-space:normal}
  #print-area td,#print-area th{border:1px solid #999;padding:7px}
  .signatures{display:grid;grid-template-columns:1fr 1fr;text-align:center;margin-top:30px;font-weight:700}
}
