:root {
  --bg: #edf3f8;
  --panel: #ffffff;
  --soft: #f6f8fb;
  --line: #e2e8f0;
  --text: #172033;
  --muted: #64748b;
  --blue: #2f6eea;
  --blue-2: #1f56c7;
  --cyan: #0891b2;
  --green: #0f9f6e;
  --amber: #d97706;
  --red: #dc2626;
  --nav: #202c43;
  --nav-2: #2d3b57;
  --shadow: 0 14px 34px rgba(29, 40, 58, 0.09);
  --shadow-soft: 0 8px 22px rgba(29, 40, 58, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(180deg, #f7fafd 0%, var(--bg) 360px),
    var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

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

button {
  cursor: pointer;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.app[hidden],
.login-page[hidden] {
  display: none !important;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(90deg, rgba(32, 44, 67, 0.97) 0 36%, rgba(237, 243, 248, 0.76) 36% 100%),
    #edf3f8;
}

.login-panel {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 32px;
  box-shadow: 0 20px 50px rgba(23, 32, 51, 0.16);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

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

.login-brand strong {
  font-size: 17px;
}

.login-brand span,
.login-subtitle {
  color: var(--muted);
  font-size: 13px;
}

.login-panel h1 {
  font-size: 24px;
}

.login-subtitle {
  margin: 8px 0 24px;
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-form .field {
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 13px;
  font-weight: 600;
}

.login-form input {
  width: 100%;
  height: 42px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  padding: 0 12px;
  color: var(--text);
  outline: none;
}

.login-form input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 110, 234, 0.12);
}

.login-form input[aria-invalid="true"] {
  border-color: var(--red);
}

.login-error {
  margin: -4px 0 0;
  color: var(--red);
  font-size: 13px;
}

.login-submit {
  width: 100%;
  min-height: 42px;
  margin-top: 2px;
}

.sidebar {
  height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 26px 20px, rgba(79, 141, 247, 0.22), transparent 210px),
    linear-gradient(180deg, #202c43 0%, #172238 100%);
  color: #edf4ff;
  padding: 18px 14px 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 6px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 10px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, #60a5fa, #2563eb 58%, #0f766e);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.36);
  font-weight: 800;
  color: #ffffff;
}

.brand strong {
  font-size: 17px;
}

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

.brand span,
.sidebar-foot span {
  color: #aebbd0;
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 5px;
  overflow-y: auto;
  padding-right: 4px;
}

.nav button {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #cdd7e7;
  display: grid;
  grid-template-columns: 22px 1fr 16px;
  align-items: center;
  gap: 8px;
  padding: 0 10px 0 12px;
  text-align: left;
  position: relative;
  font-weight: 600;
}

.nav button:hover,
.nav button.active {
  background: linear-gradient(90deg, rgba(79, 141, 247, 0.22), rgba(49, 65, 95, 0.72));
  color: #ffffff;
}

.nav button.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 999px;
  background: #60a5fa;
  box-shadow: 0 0 12px rgba(96, 165, 250, 0.65);
}

.nav button > span:first-child {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
}

.nav .level-2 {
  padding-left: 34px;
  min-height: 36px;
  font-size: 13px;
  font-weight: 500;
  color: #b9c6d8;
}

.nav .level-3 {
  padding-left: 58px;
  min-height: 32px;
  font-size: 12px;
  color: #9fafc5;
  font-weight: 400;
}

.nav .level-2 > span:first-child,
.nav .level-3 > span:first-child {
  background: transparent;
  color: #7f91ad;
}

.nav .chev {
  color: #9aa8bd;
  text-align: right;
}

.sidebar-foot {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
  padding: 16px 8px 0;
}

.sidebar-foot[hidden] {
  display: none !important;
}

.sidebar-foot strong {
  margin-top: 6px;
}

.main {
  min-width: 0;
}

.topbar {
  height: 74px;
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(12px);
}

.crumb {
  margin-bottom: 4px;
  color: #8a98aa;
  font-size: 12px;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 25px;
  line-height: 1.2;
}

h2 {
  font-size: 19px;
}

h3 {
  font-size: 15px;
}

.user {
  min-width: 218px;
  min-height: 42px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  align-content: center;
  text-align: right;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  padding: 6px 12px;
  box-shadow: var(--shadow-soft);
}

.user span,
.user strong {
  display: block;
}

.user span {
  color: var(--muted);
  font-size: 12px;
}

.user-meta {
  min-width: 0;
}

.user-meta span,
.user-meta strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-logout {
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  padding: 4px 0 4px 12px;
  color: var(--blue-2);
  font-size: 12px;
  font-weight: 700;
}

.user-logout:hover,
.user-logout:focus-visible {
  color: var(--red);
  outline: none;
}

.content {
  padding: 22px 24px 28px;
}

.panel,
.card,
.list-card,
.filter,
.stat,
.cockpit-card {
  background: var(--panel);
  border: 1px solid rgba(226, 232, 240, 0.85);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 10px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-soft);
}

.filter input,
.filter select,
.field input,
.field select,
.field textarea {
  min-height: 38px;
  border: 1px solid #dcdfe6;
  border-radius: 7px;
  background: #ffffff;
  color: var(--text);
  padding: 0 12px;
}

.filter input {
  width: min(260px, 100%);
}

.filter select {
  width: min(180px, 100%);
}

.filter-gap {
  flex: 1;
  min-width: 12px;
}

.field textarea {
  min-height: 84px;
  padding: 8px 10px;
  resize: vertical;
}

.primary,
.ghost,
.danger-button,
.text-button,
.icon-button {
  border-radius: 7px;
  border: 1px solid transparent;
  min-height: 38px;
  padding: 0 14px;
}

.primary {
  background: linear-gradient(180deg, #3b82f6, var(--blue));
  color: #ffffff;
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.2);
}

.primary:hover {
  background: var(--blue-2);
}

.ghost {
  background: #f8fafc;
  color: var(--text);
  border-color: var(--line);
}

.ghost:hover {
  border-color: #bfdbfe;
  color: var(--blue);
  background: #ffffff;
}

.danger-button {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
  box-shadow: 0 8px 16px rgba(220, 38, 38, 0.18);
}

.danger-button:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--blue);
  padding: 0;
  min-height: 0;
  font-weight: 600;
}

