:root {
  --ink-950: #0b1220;
  --ink-900: #111827;
  --ink-800: #1f2937;
  --ink-700: #334155;
  --ink-600: #475569;
  --ink-500: #64748b;
  --ink-400: #94a3b8;
  --ink-300: #cbd5e1;
  --ink-200: #e2e8f0;
  --ink-100: #f1f5f9;
  --ink-50: #f8fafc;
  --primary-700: #0f5fcc;
  --primary-600: #1473e6;
  --primary-500: #2583ed;
  --primary-100: #dbeafe;
  --primary-50: #eff6ff;
  --cyan-500: #06b6d4;
  --green-600: #16a34a;
  --green-100: #dcfce7;
  --green-50: #f0fdf4;
  --amber-600: #d97706;
  --amber-100: #fef3c7;
  --amber-50: #fffbeb;
  --red-600: #dc2626;
  --red-100: #fee2e2;
  --red-50: #fef2f2;
  --purple-600: #7c3aed;
  --purple-100: #ede9fe;
  --surface: #ffffff;
  --page: #f4f7fb;
  --border: #e7ecf3;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 5px rgba(15, 23, 42, .03);
  --shadow-md: 0 10px 32px rgba(15, 23, 42, .08), 0 2px 8px rgba(15, 23, 42, .04);
  --shadow-lg: 0 28px 80px rgba(15, 23, 42, .18), 0 8px 24px rgba(15, 23, 42, .08);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --sidebar-width: 244px;
  --sidebar-collapsed: 76px;
  --topbar-height: 72px;
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink-800);
  background: var(--page);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background: var(--page);
  color: var(--ink-800);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: .55;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

[hidden] {
  display: none !important;
}

.noscript {
  position: fixed;
  z-index: 9999;
  inset: 0 0 auto;
  padding: 14px;
  color: #fff;
  text-align: center;
  background: var(--red-600);
}

::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: #cbd5e1;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
  background-clip: padding-box;
}

.login-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 1.14fr) minmax(420px, .86fr);
  background: #fff;
}

.login-visual {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  padding: clamp(38px, 5vw, 72px);
  color: #fff;
  background:
    linear-gradient(135deg, rgba(8, 27, 58, .97), rgba(9, 49, 99, .94)),
    radial-gradient(circle at 70% 26%, rgba(37, 131, 237, .6), transparent 34%);
}

.login-visual::before,
.login-visual::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.login-visual::before {
  inset: 0;
  opacity: .22;
  background-image:
    linear-gradient(rgba(255,255,255,.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.09) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to bottom right, black, transparent 72%);
}

.login-visual::after {
  right: -100px;
  bottom: -110px;
  width: 460px;
  height: 460px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 50%;
  box-shadow: 0 0 0 68px rgba(255,255,255,.025), 0 0 0 136px rgba(255,255,255,.02);
}

.login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(3px);
  opacity: .8;
}

.login-orb-a {
  top: 11%;
  right: 7%;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle at 35% 35%, rgba(62, 184, 255, .72), rgba(15, 95, 204, .06) 72%);
}

.login-orb-b {
  left: 28%;
  bottom: 4%;
  width: 330px;
  height: 330px;
  background: radial-gradient(circle, rgba(20, 115, 230, .34), transparent 68%);
}

.login-brand,
.login-mobile-brand,
.sidebar-brand {
  display: flex;
  align-items: center;
}

.login-brand {
  position: relative;
  z-index: 1;
  gap: 15px;
}

.brand-mark {
  flex: 0 0 auto;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(145deg, #2390ff, #0f5fcc);
  box-shadow: 0 8px 24px rgba(20, 115, 230, .3);
}

.brand-mark svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.8;
}

.brand-mark-large {
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255,255,255,.26);
  border-radius: 14px;
  background: rgba(255,255,255,.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18);
  backdrop-filter: blur(10px);
}

.login-brand strong {
  display: block;
  font-size: 20px;
  letter-spacing: .08em;
}

.login-brand span:not(.brand-mark) {
  display: block;
  margin-top: 1px;
  color: rgba(255,255,255,.52);
  font-size: 9px;
  letter-spacing: .16em;
}

.login-hero-copy {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin-top: clamp(100px, 18vh, 185px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #8fc9ff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .13em;
}

.eyebrow i {
  width: 22px;
  height: 2px;
  background: #48a7ff;
}

.login-hero-copy h1 {
  margin: 24px 0 22px;
  font-size: clamp(40px, 4.4vw, 68px);
  font-weight: 670;
  line-height: 1.18;
  letter-spacing: -.055em;
}

.login-hero-copy p {
  max-width: 530px;
  margin: 0;
  color: rgba(255,255,255,.68);
  font-size: 16px;
  line-height: 1.9;
}

.login-metric-strip {
  position: absolute;
  z-index: 2;
  right: clamp(38px, 5vw, 72px);
  bottom: clamp(38px, 6vh, 72px);
  left: clamp(38px, 5vw, 72px);
  display: flex;
  max-width: 670px;
  padding: 22px 0;
  border-top: 1px solid rgba(255,255,255,.12);
}

.login-metric-strip div {
  flex: 1;
}

.login-metric-strip strong,
.login-metric-strip span {
  display: block;
}

.login-metric-strip strong {
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.login-metric-strip span {
  margin-top: 3px;
  color: rgba(255,255,255,.48);
  font-size: 11px;
}

.login-panel {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 48px clamp(34px, 6vw, 98px);
}

.login-card {
  width: 100%;
  max-width: 420px;
}

.login-mobile-brand {
  display: none;
}

.login-card header {
  margin-bottom: 38px;
}

.login-welcome {
  color: var(--primary-600);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .18em;
}

.login-card h2 {
  margin: 9px 0 7px;
  color: var(--ink-950);
  font-size: 30px;
  line-height: 1.25;
  letter-spacing: -.035em;
}

.login-card header p {
  margin: 0;
  color: var(--ink-500);
}

.field {
  display: block;
  margin-bottom: 20px;
}

.field > span:first-child,
.field-label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink-700);
  font-size: 13px;
  font-weight: 650;
}

.required::after {
  content: " *";
  color: var(--red-600);
}

.input-shell {
  position: relative;
  display: flex;
  align-items: center;
}

.input-shell > svg {
  position: absolute;
  left: 14px;
  width: 19px;
  height: 19px;
  color: var(--ink-400);
  pointer-events: none;
}

.input-shell input {
  width: 100%;
  height: 50px;
  padding: 0 44px;
  border: 1px solid var(--ink-200);
  outline: 0;
  border-radius: 10px;
  color: var(--ink-900);
  background: #fff;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.input-shell input::placeholder,
.form-control::placeholder {
  color: var(--ink-400);
}

.input-shell input:hover,
.form-control:hover {
  border-color: var(--ink-300);
}

.input-shell input:focus,
.form-control:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(37, 131, 237, .12);
}