.text-button.danger {
  color: var(--red);
}

.icon-button {
  width: 38px;
  padding: 0;
  display: grid;
  place-items: center;
  background: #ffffff;
  border-color: var(--line);
  color: var(--text);
  box-shadow: var(--shadow-soft);
}

.grid-4,
.grid-3,
.grid-2 {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}

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

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

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

.stat {
  min-height: 132px;
  padding: 16px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  border: 0;
}

.stat::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -34px;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  opacity: 0.12;
  background: currentColor;
}

.stat-top,
.stat span,
.stat strong,
.stat small,
.stat em {
  display: block;
}

.stat-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #ffffff;
  font-weight: 700;
  background: currentColor;
}

.stat-label {
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
}

.stat strong {
  margin: 13px 0 6px;
  font-size: 34px;
  line-height: 1;
}

.stat small {
  color: var(--muted);
  font-size: 13px;
}

.stat em {
  margin-top: 12px;
  color: #94a3b8;
  font-size: 12px;
  font-style: normal;
}

.stat-blue {
  color: #2563eb;
}

.stat-teal {
  color: #0891b2;
}

.stat-amber {
  color: #d97706;
}

.stat-red {
  color: #dc2626;
}

.stat-green {
  color: #0f9f6e;
}

.list-card {
  overflow: hidden;
  margin-bottom: 18px;
  border-color: rgba(226, 232, 240, 0.72);
  box-shadow: var(--shadow-soft);
}

.list-head {
  min-height: 62px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
}

.list-head strong {
  font-size: 16px;
}

.list-head .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 13px 12px;
  text-align: left;
  white-space: nowrap;
}

th {
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
  font-size: 13px;
}

td {
  font-size: 13px;
}

tbody tr:hover {
  background: #f8fbff;
}

td.wrap {
  max-width: 360px;
  white-space: normal;
  line-height: 1.5;
}

.pager {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 16px;
  color: var(--muted);
}

.pager button {
  min-width: 32px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
}

.pager button.active {
  color: #ffffff;
  background: var(--blue);
  border-color: var(--blue);
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 12px;
}

.success {
  background: #dcfce7;
  color: #047857;
}

.warning {
  background: #fef3c7;
  color: #92400e;
}

.danger {
  background: #fee2e2;
  color: #b91c1c;
}

.muted {
  background: #e5e7eb;
  color: #4b5563;
}

.workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 410px;
  gap: 18px;
}

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

.quick-action {
  min-height: 72px;
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  color: var(--text);
  padding: 0 12px;
  text-align: left;
  box-shadow: 0 6px 16px rgba(29, 40, 58, 0.04);
}

.quick-action:hover {
  border-color: #bfdbfe;
  background: #f8fbff;
}

.quick-action span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #eff6ff;
  color: var(--blue);
  font-weight: 700;
}

.quick-action strong {
  font-size: 14px;
}

.todo-row {
  display: grid;
  grid-template-columns: 72px 76px minmax(0, 1fr) 66px 48px;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
  font-size: 13px;
}

.todo-row.head {
  background: #f8fafc;
  color: #4b5563;
  font-weight: 600;
}

.todo-row span:nth-child(3) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cockpit {
  min-height: calc(100vh - 104px);
  padding: 16px;
  background:
    radial-gradient(circle at 16% 8%, rgba(21, 173, 226, 0.14), transparent 34%),
    linear-gradient(180deg, #060b2b 0%, #071534 54%, #061126 100%);
  color: #dff8ff;
}

.cockpit-head {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #ffffff;
}

.cockpit-head strong {
  position: relative;
  padding-left: 18px;
  font-size: 18px;
}

.cockpit-head strong::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 9px;
  height: 9px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: #22d3ee;
  box-shadow: 0 0 12px #22d3ee;
}

.cockpit-head span {
  color: #a9dff2;
}

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

.cockpit-card {
  min-height: 164px;
  grid-column: span 4;
  padding: 15px;
  border-color: rgba(56, 139, 190, 0.46);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(8, 22, 62, 0.98), rgba(5, 37, 72, 0.92)),
    radial-gradient(circle at 50% 110%, rgba(20, 184, 166, 0.14), transparent 54%);
  color: #dff8ff;
  box-shadow: inset 0 0 32px rgba(15, 118, 167, 0.2);
  overflow: hidden;
}

.cockpit-card:hover,
.compare-card:hover {
  border-color: rgba(34, 211, 238, 0.68);
}

.cockpit-card.small {
  grid-column: span 3;
}

.cockpit-card.wide {
  grid-column: span 6;
}

.cockpit-card h3 {
  color: #16dcff;
  margin-bottom: 14px;
  font-size: 16px;
}

.cockpit-kpis,
.bar-list {
  display: grid;
  gap: 10px;
}