.icon-button {
  display: inline-grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  place-items: center;
  border-radius: 9px;
  color: var(--ink-500);
  background: transparent;
  transition: color .18s ease, background .18s ease, transform .18s ease;
}

.icon-button:hover {
  color: var(--ink-800);
  background: var(--ink-100);
}

.icon-button:active {
  transform: scale(.96);
}

.icon-button svg {
  width: 20px;
  height: 20px;
}

.password-toggle {
  position: absolute;
  right: 6px;
  width: 38px;
  height: 38px;
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: -3px 0 26px;
  color: var(--ink-500);
  font-size: 12px;
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.check-row input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--primary-600);
}

.button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--ink-700);
  font-weight: 650;
  white-space: nowrap;
  background: #fff;
  transition: all .18s ease;
}

.button svg {
  width: 17px;
  height: 17px;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button.primary {
  color: #fff;
  border-color: var(--primary-600);
  background: var(--primary-600);
  box-shadow: 0 7px 18px rgba(20, 115, 230, .2);
}

.button.primary:hover:not(:disabled) {
  border-color: var(--primary-700);
  background: var(--primary-700);
  box-shadow: 0 9px 22px rgba(20, 115, 230, .27);
}

.button.secondary {
  border-color: var(--ink-200);
  background: #fff;
}

.button.secondary:hover:not(:disabled),
.button.ghost:hover:not(:disabled) {
  color: var(--primary-700);
  border-color: var(--primary-100);
  background: var(--primary-50);
}

.button.ghost {
  border-color: transparent;
  background: transparent;
}

.button.danger {
  color: var(--red-600);
  border-color: var(--red-100);
  background: var(--red-50);
}

.button.warning {
  color: var(--amber-600);
  border-color: var(--amber-100);
  background: var(--amber-50);
}

.button.success {
  color: var(--green-600);
  border-color: var(--green-100);
  background: var(--green-50);
}

.button.small {
  min-height: 31px;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 12px;
}

.button.icon-only {
  width: 34px;
  padding: 0;
}

.login-submit {
  width: 100%;
  min-height: 50px;
  border-radius: 10px;
  font-size: 15px;
}

.login-submit svg {
  margin-left: auto;
}

.demo-button {
  width: 100%;
  margin-top: 10px;
  color: var(--ink-500);
}

.login-card footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 30px;
  color: var(--ink-400);
  font-size: 11px;
}

.login-card footer svg {
  width: 15px;
  height: 15px;
  color: var(--green-600);
}

.inline-alert {
  margin-bottom: 20px;
  padding: 11px 13px;
  border: 1px solid;
  border-radius: 9px;
  font-size: 12px;
}

.inline-alert.danger {
  color: #991b1b;
  border-color: #fecaca;
  background: var(--red-50);
}

.app {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  z-index: 50;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  color: #c7d2e3;
  background: var(--ink-950);
  transition: width .24s ease, transform .24s ease;
}

.sidebar-brand {
  position: relative;
  flex: 0 0 var(--topbar-height);
  gap: 11px;
  padding: 0 17px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}

.sidebar-brand > div {
  min-width: 0;
}

.sidebar-brand strong,
.sidebar-brand span {
  display: block;
}

.sidebar-brand strong {
  color: #fff;
  font-size: 17px;
  letter-spacing: .04em;
  white-space: nowrap;
}

.sidebar-brand div span {
  color: #6f8099;
  font-size: 10px;
  letter-spacing: .16em;
}

.sidebar-collapse {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: -15px;
  width: 30px;
  height: 30px;
  color: #94a3b8;
  border: 1px solid rgba(148,163,184,.28);
  background: var(--ink-900);
  box-shadow: 0 5px 16px rgba(2,6,23,.28);
  transform: translateY(-50%);
}

.sidebar-collapse:hover {
  color: #fff;
  border-color: rgba(148,163,184,.48);
  background: #243044;
}

.sidebar-collapse:focus-visible,
.mobile-menu:focus-visible {
  outline: 3px solid rgba(96,165,250,.52);
  outline-offset: 2px;
}

.sidebar-collapse svg {
  transition: transform .2s ease;
}

.main-nav {
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 18px 10px;
}

.nav-group-label {
  display: block;
  margin: 16px 12px 8px;
  color: #58677d;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .16em;
  white-space: nowrap;
}

.nav-group-label:first-child {
  margin-top: 2px;
}

.nav-item {
  position: relative;
  display: flex;
  min-height: 43px;
  align-items: center;
  gap: 12px;
  margin-bottom: 3px;
  padding: 0 12px;
  border-radius: 9px;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 560;
  white-space: nowrap;
  transition: color .18s ease, background .18s ease;
}

.nav-item:hover {
  color: #e2e8f0;
  background: rgba(255,255,255,.055);
}

.nav-item.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(20, 115, 230, .3), rgba(20, 115, 230, .12));
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: -10px;
  width: 3px;
  height: 23px;
  border-radius: 0 4px 4px 0;
  background: #3c9cff;
  box-shadow: 0 0 15px rgba(60,156,255,.7);
}

.nav-item svg {
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
}

.nav-badge {
  min-width: 21px;
  margin-left: auto;
  padding: 1px 6px;
  border-radius: 999px;
  color: #cce7ff;
  text-align: center;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  background: rgba(37,131,237,.26);
}

.nav-lock {
  width: 14px !important;
  height: 14px !important;
  margin-left: auto;
  color: #536176;
}

.nav-item.restricted {
  opacity: .62;
}

.sidebar-footer {
  padding: 14px 14px 18px;
  border-top: 1px solid rgba(255,255,255,.07);
}

.service-health {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 9px;
  background: rgba(255,255,255,.025);
}

.health-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34,197,94,.1);
}

.service-health strong,
.service-health small {
  display: block;
  white-space: nowrap;
}

.service-health strong {
  color: #cbd5e1;
  font-size: 10px;
  font-weight: 600;
}

.service-health small {
  color: #56657a;
  font-size: 8px;
}

.version {
  display: block;
  margin-top: 10px;
  color: #3f4c60;
  text-align: center;
  font-size: 8px;
  letter-spacing: .12em;
  white-space: nowrap;
}

.app.sidebar-is-collapsed .sidebar {
  width: var(--sidebar-collapsed);
}

.app.sidebar-is-collapsed .workspace {
  margin-left: var(--sidebar-collapsed);
}

.app.sidebar-is-collapsed .sidebar-brand {
  justify-content: center;
  padding: 0;
}

.app.sidebar-is-collapsed .sidebar-brand > div,
.app.sidebar-is-collapsed .nav-item span:not(.nav-badge),
.app.sidebar-is-collapsed .nav-badge,
.app.sidebar-is-collapsed .nav-lock,
.app.sidebar-is-collapsed .nav-group-label,
.app.sidebar-is-collapsed .service-health div,
.app.sidebar-is-collapsed .version {
  display: none;
}

.app.sidebar-is-collapsed .sidebar-collapse svg {
  transform: rotate(180deg);
}

.app.sidebar-is-collapsed .nav-group-label {
  height: 8px;
  margin: 5px 0;
}

.app.sidebar-is-collapsed .nav-item {
  justify-content: center;
  padding: 0;
}

.app.sidebar-is-collapsed .nav-item.active::before {
  left: -10px;
}

.app.sidebar-is-collapsed .sidebar-footer {
  padding: 14px;
}

.app.sidebar-is-collapsed .service-health {
  justify-content: center;
  padding: 10px;
}

.workspace {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  transition: margin-left .24s ease;
}

.topbar {
  position: sticky;
  z-index: 35;
  top: 0;
  display: flex;
  min-height: var(--topbar-height);
  align-items: center;
  justify-content: space-between;
  padding: 0 26px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.93);
  box-shadow: 0 1px 0 rgba(15,23,42,.01);
  backdrop-filter: blur(14px);
}

.topbar-left,
.topbar-actions,
.topbar-left > div {
  display: flex;
  align-items: center;
}

.topbar-left {
  gap: 13px;
}

.topbar-left > div {
  align-items: baseline;
  gap: 12px;
}

.topbar h1 {
  margin: 0;
  color: var(--ink-950);
  font-size: 18px;
  letter-spacing: -.02em;
}

.topbar-left p {
  margin: 0;
  color: var(--ink-400);
  font-size: 11px;
}

.topbar-actions {
  gap: 5px;
}

.topbar-actions > .icon-button {
  color: var(--ink-500);
}

.mobile-menu {
  display: none;
}

.notification-button {
  position: relative;
}

.notification-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 6px;
  height: 6px;
  border: 1.5px solid #fff;
  border-radius: 50%;
  background: var(--red-600);
}

.tooltip {
  position: relative;
}

.tooltip::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  z-index: 100;
  padding: 5px 8px;
  border-radius: 5px;
  color: #fff;
  font-size: 10px;
  white-space: nowrap;
  background: var(--ink-900);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -3px);
  transition: opacity .15s, transform .15s;
}

.tooltip:hover::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.mock-badge {
  margin-right: 4px;
  padding: 4px 8px;
  border: 1px solid var(--amber-100);
  border-radius: 999px;
  color: var(--amber-600);
  font-size: 10px;
  font-weight: 700;
  background: var(--amber-50);
}

.profile-menu-wrap {
  position: relative;
  margin-left: 9px;
  padding-left: 14px;
  border-left: 1px solid var(--border);
}

.profile-button {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px;
  border: 0;
  border-radius: 10px;
  background: transparent;
}

.profile-button:hover {
  background: var(--ink-50);
}

.avatar {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  background: linear-gradient(145deg, #1b87f1, #0e5fc8);
}

.profile-copy {
  min-width: 72px;
  text-align: left;
}

.profile-copy strong,
.profile-copy small {
  display: block;
}

.profile-copy strong {
  color: var(--ink-800);
  font-size: 12px;
}

.profile-copy small {
  color: var(--ink-400);
  font-size: 9px;
}

.profile-button > svg {
  width: 14px;
  height: 14px;
  color: var(--ink-400);
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 175px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #fff;
  box-shadow: var(--shadow-md);
}

.profile-dropdown button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 0;
  border-radius: 7px;
  color: var(--ink-600);
  font-size: 12px;
  text-align: left;
  background: transparent;
}

.profile-dropdown button:hover {
  color: var(--ink-900);
  background: var(--ink-50);
}

.profile-dropdown svg {
  width: 16px;
  height: 16px;
}

.profile-dropdown hr {
  margin: 5px 4px;
  border: 0;
  border-top: 1px solid var(--border);
}

.danger-text {
  color: var(--red-600) !important;
}

.global-banner {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 16px 26px -3px;
  padding: 10px 13px;
  border: 1px solid var(--amber-100);
  border-radius: 9px;
  color: #92400e;
  font-size: 12px;
  background: var(--amber-50);
}

.global-banner svg {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
}

.view {
  min-height: calc(100vh - var(--topbar-height) - 49px);
  padding: 24px 26px 34px;
  outline: 0;
}

.workspace-footer {
  display: flex;
  justify-content: space-between;
  padding: 0 26px 22px;
  color: var(--ink-400);
  font-size: 9px;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.page-head h2 {
  margin: 0;
  color: var(--ink-950);
  font-size: 21px;
  letter-spacing: -.035em;
}

.page-head p {
  margin: 4px 0 0;
  color: var(--ink-500);
  font-size: 12px;
}

.page-actions,
.row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.stat-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.stat-card::after {
  content: "";
  position: absolute;
  right: -25px;
  bottom: -45px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--stat-soft, var(--primary-50));
  opacity: .55;
}

.stat-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-label {
  color: var(--ink-500);
  font-size: 11px;
  font-weight: 600;
}

.stat-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 10px;
  color: var(--stat-color, var(--primary-600));
  background: var(--stat-soft, var(--primary-50));
}

.stat-icon svg {
  width: 19px;
  height: 19px;
}

.stat-value {
  position: relative;
  z-index: 1;
  display: block;
  margin: 14px 0 7px;
  color: var(--ink-950);
  font-size: 27px;
  font-weight: 720;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -.04em;
}

.stat-foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-400);
  font-size: 9px;
}

.trend {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-weight: 700;
}

.trend.up {
  color: var(--green-600);
}

.trend.down {
  color: var(--red-600);
}

.trend svg {
  width: 12px;
  height: 12px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, .75fr);
  gap: 16px;
  margin-bottom: 16px;
}

.dashboard-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr);
  gap: 16px;
}

.panel {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.panel-head {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 17px;
  border-bottom: 1px solid var(--border);
}

.panel-head h3 {
  margin: 0;
  color: var(--ink-900);
  font-size: 14px;
}

.panel-head p {
  margin: 2px 0 0;
  color: var(--ink-400);
  font-size: 9px;
}

.panel-body {
  padding: 17px;
}

.panel-body.flush {
  padding: 0;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--ink-50);
}

.segmented button {
  min-width: 40px;
  padding: 4px 9px;
  border: 0;
  border-radius: 5px;
  color: var(--ink-500);
  font-size: 10px;
  background: transparent;
}

.segmented button.active {
  color: var(--primary-700);
  font-weight: 700;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15,23,42,.1);
}

.chart-wrap {
  position: relative;
  height: 260px;
}

.chart-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--ink-500);
  font-size: 9px;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.chart-legend i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.donut-layout {
  display: grid;
  min-height: 260px;
  place-items: center;
}

.donut {
  position: relative;
  display: grid;
  width: 152px;
  height: 152px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--primary-600) 0 34%, var(--cyan-500) 34% 57%, #8b5cf6 57% 75%, #f59e0b 75% 89%, #cbd5e1 89% 100%);
}

.donut::before {
  content: "";
  position: absolute;
  width: 102px;
  height: 102px;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--border);
}