.cockpit-kpis {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cockpit-kpis strong {
  display: block;
  color: #17e2ff;
  font-size: 30px;
  line-height: 1.08;
  text-shadow: 0 0 12px rgba(23, 226, 255, 0.32);
}

.cockpit-kpis [data-page] {
  cursor: pointer;
  border-radius: 4px;
  padding: 6px;
}

.cockpit-kpis [data-page]:hover {
  background: rgba(34, 211, 238, 0.08);
}

.meter-cockpit-card {
  cursor: pointer;
}

.meter-detail {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 8px 12px;
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid rgba(148, 221, 245, 0.18);
  color: #9ddff6;
  font-size: 13px;
}

.meter-detail strong {
  color: #dff8ff;
  font-size: 14px;
  font-weight: 600;
}

.meter-detail span:last-child {
  grid-column: 1 / -1;
  color: #73cce8;
}

.meter-note {
  display: grid;
  gap: 12px;
  align-content: start;
  color: #a9dff2;
}

.meter-note strong {
  color: #22e7ff;
  font-size: 18px;
}

.meter-note .cockpit-ghost {
  justify-self: start;
}

.line-spark {
  height: 98px;
  display: flex;
  align-items: end;
  gap: 12px;
  padding: 12px 4px 0;
}

.line-spark i {
  flex: 1;
  min-height: 18px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, #45c9ff, #0b82b6);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.22);
}

.bar {
  display: grid;
  grid-template-columns: 92px 1fr 48px;
  gap: 10px;
  align-items: center;
}

.bar i {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  overflow: hidden;
}

.bar i b {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, #38bdf8, #14b8a6);
}

.cockpit .table-wrap {
  margin-top: 0;
}

.cockpit table {
  min-width: 560px;
}

.cockpit th,
.cockpit td {
  border-bottom-color: rgba(148, 221, 245, 0.16);
  color: #dff8ff;
  padding: 10px 8px;
}

.cockpit th {
  background: rgba(255, 255, 255, 0.06);
  color: #9ddff6;
}

.cockpit tbody tr:hover {
  background: rgba(34, 211, 238, 0.06);
}

.inspection-compare-section {
  margin-top: 18px;
}

.compare-title {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px;
}

.compare-title span {
  display: block;
  color: #74d7f8;
  font-size: 12px;
}

.compare-title h2 {
  color: #ffffff;
  font-size: 20px;
}

.cockpit-ghost {
  background: rgba(255, 255, 255, 0.08);
  color: #dff8ff;
  border-color: rgba(116, 215, 248, 0.28);
}

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

.compare-card {
  min-height: 446px;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(56, 139, 190, 0.46);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(7, 20, 59, 0.98), rgba(5, 36, 68, 0.9)),
    radial-gradient(circle at 50% 110%, rgba(20, 184, 166, 0.12), transparent 50%);
  box-shadow: inset 0 0 28px rgba(15, 118, 167, 0.18);
  padding: 15px;
}