.donut-center {
  position: relative;
  z-index: 1;
  text-align: center;
}

.donut-center strong,
.donut-center span {
  display: block;
}

.donut-center strong {
  color: var(--ink-950);
  font-size: 24px;
}

.donut-center span {
  color: var(--ink-400);
  font-size: 9px;
}

.fault-legend {
  width: 100%;
  margin-top: 20px;
}

.fault-legend-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  margin: 9px 0;
  color: var(--ink-500);
  font-size: 10px;
}

.fault-legend-row span:first-child {
  display: flex;
  align-items: center;
  gap: 7px;
}

.fault-legend-row i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.fault-legend-row strong {
  color: var(--ink-700);
  font-variant-numeric: tabular-nums;
}

.quick-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.quick-card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 9px;
  text-align: left;
  background: var(--ink-50);
  transition: border-color .18s, background .18s, transform .18s;
}

.quick-card:hover {
  border-color: var(--primary-100);
  background: var(--primary-50);
  transform: translateY(-1px);
}

.quick-card > span:first-child {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  color: var(--primary-600);
  background: #fff;
  box-shadow: 0 2px 6px rgba(15,23,42,.05);
}

.quick-card svg {
  width: 18px;
  height: 18px;
}

.quick-card strong,
.quick-card small {
  display: block;
}

.quick-card strong {
  color: var(--ink-800);
  font-size: 11px;
}

.quick-card small {
  color: var(--ink-400);
  font-size: 8px;
}

.activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.activity-item {
  position: relative;
  display: flex;
  gap: 11px;
  padding: 0 0 17px;
}

.activity-item:last-child {
  padding-bottom: 0;
}

.activity-item::before {
  content: "";
  position: absolute;
  top: 27px;
  bottom: 2px;
  left: 13px;
  width: 1px;
  background: var(--border);
}

.activity-item:last-child::before {
  display: none;
}

.activity-icon {
  position: relative;
  z-index: 1;
  display: grid;
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 50%;
  color: var(--primary-600);
  background: var(--primary-100);
}

.activity-icon svg {
  width: 12px;
  height: 12px;
}

.activity-content {
  min-width: 0;
}

.activity-content p {
  margin: 1px 0 2px;
  color: var(--ink-700);
  font-size: 10px;
}

.activity-content strong {
  color: var(--ink-900);
}

.activity-content time {
  color: var(--ink-400);
  font-size: 8px;
}

.filter-card {
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.filter-row + .filter-row {
  margin-top: 10px;
}

.filter-control {
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--ink-200);
  outline: 0;
  border-radius: 8px;
  color: var(--ink-700);
  font-size: 11px;
  background: #fff;
}

.filter-control:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(37,131,237,.1);
}

.search-control {
  position: relative;
  flex: 1 1 230px;
  max-width: 360px;
}

.search-control svg {
  position: absolute;
  top: 9px;
  left: 11px;
  width: 17px;
  height: 17px;
  color: var(--ink-400);
}

.search-control input {
  width: 100%;
  padding-left: 35px;
}

.form-group > .search-control {
  display: block;
  max-width: none;
}

.filter-spacer {
  flex: 1;
}

.table-panel {
  overflow: hidden;
}

.table-meta {
  color: var(--ink-400);
  font-size: 10px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

.data-table th,
.data-table td {
  height: 52px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  height: 41px;
  color: var(--ink-500);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .02em;
  background: var(--ink-50);
}

.data-table td {
  color: var(--ink-600);
  font-size: 10px;
}

.data-table tbody tr {
  transition: background .15s;
}

.data-table tbody tr:hover {
  background: #fafcff;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table .primary-cell {
  color: var(--ink-900);
  font-weight: 650;
}

.data-table .link-cell {
  color: var(--primary-600);
  font-weight: 650;
  cursor: pointer;
}

.data-table .link-cell:hover {
  text-decoration: underline;
}

.sub-cell {
  display: block;
  margin-top: 1px;
  color: var(--ink-400);
  font-size: 8px;
  font-weight: 400;
}

.truncate-cell {
  display: block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.person-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mini-avatar {
  display: grid;
  width: 29px;
  height: 29px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  color: var(--primary-700);
  font-size: 10px;
  font-weight: 700;
  background: var(--primary-50);
}

.mini-avatar.green { color: var(--green-600); background: var(--green-50); }
.mini-avatar.purple { color: var(--purple-600); background: #f5f3ff; }
.mini-avatar.amber { color: var(--amber-600); background: var(--amber-50); }

.person-cell strong,
.person-cell small {
  display: block;
}

.person-cell strong {
  color: var(--ink-800);
  font-size: 10px;
}

.person-cell small {
  color: var(--ink-400);
  font-size: 8px;
}

.status-badge,
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 650;
  line-height: 1.35;
}

.status-badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.status-pending { color: var(--amber-600); background: var(--amber-50); }
.status-assigned { color: var(--primary-600); background: var(--primary-50); }
.status-processing { color: var(--purple-600); background: #f5f3ff; }
.status-completed { color: var(--green-600); background: var(--green-50); }
.status-cancelled { color: var(--ink-500); background: var(--ink-100); }
.status-exception { color: var(--red-600); background: var(--red-50); }
.status-enabled { color: var(--green-600); background: var(--green-50); }
.status-disabled { color: var(--ink-500); background: var(--ink-100); }
.status-draft { color: var(--ink-500); background: var(--ink-100); }
.status-published { color: var(--green-600); background: var(--green-50); }

.tag {
  margin: 1px 3px 1px 0;
  color: var(--ink-600);
  background: var(--ink-100);
}

.tag.blue { color: var(--primary-700); background: var(--primary-50); }
.tag.red { color: var(--red-600); background: var(--red-50); }
.tag.green { color: var(--green-600); background: var(--green-50); }
.tag.amber { color: var(--amber-600); background: var(--amber-50); }

.stars {
  display: inline-flex;
  gap: 1px;
  color: #f59e0b;
  font-size: 12px;
  letter-spacing: -1px;
}

.stars .empty-star {
  color: var(--ink-200);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 55px;
  padding: 9px 14px;
  border-top: 1px solid var(--border);
}

.pagination-info {
  color: var(--ink-400);
  font-size: 9px;
}

.pagination-buttons {
  display: flex;
  gap: 4px;
}

.page-button {
  display: grid;
  min-width: 29px;
  height: 29px;
  padding: 0 7px;
  border: 1px solid var(--border);
  place-items: center;
  border-radius: 7px;
  color: var(--ink-500);
  font-size: 10px;
  background: #fff;
}

.page-button:hover:not(:disabled),
.page-button.active {
  color: var(--primary-700);
  border-color: var(--primary-100);
  background: var(--primary-50);
}

.tabs {
  display: flex;
  gap: 22px;
  margin-bottom: 14px;
  padding: 0 2px;
  border-bottom: 1px solid var(--border);
}

.tab-button {
  position: relative;
  padding: 10px 2px 12px;
  border: 0;
  color: var(--ink-500);
  font-size: 12px;
  background: transparent;
}

.tab-button.active {
  color: var(--primary-700);
  font-weight: 700;
}

.tab-button.active::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--primary-600);
}

.tab-count {
  margin-left: 4px;
  padding: 1px 5px;
  border-radius: 999px;
  font-size: 8px;
  background: var(--ink-100);
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 14px;
}

.detail-section {
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.detail-section:last-child {
  margin-bottom: 0;
}

.detail-section-head {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
}

.detail-section-head h4 {
  margin: 0;
  color: var(--ink-900);
  font-size: 12px;
}

.detail-section-body {
  padding: 14px;
}

.description-box {
  margin: 0;
  padding: 12px;
  border-radius: 8px;
  color: var(--ink-600);
  font-size: 11px;
  line-height: 1.75;
  background: var(--ink-50);
  white-space: pre-wrap;
}

.attachment-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.attachment-card {
  display: grid;
  min-width: 0;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: inherit;
  text-align: left;
  background: #fff;
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.attachment-card:hover,
.attachment-card:focus-visible {
  border-color: var(--primary-300);
  outline: none;
  box-shadow: 0 5px 18px rgba(20, 115, 230, .09);
  transform: translateY(-1px);
}

.attachment-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  color: var(--primary-600);
  background: var(--primary-50);
}

.attachment-icon svg,
.attachment-action svg {
  width: 15px;
  height: 15px;
}

.attachment-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.attachment-copy strong {
  overflow: hidden;
  color: var(--ink-800);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-copy small,
.attachment-copy time {
  color: var(--ink-400);
  font-size: 8px;
}

.attachment-action {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--primary-600);
  font-size: 9px;
  font-weight: 650;
}

.attachment-loading {
  min-height: 360px;
}

.attachment-loading p {
  margin: 0;
  color: var(--ink-400);
  font-size: 9px;
}

.attachment-preview {
  display: grid;
  min-height: 360px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--ink-50);
}

.attachment-preview-image,
.attachment-preview-media {
  display: block;
  max-width: 100%;
  max-height: 62vh;
  object-fit: contain;
}

.attachment-preview-frame {
  width: 100%;
  min-height: 62vh;
  border: 0;
  background: #fff;
}

.attachment-preview-audio {
  width: min(520px, 90%);
}

.attachment-generic {
  display: flex;
  align-items: center;
  flex-direction: column;
  color: var(--ink-500);
  text-align: center;
}

.attachment-generic svg {
  width: 42px;
  height: 42px;
  margin-bottom: 12px;
  color: var(--primary-500);
}

.attachment-generic strong {
  color: var(--ink-800);
  font-size: 12px;
}

.attachment-generic p {
  margin: 6px 0 0;
  font-size: 10px;
}

.attachment-preview-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.attachment-preview-meta > span {
  color: var(--ink-400);
  font-size: 9px;
}

.kv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 20px;
}

.kv-grid.single {
  grid-template-columns: 1fr;
}

.kv-item dt {
  margin-bottom: 3px;
  color: var(--ink-400);
  font-size: 9px;
}

.kv-item dd {
  margin: 0;
  color: var(--ink-800);
  font-size: 11px;
  word-break: break-word;
}

.cost-table {
  width: 100%;
  border-collapse: collapse;
}

.cost-table td {
  padding: 8px 4px;
  border-bottom: 1px dashed var(--border);
  color: var(--ink-500);
  font-size: 10px;
}

.cost-table td:last-child {
  color: var(--ink-800);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.cost-table tr.total td {
  border-bottom: 0;
  color: var(--ink-950);
  font-size: 12px;
  font-weight: 700;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 10px;
  padding-bottom: 20px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: -2px;
  left: 6px;
  width: 1px;
  background: var(--ink-200);
}

.timeline-item:last-child::before {
  display: none;
}

.timeline-dot {
  position: relative;
  z-index: 1;
  width: 13px;
  height: 13px;
  margin-top: 3px;
  border: 3px solid var(--primary-100);
  border-radius: 50%;
  background: var(--primary-600);
}

.timeline-item:first-child .timeline-dot {
  box-shadow: 0 0 0 4px var(--primary-50);
}

.timeline-content strong,
.timeline-content time,
.timeline-content span {
  display: block;
}

.timeline-content strong {
  color: var(--ink-800);
  font-size: 10px;
}

.timeline-content span {
  margin-top: 2px;
  color: var(--ink-500);
  font-size: 9px;
  line-height: 1.6;
}

.timeline-content time {
  margin-top: 3px;
  color: var(--ink-400);
  font-size: 8px;
}

.progress-row {
  margin: 11px 0;
}

.progress-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
  color: var(--ink-500);
  font-size: 9px;
}

.progress-label strong {
  color: var(--ink-700);
  font-weight: 650;
}

.progress-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--ink-100);
}

.progress-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary-500), var(--cyan-500));
}

.rating-summary {
  display: flex;
  align-items: center;
  gap: 19px;
}

.rating-score {
  min-width: 95px;
  text-align: center;
}

.rating-score strong {
  display: block;
  color: var(--ink-950);
  font-size: 34px;
  line-height: 1;
}

.rating-score span {
  color: var(--ink-400);
  font-size: 9px;
}

.settings-layout {
  display: grid;
  grid-template-columns: 185px minmax(0, 1fr);
  gap: 15px;
}

.settings-nav {
  align-self: start;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.settings-nav button {
  display: flex;
  width: 100%;
  min-height: 40px;
  align-items: center;
  gap: 9px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  color: var(--ink-500);
  font-size: 11px;
  text-align: left;
  background: transparent;
}

.settings-nav button:hover,
.settings-nav button.active {
  color: var(--primary-700);
  background: var(--primary-50);
}

.settings-nav button.active {
  font-weight: 700;
}

.settings-nav svg {
  width: 16px;
  height: 16px;
}

.settings-content {
  min-width: 0;
}

.settings-card {
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.settings-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 17px;
  border-bottom: 1px solid var(--border);
}

.settings-card-head h3 {
  margin: 0;
  color: var(--ink-900);
  font-size: 13px;
}

.settings-card-head p {
  margin: 2px 0 0;
  color: var(--ink-400);
  font-size: 9px;
}

.settings-card-body {
  padding: 17px;
}

.settings-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 13px 17px;
  border-top: 1px solid var(--border);
  background: var(--ink-50);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}

.form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-group {
  min-width: 0;
}

.form-group.full {
  grid-column: 1 / -1;
}

.form-grid > .notice-card.full {
  grid-column: 1 / -1;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-700);
  font-size: 10px;
  font-weight: 650;
}

.form-hint {
  display: block;
  margin-top: 5px;
  color: var(--ink-400);
  font-size: 8px;
}