.compare-card header {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.compare-card header span {
  color: #9ddff6;
  font-size: 12px;
}

.compare-card header h3 {
  color: #12d7ff;
  margin-top: 3px;
  font-size: 16px;
}

.compare-card header strong {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #17e2ff;
  background:
    radial-gradient(circle at center, #071b3e 52%, transparent 53%),
    conic-gradient(#17e2ff 0 86%, rgba(255, 255, 255, 0.12) 86% 100%);
  font-size: 16px;
}

.photo-compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.photo-box {
  min-width: 0;
  display: grid;
  gap: 7px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  padding: 0;
}

.photo-box span {
  color: #ffffff;
  font-size: 12px;
}

.photo-box:hover .mock-device,
.photo-box:hover .uploaded-photo {
  border-color: rgba(23, 226, 255, 0.72);
  box-shadow:
    inset 0 0 0 1px rgba(23, 226, 255, 0.18),
    0 0 18px rgba(23, 226, 255, 0.14);
}

.uploaded-photo {
  width: 100%;
  height: 182px;
  display: block;
  object-fit: cover;
  border: 1px solid rgba(148, 221, 245, 0.34);
  border-radius: 6px;
  background: #0c1735;
}

.mock-device {
  height: 182px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(148, 221, 245, 0.28);
  border-radius: 6px;
  background: #0c1735;
}

.mock-device::before,
.mock-device::after {
  content: "";
  position: absolute;
}

.mock-device.power {
  background:
    linear-gradient(90deg, transparent 32%, rgba(255, 255, 255, 0.22) 33%, transparent 34%, transparent 65%, rgba(255, 255, 255, 0.22) 66%, transparent 67%),
    linear-gradient(180deg, #334155, #94a3b8);
}

.mock-device.power::before {
  inset: 20px 24px 34px;
  border: 2px solid #1e293b;
  background:
    linear-gradient(90deg, transparent 49%, #1e293b 50%, transparent 51%),
    linear-gradient(180deg, transparent 31%, #1e293b 32%, transparent 33%, transparent 65%, #1e293b 66%, transparent 67%);
}

.mock-device.power::after {
  width: 18px;
  height: 18px;
  right: 24px;
  bottom: 18px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 12px #22c55e;
}

.mock-device.fire {
  background: linear-gradient(180deg, #273244, #111827);
}

.mock-device.fire::before {
  inset: 24px 20px 58px;
  border-radius: 4px;
  background:
    radial-gradient(circle at 18% 70%, #22c55e 0 5px, transparent 6px),
    radial-gradient(circle at 34% 70%, #22c55e 0 5px, transparent 6px),
    radial-gradient(circle at 50% 70%, #f59e0b 0 5px, transparent 6px),
    linear-gradient(180deg, #0f172a 0 42%, #1e293b 43% 100%);
  border: 2px solid #64748b;
}

.mock-device.fire::after {
  left: 30px;
  right: 30px;
  bottom: 26px;
  height: 18px;
  border-radius: 3px;
  background: #ef4444;
}

.mock-device.elevator {
  background: linear-gradient(180deg, #475569, #1f2937);
}

.mock-device.elevator::before {
  left: 22px;
  top: 28px;
  width: 72px;
  height: 82px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #111827 0 26px, #94a3b8 27px 32px, transparent 33px);
}

.mock-device.elevator::after {
  right: 24px;
  top: 24px;
  width: 54px;
  height: 110px;
  border: 2px solid #94a3b8;
  background:
    linear-gradient(90deg, transparent 48%, #94a3b8 49%, transparent 51%),
    linear-gradient(180deg, #1e293b, #334155);
}

.mock-device.live {
  filter: contrast(0.94) brightness(0.92);
}

.mock-device.live::after {
  opacity: 0.88;
}

.check-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.check-tags span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #c8e5f4;
  font-size: 12px;
}

.compare-result {
  margin-top: auto;
  border-top: 1px solid rgba(148, 221, 245, 0.18);
  padding-top: 12px;
}

.compare-result b {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
}

.compare-result p {
  margin: 9px 0 0;
  color: #dff8ff;
  line-height: 1.6;
  font-size: 13px;
}

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

.field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.empty {
  min-height: 160px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: var(--soft);
}

.modal {
  width: min(760px, calc(100vw - 32px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.24);
}

.modal::backdrop {
  background: rgba(15, 23, 42, 0.36);
}

.modal form {
  margin: 0;
  background: #ffffff;
}

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

.modal-body {
  padding: 16px;
}

.modal-body > .primary {
  margin: 0 16px 16px;
}

.delete-confirm {
  padding: 8px 4px 18px;
}

.delete-confirm strong {
  display: block;
  color: var(--text);
  font-size: 16px;
}

.delete-confirm p {
  margin: 12px 0 6px;
  color: #475569;
  line-height: 1.6;
}

.delete-confirm span {
  color: var(--red);
  font-size: 13px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10;
  background: #111827;
  color: #ffffff;
  border-radius: 6px;
  padding: 10px 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.25);
}

@media (max-width: 1100px) {
  .grid-4,
  .grid-3,
  .grid-2,
  .workbench {
    grid-template-columns: 1fr;
  }

  .cockpit-card,
  .cockpit-card.small,
  .cockpit-card.wide,
  .compare-card {
    grid-column: span 12;
  }

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

  .filter-gap {
    display: none;
  }
}

@media (max-width: 760px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    height: auto;
    position: static;
  }

  .topbar {
    grid-template-columns: 34px 1fr;
    height: auto;
    min-height: 68px;
    padding: 10px 14px;
  }

  .user {
    display: grid;
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
  }

  .content {
    padding: 12px;
  }

  h1 {
    font-size: 21px;
  }

  .todo-row {
    grid-template-columns: 1fr;
  }

  .login-page {
    padding: 16px;
    background: #edf3f8;
  }

  .login-panel {
    padding: 24px;
  }
}

/* visual-only polish overrides - 2026-07-03 */
:root {
  --shadow-hover: 0 22px 48px rgba(29, 40, 58, 0.14);
}

body {
  background:
    radial-gradient(circle at 74% -8%, rgba(47, 110, 234, 0.10), transparent 340px),
    radial-gradient(circle at 20% 0%, rgba(8, 145, 178, 0.08), transparent 300px),
    linear-gradient(180deg, #f7fafd 0%, var(--bg) 360px),
    var(--bg);
}

.sidebar {
  background:
    radial-gradient(circle at 28px 24px, rgba(96, 165, 250, 0.30), transparent 215px),
    radial-gradient(circle at 180px 86%, rgba(20, 184, 166, 0.12), transparent 260px),
    linear-gradient(180deg, #1a2942 0%, #132038 62%, #101a2d 100%);
  box-shadow: 12px 0 34px rgba(15, 23, 42, 0.14);
}

.brand-mark {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 44%),
    linear-gradient(135deg, #60a5fa, #2563eb 58%, #0f766e);
}

.nav button {
  transition: transform 0.16s ease, background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.nav button:hover {
  transform: translateX(2px);
}

.nav button:hover,
.nav button.active {
  background: linear-gradient(90deg, rgba(79, 141, 247, 0.28), rgba(49, 65, 95, 0.82));
  box-shadow: inset 0 0 0 1px rgba(148, 196, 255, 0.08);
}

.topbar {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
}

.primary,
.ghost,
.icon-button,
.quick-action,
.stat,
.list-card,
.compare-card,
.cockpit-card {
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease,
    color 0.18s ease;
}

.primary:hover,
.ghost:hover,
.icon-button:hover,
.quick-action:hover {
  transform: translateY(-1px);
}

.stat {
  border: 1px solid rgba(226, 232, 240, 0.74);
  box-shadow: 0 10px 26px rgba(29, 40, 58, 0.07);
}

.stat::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0)),
    radial-gradient(circle at 88% 18%, currentColor, transparent 74px);
  opacity: 0.10;
}

.stat:hover,
.list-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.list-head {
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.78), rgba(255, 255, 255, 0));
}

th {
  background: #f7faff;
}

tbody tr:hover {
  background: #f5f9ff;
}

.quick-action:hover {
  box-shadow: 0 14px 26px rgba(29, 40, 58, 0.09);
}

/* cockpit-only visual polish - 2026-07-03 */
.cockpit {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 14% 8%, rgba(34, 211, 238, 0.20), transparent 32%),
    radial-gradient(circle at 86% 78%, rgba(20, 184, 166, 0.16), transparent 30%),
    linear-gradient(180deg, #05091f 0%, #071534 52%, #050d20 100%);
}

.cockpit::before,
.cockpit::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: 0;
}

.cockpit::before {
  inset: 0;
  background-image:
    linear-gradient(rgba(116, 215, 248, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(116, 215, 248, 0.055) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at center, #000 0%, transparent 78%);
}

.cockpit::after {
  left: 22px;
  right: 22px;
  top: 62px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.62), transparent);
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.38);
}

.cockpit-head,
.cockpit-grid,
.inspection-compare-section {
  position: relative;
  z-index: 1;
}

.cockpit-head {
  min-height: 58px;
  padding: 0 4px 6px;
}

.cockpit-head strong {
  letter-spacing: 0.04em;
  text-shadow: 0 0 16px rgba(34, 211, 238, 0.32);
}

.cockpit-head span {
  padding: 6px 10px;
  border: 1px solid rgba(116, 215, 248, 0.20);
  border-radius: 999px;
  background: rgba(8, 22, 62, 0.62);
}

.cockpit-card {
  border-color: rgba(74, 179, 224, 0.50);
  background:
    linear-gradient(180deg, rgba(8, 24, 68, 0.98), rgba(5, 35, 70, 0.92)),
    radial-gradient(circle at 86% 8%, rgba(34, 211, 238, 0.10), transparent 34%),
    radial-gradient(circle at 50% 118%, rgba(20, 184, 166, 0.18), transparent 54%);
  box-shadow:
    inset 0 0 34px rgba(15, 118, 167, 0.24),
    0 16px 28px rgba(0, 0, 0, 0.14);
}

.cockpit-card h3 {
  position: relative;
  padding-left: 12px;
  letter-spacing: 0.02em;
}

.cockpit-card h3::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  border-radius: 999px;
  background: #22d3ee;
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.72);
}

.cockpit-kpis strong {
  color: #22e7ff;
  text-shadow: 0 0 14px rgba(34, 231, 255, 0.34);
}

.line-spark {
  align-items: end;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0));
}

.line-spark i {
  background: linear-gradient(180deg, #7ddfff, #1284bc);
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.30);
}

.bar i {
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(148, 221, 245, 0.07);
}

.bar i b {
  background: linear-gradient(90deg, #38bdf8, #22d3ee 44%, #14b8a6);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.28);
}

.compare-title {
  margin-top: 4px;
  padding: 2px 4px 8px;
}

.compare-title h2 {
  text-shadow: 0 0 16px rgba(34, 211, 238, 0.26);
}

.compare-title span {
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.compare-card {
  border-color: rgba(74, 179, 224, 0.52);
  background:
    linear-gradient(180deg, rgba(7, 20, 59, 0.99), rgba(5, 36, 68, 0.93)),
    radial-gradient(circle at 50% 116%, rgba(20, 184, 166, 0.16), transparent 50%);
  box-shadow:
    inset 0 0 30px rgba(15, 118, 167, 0.22),
    0 16px 28px rgba(0, 0, 0, 0.15);
}

.compare-card header {
  border-bottom: 1px solid rgba(148, 221, 245, 0.12);
  padding-bottom: 10px;
}

.compare-card header strong {
  box-shadow:
    inset 0 0 14px rgba(23, 226, 255, 0.22),
    0 0 18px rgba(23, 226, 255, 0.18);
}

.photo-compare {
  gap: 12px;
}

.photo-box span {
  color: #c8f2ff;
  letter-spacing: 0.04em;
}

.mock-device {
  border-color: rgba(148, 221, 245, 0.34);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.035),
    inset 0 -28px 40px rgba(0, 0, 0, 0.16);
}

.mock-device.live {
  filter: contrast(0.97) brightness(0.94) saturate(0.94);
}

.check-tags span {
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(148, 221, 245, 0.10);
}

.compare-result {
  border-top-color: rgba(148, 221, 245, 0.22);
}

.compare-result p {
  color: #d9f6ff;
}

/* detailed device-room comparison polish - 2026-07-06 */
.compare-card {
  min-height: 586px;
}

.compare-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.compare-summary span {
  min-height: 28px;
  display: flex;
  align-items: center;
  border: 1px solid rgba(148, 221, 245, 0.12);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.055);
  color: #bfeeff;
  font-size: 12px;
  padding: 0 9px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-top: 12px;
}

.metric-grid div {
  min-width: 0;
  border: 1px solid rgba(148, 221, 245, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(34, 211, 238, 0.08), rgba(255, 255, 255, 0.035));
  padding: 8px 7px;
}

.metric-grid span,
.metric-grid strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-grid span {
  color: #8fdcf5;
  font-size: 11px;
}

.metric-grid strong {
  margin-top: 4px;
  color: #ffffff;
  font-size: 13px;
}

.risk-list {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  border: 1px solid rgba(245, 158, 11, 0.16);
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.055);
  padding: 10px;
}

.risk-list b {
  color: #fde68a;
  font-size: 12px;
}

.risk-list span {
  position: relative;
  color: #f7e4bd;
  font-size: 12px;
  line-height: 1.45;
  padding-left: 12px;
}

.risk-list span::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.45);
}

.compare-result em {
  display: block;
  margin-top: 8px;
  color: #a9dff2;
  font-size: 12px;
  font-style: normal;
  line-height: 1.55;
}

@media (max-width: 760px) {
  .compare-summary,
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Energy cockpit values must remain readable for long meter identifiers. */
.energy-cockpit .cockpit-kpis > div {
  min-width: 0;
}

.energy-cockpit .meter-cockpit-card .cockpit-kpis {
  grid-template-columns: minmax(84px, 0.65fr) minmax(0, 1.35fr);
  gap: 8px;
}

.energy-cockpit .meter-cockpit-card .cockpit-kpis strong {
  font-size: 25px;
}

.energy-cockpit .meter-cockpit-card .cockpit-kpis > div:first-child strong {
  font-size: 22px;
}

.energy-cockpit .meter-cockpit-card .cockpit-kpis > div:nth-child(2) strong {
  font-size: 18px;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.energy-cockpit .meter-cockpit-card .meter-detail strong {
  min-width: 0;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.energy-cockpit .cockpit-card.small .cockpit-kpis strong {
  font-size: 25px;
}

.energy-cockpit .cockpit-summary-card {
  grid-column: span 4;
  min-height: 164px;
  cursor: pointer;
}

.energy-cockpit .cockpit-summary-card:hover,
.energy-cockpit .cockpit-history-card:hover {
  border-color: rgba(34, 211, 238, 0.68);
}

.energy-cockpit .cockpit-summary-card .cockpit-kpis strong {
  font-size: 23px;
}

.energy-cockpit .cockpit-history-card {
  grid-column: span 4;
  min-height: 230px;
  cursor: pointer;
}

.cockpit-history-head,
.cockpit-history-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) 48px minmax(72px, 0.8fr);
  gap: 8px;
  align-items: center;
}

.cockpit-history-head {
  padding: 8px 9px;
  background: rgba(255, 255, 255, 0.05);
  color: #8fdcf5;
  font-size: 12px;
}

.cockpit-history-head span:last-child,
.cockpit-history-row strong {
  text-align: right;
}

.cockpit-history-body {
  display: grid;
}

.cockpit-history-row {
  min-height: 34px;
  border-bottom: 1px solid rgba(148, 221, 245, 0.14);
  padding: 6px 9px;
  color: #dff8ff;
  font-size: 12px;
}

.cockpit-history-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cockpit-history-row time {
  color: #9ddff6;
}

.cockpit-history-row strong {
  color: #22e7ff;
  font-size: 12px;
  white-space: nowrap;
}

.cockpit-history-empty {
  min-height: 132px;
  display: grid;
  place-items: center;
  color: #73a9bf;
  font-size: 13px;
}

.meter-type-switch {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(58px, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.meter-type-switch button {
  min-height: 34px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0 14px;
}

.meter-type-switch button:last-child {
  border-right: 0;
}

.meter-type-switch button.active {
  background: var(--blue);
  color: #ffffff;
}

@media (max-width: 1100px) {
  .energy-cockpit .cockpit-summary-card,
  .energy-cockpit .cockpit-history-card {
    grid-column: span 12;
  }
}