.form-control {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--ink-200);
  outline: 0;
  border-radius: 8px;
  color: var(--ink-800);
  font-size: 11px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}

textarea.form-control {
  min-height: 88px;
  resize: vertical;
  line-height: 1.65;
}

select.form-control {
  padding-right: 28px;
}

.input-group {
  display: flex;
}

.input-group .form-control {
  border-radius: 8px 0 0 8px;
}

.input-addon {
  display: flex;
  min-width: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid var(--ink-200);
  border-left: 0;
  border-radius: 0 8px 8px 0;
  color: var(--ink-500);
  font-size: 9px;
  background: var(--ink-50);
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.switch-row:last-child {
  border-bottom: 0;
}

.switch-copy strong,
.switch-copy span {
  display: block;
}

.switch-copy strong {
  color: var(--ink-800);
  font-size: 10px;
}

.switch-copy span {
  margin-top: 2px;
  color: var(--ink-400);
  font-size: 8px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 39px;
  height: 22px;
  flex: 0 0 auto;
}

.switch input {
  position: absolute;
  opacity: 0;
}

.switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--ink-300);
  transition: background .2s;
}

.switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(15,23,42,.2);
  transition: transform .2s;
}

.switch input:checked + span {
  background: var(--primary-600);
}

.switch input:checked + span::after {
  transform: translateX(17px);
}

.permission-grid {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 9px;
}

.permission-row {
  display: grid;
  grid-template-columns: 170px repeat(4, minmax(70px, 1fr));
  align-items: center;
  min-height: 42px;
  border-bottom: 1px solid var(--border);
}

.permission-row:last-child {
  border-bottom: 0;
}

.permission-row.header {
  color: var(--ink-500);
  font-size: 9px;
  font-weight: 700;
  background: var(--ink-50);
}

.permission-row > span,
.permission-row > label {
  padding: 8px 12px;
  text-align: center;
}

.permission-row > span:first-child {
  color: var(--ink-700);
  text-align: left;
}

.permission-row input {
  width: 15px;
  height: 15px;
  accent-color: var(--primary-600);
}

.area-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.area-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border: 1px solid var(--primary-100);
  border-radius: 7px;
  color: var(--primary-700);
  font-size: 9px;
  background: var(--primary-50);
}

.area-tag button {
  display: grid;
  width: 14px;
  height: 14px;
  padding: 0;
  border: 0;
  place-items: center;
  color: var(--primary-500);
  background: transparent;
}

.empty-state,
.error-state,
.permission-state,
.page-loading {
  display: flex;
  min-height: 360px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 42px 20px;
  text-align: center;
}

.empty-illustration,
.error-illustration,
.permission-illustration {
  display: grid;
  width: 62px;
  height: 62px;
  margin-bottom: 15px;
  place-items: center;
  border-radius: 18px;
  color: var(--ink-400);
  background: var(--ink-100);
}

.error-illustration {
  color: var(--red-600);
  background: var(--red-50);
}

.permission-illustration {
  color: var(--amber-600);
  background: var(--amber-50);
}

.empty-illustration svg,
.error-illustration svg,
.permission-illustration svg {
  width: 29px;
  height: 29px;
}

.empty-state h3,
.error-state h3,
.permission-state h3 {
  margin: 0;
  color: var(--ink-800);
  font-size: 14px;
}

.empty-state p,
.error-state p,
.permission-state p {
  max-width: 440px;
  margin: 6px 0 17px;
  color: var(--ink-400);
  font-size: 10px;
  line-height: 1.7;
}

.page-loading {
  color: var(--ink-500);
}

.page-loading strong,
.page-loading small {
  display: block;
}

.page-loading strong {
  margin-top: 13px;
  color: var(--ink-700);
  font-size: 12px;
}

.page-loading small {
  margin-top: 3px;
  color: var(--ink-400);
  font-size: 9px;
}

.spinner {
  width: 29px;
  height: 29px;
  border: 3px solid var(--primary-100);
  border-top-color: var(--primary-600);
  border-radius: 50%;
  animation: spin .75s linear infinite;
}

.button .spinner {
  width: 15px;
  height: 15px;
  border-width: 2px;
  border-color: rgba(255,255,255,.35);
  border-top-color: #fff;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: 5px;
  color: transparent !important;
  background: var(--ink-100);
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.3s infinite;
}

@keyframes shimmer {
  to { transform: translateX(100%); }
}

.modal-root {
  position: relative;
  z-index: 200;
}

.modal-layer {
  position: fixed;
  inset: 0;
  display: grid;
  overflow-y: auto;
  padding: 28px;
  place-items: center;
  background: rgba(11,18,32,.58);
  backdrop-filter: blur(3px);
  animation: fade-in .16s ease;
}

.modal-layer.drawer-layer {
  place-items: stretch end;
  padding: 0;
}

@keyframes fade-in {
  from { opacity: 0; }
}

.modal {
  width: min(560px, 100%);
  max-height: calc(100vh - 56px);
  overflow: hidden;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-lg);
  animation: modal-in .2s ease;
}

.modal.wide {
  width: min(840px, 100%);
}

.modal.large {
  width: min(1050px, 100%);
}

.drawer {
  width: min(760px, 100vw);
  height: 100vh;
  overflow: hidden;
  background: var(--page);
  box-shadow: -18px 0 60px rgba(11,18,32,.24);
  animation: drawer-in .22s ease;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(9px) scale(.985); }
}

@keyframes drawer-in {
  from { transform: translateX(100%); }
}

.modal-head,
.drawer-head {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.modal-head h3,
.drawer-head h3 {
  margin: 0;
  color: var(--ink-950);
  font-size: 15px;
}

.modal-head p,
.drawer-head p {
  margin: 2px 0 0;
  color: var(--ink-400);
  font-size: 9px;
}

.modal-body {
  max-height: calc(100vh - 185px);
  overflow-y: auto;
  padding: 18px;
}

.drawer-body {
  height: calc(100vh - 62px);
  overflow-y: auto;
  padding: 16px;
}

.modal-foot {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 18px;
  border-top: 1px solid var(--border);
  background: var(--ink-50);
}

.confirm-modal {
  width: min(410px, 100%);
  padding: 24px;
  text-align: center;
}

.confirm-icon {
  display: grid;
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  place-items: center;
  border-radius: 15px;
  color: var(--amber-600);
  background: var(--amber-50);
}

.confirm-icon.danger {
  color: var(--red-600);
  background: var(--red-50);
}

.confirm-icon svg {
  width: 25px;
  height: 25px;
}

.confirm-modal h3 {
  margin: 0;
  color: var(--ink-900);
  font-size: 15px;
}

.confirm-modal p {
  margin: 7px 0 20px;
  color: var(--ink-500);
  font-size: 10px;
  line-height: 1.7;
}

.confirm-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
}

body.modal-open {
  overflow: hidden;
}

.toast-root {
  position: fixed;
  z-index: 400;
  top: 84px;
  right: 20px;
  display: flex;
  width: min(360px, calc(100vw - 40px));
  flex-direction: column;
  gap: 9px;
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 9px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow-md);
  pointer-events: auto;
  animation: toast-in .24s ease;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(15px); }
}

.toast-icon {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 8px;
  color: var(--green-600);
  background: var(--green-50);
}

.toast.error .toast-icon { color: var(--red-600); background: var(--red-50); }
.toast.warning .toast-icon { color: var(--amber-600); background: var(--amber-50); }
.toast.info .toast-icon { color: var(--primary-600); background: var(--primary-50); }

.toast-icon svg {
  width: 15px;
  height: 15px;
}

.toast-copy strong,
.toast-copy span {
  display: block;
}

.toast-copy strong {
  color: var(--ink-800);
  font-size: 10px;
}

.toast-copy span {
  margin-top: 1px;
  color: var(--ink-500);
  font-size: 9px;
}

.toast-close {
  width: 24px;
  height: 24px;
}

.sidebar-backdrop {
  display: none;
}

.notice-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--primary-100);
  border-radius: 9px;
  color: var(--ink-600);
  font-size: 10px;
  background: var(--primary-50);
}

.notice-card svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  color: var(--primary-600);
}

.notice-card strong {
  display: block;
  margin-bottom: 2px;
  color: var(--primary-700);
}

.registration-security-notice {
  margin-bottom: 14px;
}

.registration-code-cell,
.registration-code-cell small {
  display: block;
}

.registration-code-cell code {
  display: inline-block;
  padding: 5px 8px;
  border: 1px solid var(--ink-200);
  border-radius: 7px;
  color: var(--ink-800);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .05em;
  white-space: nowrap;
  background: var(--ink-50);
}

.registration-code-cell small {
  margin-top: 4px;
  color: var(--ink-400);
  font-size: 8px;
}

.registration-note {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.generated-code-panel {
  padding: 8px 0 20px;
  text-align: center;
}

.generated-code-panel > strong {
  display: block;
  margin-top: 10px;
  color: var(--ink-900);
  font-size: 18px;
}

.generated-code-panel > p {
  max-width: 520px;
  margin: 6px auto 18px;
  color: var(--ink-500);
  font-size: 11px;
}

.generated-code-icon {
  display: grid;
  width: 46px;
  height: 46px;
  margin: 0 auto;
  place-items: center;
  border-radius: 50%;
  color: var(--green-600);
  background: var(--green-50);
}

.generated-code-icon svg {
  width: 24px;
  height: 24px;
  stroke-width: 2.3;
}

.generated-code-value {
  display: flex;
  max-width: 560px;
  margin: 0 auto;
  padding: 10px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--primary-100);
  border-radius: 12px;
  background: var(--primary-50);
}

.generated-code-value code {
  min-width: 0;
  flex: 1;
  color: var(--primary-700);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 17px;
  font-weight: 750;
  letter-spacing: .08em;
  overflow-wrap: anywhere;
}

.generated-code-meta {
  display: grid;
  max-width: 560px;
  margin: 14px auto 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  text-align: left;
}

.generated-code-meta div {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
}

.generated-code-meta dt {
  color: var(--ink-400);
  font-size: 8px;
}

.generated-code-meta dd {
  margin: 2px 0 0;
  color: var(--ink-800);
  font-size: 10px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

@media (max-width: 640px) {
  .generated-code-value {
    align-items: stretch;
    flex-direction: column;
  }

  .generated-code-value code {
    padding: 6px 0;
    font-size: 14px;
  }

  .generated-code-meta {
    grid-template-columns: 1fr;
  }
}

.metric-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-variant-numeric: tabular-nums;
}

.metric-inline.good { color: var(--green-600); }
.metric-inline.warn { color: var(--amber-600); }
.metric-inline.bad { color: var(--red-600); }

.mobile-card-list {
  display: none;
}

@media (max-width: 1180px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid,
  .dashboard-bottom {
    grid-template-columns: 1fr;
  }

  .donut-layout {
    grid-template-columns: auto minmax(140px, 1fr);
    gap: 28px;
    min-height: 210px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .login-view {
    grid-template-columns: 1fr;
  }

  .login-visual {
    display: none;
  }

  .login-panel {
    position: relative;
    min-height: 100vh;
    padding: 44px 24px;
    background:
      radial-gradient(circle at 100% 0, rgba(37,131,237,.1), transparent 33%),
      #fff;
  }

  .login-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .32;
    pointer-events: none;
    background-image: linear-gradient(var(--ink-100) 1px, transparent 1px), linear-gradient(90deg, var(--ink-100) 1px, transparent 1px);
    background-size: 46px 46px;
    mask-image: linear-gradient(to bottom, black, transparent 58%);
  }

  .login-card,
  .login-mobile-brand {
    position: relative;
    z-index: 1;
  }

  .login-mobile-brand {
    position: absolute;
    top: 28px;
    left: 28px;
    display: flex;
    gap: 10px;
    color: var(--ink-900);
  }

  .sidebar {
    width: min(270px, 84vw);
    transform: translateX(-100%);
  }

  .app.mobile-nav-open .sidebar {
    transform: translateX(0);
  }

  .app.sidebar-is-collapsed .sidebar {
    width: min(270px, 84vw);
  }

  .app.sidebar-is-collapsed .sidebar-brand {
    padding: 0 17px;
  }

  .app.sidebar-is-collapsed .sidebar-brand > div,
  .app.sidebar-is-collapsed .nav-item span:not(.nav-badge),
  .app.sidebar-is-collapsed .nav-badge,
  .app.sidebar-is-collapsed .nav-lock,
  .app.sidebar-is-collapsed .nav-group-label,
  .app.sidebar-is-collapsed .service-health div,
  .app.sidebar-is-collapsed .version {
    display: block;
  }

  .app.sidebar-is-collapsed .nav-item {
    justify-content: flex-start;
    padding: 0 12px;
  }

  .app.sidebar-is-collapsed .service-health {
    justify-content: flex-start;
    padding: 9px;
  }

  .sidebar-collapse {
    right: 12px;
    display: inline-grid !important;
    color: #94a3b8;
    border-color: rgba(255,255,255,.12);
    box-shadow: none;
  }

  .app.sidebar-is-collapsed .sidebar-collapse svg {
    transform: none;
  }

  .sidebar-backdrop {
    position: fixed;
    z-index: 45;
    inset: 0;
    display: block;
    background: rgba(11,18,32,.48);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
  }

  .app.mobile-nav-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .workspace,
  .app.sidebar-is-collapsed .workspace {
    margin-left: 0;
  }

  .mobile-menu {
    display: inline-grid;
  }

  .settings-layout {
    grid-template-columns: 1fr;
  }

  .settings-nav {
    display: flex;
    overflow-x: auto;
  }

  .settings-nav button {
    width: auto;
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .permission-grid {
    overflow-x: auto;
  }

  .permission-row {
    min-width: 600px;
  }
}

@media (max-width: 680px) {
  :root {
    --topbar-height: 64px;
  }

  .topbar {
    padding: 0 14px;
  }

  .topbar-left > div {
    display: block;
  }

  .topbar h1 {
    font-size: 16px;
  }

  .topbar-left p,
  .profile-copy,
  .profile-button > svg,
  .topbar-actions > #refreshButton {
    display: none;
  }

  .profile-menu-wrap {
    margin-left: 4px;
    padding-left: 9px;
  }

  .view {
    padding: 18px 14px 28px;
  }

  .attachment-grid {
    grid-template-columns: 1fr;
  }

  .attachment-preview {
    min-height: 280px;
  }

  .attachment-preview-meta {
    align-items: stretch;
    flex-direction: column;
  }

  .global-banner {
    margin-right: 14px;
    margin-left: 14px;
  }

  .workspace-footer {
    padding: 0 14px 18px;
  }

  .workspace-footer span:last-child {
    display: none;
  }

  .page-head {
    align-items: stretch;
    flex-direction: column;
  }

  .page-actions {
    flex-wrap: wrap;
  }

  .page-actions .button {
    flex: 1;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .stat-card {
    padding: 15px;
  }

  .stat-value {
    font-size: 24px;
  }

  .dashboard-grid,
  .dashboard-bottom {
    gap: 12px;
  }

  .panel-head {
    padding: 0 14px;
  }

  .chart-wrap {
    height: 220px;
  }

  .donut-layout {
    grid-template-columns: 1fr;
  }

  .quick-list {
    grid-template-columns: 1fr;
  }

  .filter-row {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-spacer {
    display: none;
  }

  .filter-control,
  .search-control {
    width: 100%;
    max-width: none;
  }

  .filter-row .button {
    width: 100%;
  }

  .data-table {
    min-width: 780px;
  }

  .pagination {
    align-items: flex-start;
    flex-direction: column;
  }

  .form-grid,
  .form-grid.three,
  .kv-grid {
    grid-template-columns: 1fr;
  }

  .rating-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .modal-layer {
    padding: 12px;
    place-items: end center;
  }

  .modal {
    max-height: calc(100vh - 24px);
    border-radius: 15px;
  }

  .modal-body {
    max-height: calc(100vh - 150px);
  }

  .drawer {
    width: 100vw;
  }

  .tabs {
    overflow-x: auto;
  }

  .tab-button {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}

@media (max-width: 430px) {
  .login-panel {
    align-items: flex-start;
    padding: 116px 20px 36px;
  }

  .login-card header {
    margin-bottom: 30px;
  }

  .login-card h2 {
    font-size: 27px;
  }

  .login-options > span {
    display: none;
  }

  .toast-root {
    top: 72px;
    right: 12px;
    width: calc(100vw - 24px);
  }

  .mock-badge {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

@media print {
  .sidebar,
  .topbar,
  .workspace-footer,
  .page-actions,
  .filter-card,
  .pagination {
    display: none !important;
  }

  .workspace {
    margin: 0 !important;
  }

  .view {
    padding: 0;
  }

  .panel,
  .stat-card {
    break-inside: avoid;
    box-shadow: none;
  }
}

.device-workflow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  padding: 18px 20px;
  border: 1px solid var(--slate-200);
  border-radius: 13px;
  background: linear-gradient(135deg, #fff, #f8fbff);
  box-shadow: var(--shadow-sm);
}

.device-workflow > div {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 2px 11px;
  align-items: center;
}

.device-workflow > div > span {
  grid-row: 1 / span 2;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  background: linear-gradient(145deg, var(--blue-500), var(--blue-700));
  box-shadow: 0 7px 16px rgba(20,115,230,.2);
}

.device-workflow strong { color: var(--ink-900); font-size: 13px; }
.device-workflow small { color: var(--slate-500); font-size: 10px; line-height: 1.45; }
.device-workflow > i { color: var(--slate-300); font-size: 19px; font-style: normal; }
.device-security-note { margin-bottom: 14px; }
.device-table { min-width: 1040px; }
.mini-avatar.blue { color: var(--blue-600); background: var(--blue-50); }
.mini-avatar svg { width: 17px; height: 17px; }

.device-handover-device {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 16px;
  border: 1px solid var(--blue-100);
  border-radius: 11px;
  background: var(--blue-50);
}

.device-handover-device > svg { width: 26px; height: 26px; color: var(--blue-600); }
.device-handover-device strong,
.device-handover-device span { display: block; }
.device-handover-device strong { color: var(--ink-900); font-size: 13px; }
.device-handover-device span { margin-top: 3px; color: var(--slate-500); font-size: 10px; }
.device-handover-confirm { padding: 13px 14px; border: 1px solid var(--amber-200); border-radius: 10px; background: var(--amber-50); }

.device-qr-layout {
  display: grid;
  grid-template-columns: minmax(240px, .75fr) minmax(0, 1.25fr);
  gap: 22px;
  align-items: start;
}

.device-qr-print {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 22px;
  border: 1px solid var(--slate-200);
  border-radius: 14px;
  text-align: center;
  background: #fff;
}

.device-qr-print > strong { margin-top: 14px; color: var(--ink-900); font-size: 14px; }
.device-qr-print > span { margin-top: 4px; color: var(--slate-600); font-size: 11px; }
.device-qr-print > small { margin-top: 10px; color: var(--slate-500); font-size: 9px; }
.device-qr-image { display: grid; width: 210px; height: 210px; place-items: center; overflow: hidden; border-radius: 12px; background: var(--slate-50); }
.device-qr-image img { display: block; width: 100%; height: 100%; object-fit: contain; }
.device-qr-image-loading,
.device-qr-unavailable { display: flex; width: 100%; height: 100%; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 18px; color: var(--slate-500); }
.device-qr-unavailable svg { width: 34px; height: 34px; color: var(--blue-500); }
.device-qr-unavailable strong { color: var(--ink-900); font-size: 12px; }
.device-qr-unavailable p { margin: 0; font-size: 9px; line-height: 1.6; }
.device-qr-meta { min-width: 0; }
.device-qr-meta .kv-grid { margin: 16px 0; }
.device-qr-path { min-height: 76px; word-break: break-all; }
.device-qr-actions { justify-content: flex-start; margin-top: 15px; }

@media (max-width: 760px) {
  .device-workflow { grid-template-columns: 1fr; }
  .device-workflow > i { display: none; }
  .device-qr-layout { grid-template-columns: 1fr; }
  .device-qr-print { max-width: 360px; margin: 0 auto; }
}

@media print {
  body * { visibility: hidden !important; }
  #deviceQrPrintArea,
  #deviceQrPrintArea * { visibility: visible !important; }
  #deviceQrPrintArea {
    position: fixed;
    inset: 0;
    width: 76mm;
    height: auto;
    margin: 0;
    padding: 8mm;
    border: 0;
  }
}
