:root {
  color-scheme: light;
  --bg: #eef3f7;
  --surface: #ffffff;
  --surface-soft: #f7fafc;
  --line: #d8e2ea;
  --line-strong: #c7d4df;
  --text: #172033;
  --muted: #637083;
  --teal: #0f766e;
  --teal-dark: #0b5e58;
  --blue: #2563eb;
  --green: #15803d;
  --amber: #b45309;
  --red: #b91c1c;
  --shadow: 0 16px 40px rgba(20, 35, 55, 0.1);
  --shadow-soft: 0 8px 24px rgba(20, 35, 55, 0.06);
  --radius: 8px;
}

.inspection-config-form {
  display: grid;
  gap: 22px;
}

.config-block,
.config-list {
  display: grid;
  gap: 12px;
}

.config-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.config-title-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.config-title h3 {
  margin: 0;
}

.config-row {
  display: grid;
  align-items: end;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 26px rgba(20, 72, 120, 0.08);
}

.window-row {
  grid-template-columns: repeat(4, minmax(120px, 1fr)) auto;
}

.item-row {
  grid-template-columns: 34px minmax(120px, 0.78fr) minmax(100px, 0.62fr) minmax(90px, 0.5fr) minmax(160px, 0.9fr) minmax(220px, 1.22fr) minmax(110px, 0.62fr) auto;
}

.config-block-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.testing-config-row {
  grid-template-columns: 34px minmax(120px, 1fr) minmax(150px, 1.15fr) minmax(100px, 0.75fr) auto;
}

.handover-config-row {
  grid-template-columns: 34px minmax(130px, 1fr) minmax(160px, 1.1fr) 86px 92px auto;
  align-items: start;
}

.handover-config-row label.wide {
  grid-column: 2 / span 4;
}

.handover-config-row .link-btn {
  align-self: end;
  justify-self: start;
  min-height: 42px;
  padding-inline: 14px;
}

.config-row label {
  display: grid;
  gap: 6px;
  color: #456070;
  font-size: 13px;
}

.config-row input,
.config-row select,
.config-row textarea {
  width: 100%;
  border: 1px solid rgba(84, 122, 148, 0.22);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.86);
  color: #123044;
  font: inherit;
}

.config-row textarea {
  resize: vertical;
}

.config-drag-handle {
  display: grid;
  width: 34px;
  min-height: 42px;
  place-items: center;
  align-self: center;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #6d8291;
  cursor: grab;
  touch-action: none;
}

.config-drag-handle::before {
  width: 14px;
  height: 20px;
  content: "";
  background-image:
    radial-gradient(circle, currentColor 1.45px, transparent 1.7px),
    radial-gradient(circle, currentColor 1.45px, transparent 1.7px);
  background-position: 1px 1px, 8px 1px;
  background-repeat: repeat-y;
  background-size: 6px 6px;
  opacity: 0.78;
}

.config-drag-handle:hover,
.config-drag-handle:focus-visible {
  border-color: rgba(14, 116, 144, 0.24);
  background: #edf9fd;
  color: #0e7490;
  outline: none;
}

.config-drag-handle:active {
  cursor: grabbing;
}

.config-sort-dragging {
  opacity: 0.54;
}

.config-sort-drop-before,
.config-sort-group.config-sort-drop-before > .config-row {
  box-shadow: inset 0 3px 0 #18a9c9, 0 12px 26px rgba(20, 72, 120, 0.08);
}

.config-sort-drop-after,
.config-sort-group.config-sort-drop-after > .config-row {
  box-shadow: inset 0 -3px 0 #18a9c9, 0 12px 26px rgba(20, 72, 120, 0.08);
}

.material-report-filter {
  grid-template-columns: repeat(6, minmax(130px, 1fr)) auto auto auto;
}

.material-adjust-modal {
  width: min(620px, calc(100vw - 36px));
}

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

.material-adjust-modal .form > label {
  display: grid;
  gap: 7px;
  color: #456070;
  font-size: 13px;
  font-weight: 800;
}

.material-adjust-modal .form input,
.material-adjust-modal .form textarea {
  width: 100%;
  border: 1px solid rgba(84, 122, 148, 0.22);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.9);
  color: #123044;
  font: inherit;
}

.material-adjust-modal .form textarea {
  resize: vertical;
}

.material-adjust-modal .form .wide,
.material-adjust-modal .form .button-row {
  grid-column: 1 / -1;
}

@media (max-width: 1380px) {
  .material-report-filter {
    grid-template-columns: repeat(4, minmax(150px, 1fr));
  }
}

.time-window-trigger {
  min-height: 42px;
  border: 1px solid rgba(14, 165, 233, 0.28);
  border-radius: 12px;
  padding: 9px 12px;
  background: linear-gradient(135deg, rgba(240, 249, 255, 0.96), rgba(236, 253, 245, 0.88));
  color: #0f5f72;
  font: inherit;
  font-weight: 900;
  text-align: left;
  cursor: pointer;
}

.time-window-trigger span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.time-window-trigger:hover {
  border-color: rgba(14, 165, 233, 0.58);
  box-shadow: 0 10px 22px rgba(14, 165, 233, 0.14);
  transform: translateY(-1px);
}

.time-window-inline {
  width: 100%;
  max-width: 100%;
}

.time-window-card {
  display: grid;
  gap: 18px;
  padding: 22px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.18);
  border: 1px solid rgba(125, 181, 211, 0.24);
  overflow: hidden;
}

.time-window-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.time-window-head h3 {
  margin: 0;
  color: #0f3f5b;
}

.time-window-head p {
  margin: 6px 0 0;
  color: #64748b;
  font-size: 13px;
}

.time-window-manual {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(120px, 0.8fr) minmax(120px, 0.8fr) auto;
  gap: 10px;
  align-items: end;
}

.time-window-manual label {
  display: grid;
  gap: 6px;
  color: #456070;
  font-size: 13px;
  font-weight: 800;
}

.time-window-manual input {
  min-height: 42px;
  border: 1px solid rgba(84, 122, 148, 0.22);
  border-radius: 12px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.92);
  color: #123044;
  font: inherit;
}

.time-window-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
}

.time-window-rule-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.time-window-rule {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 10px 7px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(224, 242, 254, 0.96), rgba(220, 252, 231, 0.86));
  color: #075985;
  font-size: 13px;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(14, 165, 233, 0.16);
}

.time-window-rule button {
  border: 0;
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.86);
  color: #0f766e;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.time-window-rule button:hover {
  color: #b91c1c;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.1);
}

.time-window-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #f5fbff;
  color: #164e63;
  font-weight: 900;
}

.time-window-chip input {
  width: 16px;
  height: 16px;
}

.time-window-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.desktop-smooth-repaint .panel,
.desktop-smooth-repaint .config-row,
.desktop-smooth-repaint .time-window-card,
.desktop-smooth-repaint .metric-card {
  animation: none !important;
  transition-duration: 0.08s !important;
}

@media (max-width: 900px) {
  .time-window-manual {
    grid-template-columns: 1fr;
  }

  .time-window-head {
    display: grid;
  }
}

.config-row .check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding-bottom: 2px;
}

.config-row .check-label input {
  width: 16px;
  height: 16px;
  padding: 0;
}

.config-preview-layout,
.handover-config-layout {
  display: grid;
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.handover-config-layout > .panel {
  min-width: 0;
  margin-bottom: 0;
}

.form-preview-list {
  display: grid;
  gap: 14px;
}

.form-preview-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(240, 249, 255, 0.96), rgba(236, 253, 245, 0.86));
  box-shadow: 0 14px 34px rgba(20, 72, 120, 0.08);
}

.form-preview-card h3 {
  margin: 0;
  color: #0f3f5b;
  font-size: 16px;
}

.form-preview-card div {
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.76);
}

.form-preview-card span {
  display: block;
  color: #123044;
  font-weight: 800;
}

.form-preview-card p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 13px;
}

.project-switch.inline {
  margin: 0;
}

.record-filter-bar {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 170px 140px auto auto;
  gap: 12px;
  align-items: end;
}

.record-filter-bar label {
  display: grid;
  gap: 6px;
  color: #456070;
  font-size: 13px;
  font-weight: 800;
}

.record-filter-bar input,
.record-filter-bar select {
  min-height: 42px;
  border: 1px solid rgba(84, 122, 148, 0.22);
  border-radius: 12px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.92);
  color: #123044;
  font: inherit;
}

.inspection-record-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.85fr) minmax(0, 1.45fr);
  gap: 16px;
  align-items: start;
}

.inspection-record-list {
  display: grid;
  gap: 12px;
}

.data-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(120, 146, 166, 0.2);
}

.data-pager-summary,
.data-pager-controls {
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

.data-pager-controls {
  display: flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
}

.data-pager .btn.small {
  min-height: 34px;
  padding: 6px 11px;
}

.inspection-record-card {
  display: grid;
  gap: 7px;
  padding: 14px;
  border: 1px solid rgba(120, 146, 166, 0.28);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(241, 248, 252, 0.9));
  box-shadow: 0 12px 28px rgba(30, 48, 70, 0.06);
}

.inspection-record-card.active {
  border-color: rgba(37, 99, 235, 0.42);
  box-shadow: 0 16px 36px rgba(37, 99, 235, 0.12);
}

.inspection-record-card > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.inspection-record-card strong {
  color: #123044;
}

.inspection-record-card p,
.inspection-record-card span,
.inspection-record-card em {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  font-style: normal;
}

.inspection-record-card em {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.inspection-detail-panel {
  min-width: 0;
}

.inspection-summary-grid,
.inspection-note-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

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

.inspection-summary-grid article,
.inspection-note-grid article {
  padding: 14px;
  border-radius: 16px;
  background: rgba(241, 248, 252, 0.88);
}

.inspection-summary-grid span,
.inspection-note-grid span {
  display: block;
  margin-bottom: 6px;
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.inspection-summary-grid strong,
.inspection-note-grid p {
  margin: 0;
  color: #123044;
  overflow-wrap: anywhere;
}

.inspection-reading-table {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}

.inspection-reading-row {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) minmax(80px, 0.8fr) minmax(160px, 1.6fr) 68px;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(120, 146, 166, 0.22);
}

.inspection-reading-row.head {
  color: #64748b;
  background: #edf3f8;
  font-size: 12px;
  font-weight: 900;
}

.inspection-reading-row > * {
  min-width: 0;
  overflow-wrap: anywhere;
}

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

.inspection-photo-card {
  display: grid;
  gap: 8px;
  color: #123044;
  text-decoration: none;
}

.inspection-photo-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid rgba(120, 146, 166, 0.28);
  background: #eef3f7;
}

.inspection-photo-card span {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.handover-field-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.handover-field-row {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(120, 146, 166, 0.24);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(241, 248, 252, 0.9));
}

.handover-field-row strong {
  color: #123044;
  font-size: 14px;
}

.handover-field-row p {
  margin: 0;
  color: #405066;
  line-height: 1.65;
  white-space: pre-wrap;
}

@media (max-width: 980px) {
  .window-row,
  .item-row,
  .testing-config-row,
  .handover-config-row {
    grid-template-columns: 1fr;
  }

  .handover-config-row label.wide {
    grid-column: auto;
  }

  .record-filter-bar,
  .inspection-record-layout,
  .inspection-summary-grid,
  .inspection-note-grid,
  .inspection-reading-row {
    grid-template-columns: 1fr;
  }

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

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  line-height: 1.5;
  letter-spacing: 0;
  position: relative;
  isolation: isolate;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 14% 12%, rgba(15, 118, 110, 0.08), transparent 26%),
    radial-gradient(circle at 84% 10%, rgba(37, 99, 235, 0.06), transparent 22%),
    radial-gradient(circle at 52% 88%, rgba(180, 83, 9, 0.05), transparent 24%);
  animation: soft-drift 18s ease-in-out infinite alternate;
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(120deg, transparent 0 18%, rgba(255, 255, 255, 0.22) 19%, transparent 20% 100%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px) 0 0 / 88px 88px,
    linear-gradient(0deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px) 0 0 / 88px 88px;
  opacity: 0.42;
  animation: water-sweep 22s linear infinite;
  pointer-events: none;
}

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

button {
  cursor: pointer;
  border: 0;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  outline: none;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.login {
  display: grid;
  grid-template-columns: minmax(420px, 0.95fr) minmax(420px, 1fr);
  min-height: 100vh;
}

.login-visual {
  display: grid;
  align-content: space-between;
  gap: 32px;
  padding: 52px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.93), rgba(37, 99, 235, 0.78)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1400' height='1000' viewBox='0 0 1400 1000'%3E%3Crect width='1400' height='1000' fill='%230f766e'/%3E%3Cpath d='M0 680 C180 610 300 700 470 645 C620 596 710 492 890 512 C1060 532 1144 675 1400 600 L1400 1000 L0 1000 Z' fill='%232563eb' opacity='.55'/%3E%3Cpath d='M0 258 C190 198 344 320 522 278 C714 232 852 90 1050 130 C1200 160 1288 250 1400 210 L1400 0 L0 0 Z' fill='%23ffffff' opacity='.13'/%3E%3C/svg%3E");
  background-size: cover;
  color: #fff;
}

.brand h1 {
  max-width: 680px;
  margin: 18px 0 0;
  font-size: 44px;
  line-height: 1.12;
}

.brand p {
  max-width: 680px;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 16px;
  line-height: 1.8;
}

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

.login-highlights span {
  min-height: 92px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.12);
  font-weight: 700;
}

.login-card {
  align-self: center;
  width: min(560px, calc(100% - 48px));
  margin: 0 auto;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.card-title h2,
.topbar h1,
.panel-head h2,
.panel h3 {
  margin: 0;
}

.card-title h2 {
  margin-top: 10px;
  font-size: 28px;
}

.card-title p,
.topbar p,
.panel-head p,
.metric p,
.user-box p,
.side-note p {
  margin: 6px 0 0;
  color: var(--muted);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: inherit;
  font-size: 12px;
  font-weight: 800;
}

.eyebrow.dark {
  background: #e6f4f1;
  color: var(--teal);
}

.role-tabs,
.mode-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 5px;
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #edf3f8;
}

.role-tabs button,
.mode-tabs button,
.side-nav button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.role-tabs button.active,
.mode-tabs button.active {
  background: #fff;
  color: var(--teal);
  box-shadow: var(--shadow-soft);
}

.form {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.form.compact {
  margin-top: 0;
}

.form label {
  display: grid;
  gap: 8px;
  color: #334155;
  font-size: 14px;
  font-weight: 800;
}

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

.code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 10px;
  align-items: end;
}

.helper {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 6px;
  background: #e7edf4;
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

.btn.primary {
  background: var(--teal);
  color: #fff;
}

.btn.primary:hover {
  background: var(--teal-dark);
}

.btn.ghost {
  border: 1px solid var(--line);
  background: #fff;
  color: #405066;
}

.btn.full {
  width: 100%;
}

.sidebar #changePassword {
  margin-top: 14px;
  border-color: rgba(37, 99, 235, 0.22);
  background: rgba(239, 246, 255, 0.88);
  color: #1d4f91;
}

.sidebar #changePassword + #logout {
  margin-top: 10px;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.wechat-box {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.mock-qr {
  display: grid;
  place-items: center;
  min-height: 210px;
  padding: 22px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, #111827 10px, transparent 10px) 0 0 / 28px 28px,
    linear-gradient(#111827 10px, transparent 10px) 0 0 / 28px 28px,
    #fff;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  word-break: break-all;
}

.shell {
  position: relative;
  isolation: isolate;
  overflow-x: visible;
  display: grid;
  grid-template-columns: 278px minmax(0, 1fr);
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 18%, rgba(20, 184, 166, 0.14), transparent 24%),
    radial-gradient(circle at 86% 12%, rgba(59, 130, 246, 0.13), transparent 26%),
    linear-gradient(135deg, #eef5f8, #f6fafc);
}

.shell::before {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(15, 118, 110, 0.06) 1px, transparent 1px) 0 0 / 46px 46px,
    linear-gradient(0deg, rgba(37, 99, 235, 0.05) 1px, transparent 1px) 0 0 / 46px 46px;
  transform: rotate(-6deg);
  animation: console-grid-flow 22s linear infinite;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: 100vh;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  z-index: 120;
}

.side-brand {
  display: grid;
  gap: 4px;
}

.side-brand strong {
  font-size: 18px;
}

.side-brand span,
.side-note p,
.user-box p {
  font-size: 13px;
}

.user-box,
.side-note {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.user-role-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.user-box strong {
  font-size: 20px;
}

.side-nav {
  display: grid;
  gap: 8px;
}

.side-nav button {
  justify-content: flex-start;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  text-align: left;
}

.side-nav button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.side-nav button.locked {
  cursor: not-allowed;
  opacity: 0.56;
}

.side-nav button.active {
  background: #e6f4f1;
  color: var(--teal);
}

.workspace {
  position: relative;
  z-index: 1;
  min-width: 0;
  padding: 26px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.topbar h1 {
  margin-top: 10px;
  font-size: 30px;
}

.grid {
  display: grid;
  gap: 16px;
}

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

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 16px;
}

.panel,
.metric {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.panel {
  padding: 18px;
  margin-bottom: 16px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.panel-head h2 {
  font-size: 20px;
}

.panel h3 {
  margin-bottom: 12px;
  font-size: 15px;
}

.metric {
  min-height: 126px;
  padding: 16px;
  border-top: 3px solid var(--teal);
}

.panel:hover,
.metric:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: rgba(15, 118, 110, 0.28);
  background: rgba(255, 255, 255, 0.99);
  box-shadow: 0 18px 46px rgba(22, 36, 56, 0.13);
}

.metric.blue {
  border-top-color: var(--blue);
}

.metric.green {
  border-top-color: var(--green);
}

.metric.amber {
  border-top-color: var(--amber);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.metric strong {
  display: block;
  margin-top: 10px;
  font-size: 30px;
  line-height: 1.15;
  word-break: break-word;
}

.metric p {
  font-size: 12px;
}

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

.split h3 small {
  margin-left: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.panel-kicker {
  display: grid;
  justify-items: end;
  gap: 4px;
  min-width: 150px;
  padding: 10px 12px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(232, 246, 255, 0.94), rgba(255, 255, 255, 0.96));
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.1);
}

.panel-kicker span,
.panel-kicker em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.panel-kicker strong {
  color: #0a3d62;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 20px;
}

.water-snapshot-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0 4px;
}

.water-snapshot-grid article {
  display: grid;
  gap: 6px;
  min-height: 74px;
  padding: 12px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(241, 248, 255, 0.98), rgba(255, 255, 255, 0.96));
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.08);
}

.water-snapshot-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.water-snapshot-grid strong {
  color: #10243e;
  display: inline-block;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 18px;
}

#iotRealtimePanel .water-snapshot-grid {
  margin: 0;
}

#iotRealtimePanel .iot-summary-grid {
  grid-template-columns: repeat(var(--iot-summary-columns, 4), minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

#iotRealtimePanel .iot-data-card {
  position: relative;
  min-height: 118px;
  padding: 16px;
  overflow: hidden;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 22px rgba(15, 48, 78, 0.07), inset 0 0 0 1px rgba(48, 108, 150, 0.12);
}

#iotRealtimePanel .iot-data-card::after {
  position: absolute;
  right: -20px;
  bottom: -28px;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: rgba(24, 133, 209, 0.08);
  content: "";
}

#iotRealtimePanel .iot-card-2::after { background: rgba(15, 159, 147, 0.09); }
#iotRealtimePanel .iot-card-3::after { background: rgba(124, 114, 242, 0.07); }
#iotRealtimePanel .iot-card-4::after { background: rgba(245, 158, 11, 0.08); }

#iotRealtimePanel .iot-data-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

#iotRealtimePanel .iot-data-card-head span {
  color: #64788a;
  font-size: 13px;
  font-weight: 800;
}

#iotRealtimePanel .iot-data-card-head i {
  width: 10px;
  height: 10px;
  margin-top: 4px;
  border-radius: 50%;
  background: #1685d1;
  box-shadow: 0 0 0 5px rgba(22, 133, 209, 0.1);
}

#iotRealtimePanel .iot-card-2 .iot-data-card-head i { background: #0f9f93; box-shadow: 0 0 0 5px rgba(15, 159, 147, 0.1); }
#iotRealtimePanel .iot-card-3 .iot-data-card-head i { background: #7569d9; box-shadow: 0 0 0 5px rgba(117, 105, 217, 0.1); }
#iotRealtimePanel .iot-card-4 .iot-data-card-head i { background: #db8f11; box-shadow: 0 0 0 5px rgba(219, 143, 17, 0.1); }

#iotRealtimePanel .iot-data-card strong {
  position: relative;
  z-index: 1;
  margin-top: 15px;
  color: #152d45;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 29px;
  font-weight: 800;
  line-height: 1;
}

#iotRealtimePanel .iot-panel-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

#iotRealtimePanel .iot-alert-settings-trigger {
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid rgba(25, 123, 181, 0.28);
  border-radius: 9px;
  background: linear-gradient(135deg, #f7fcff, #e7f6ff);
  color: #176a9c;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

#iotRealtimePanel .iot-alert-settings-trigger:hover {
  border-color: rgba(14, 126, 190, 0.55);
  box-shadow: 0 7px 16px rgba(17, 113, 167, 0.14);
  transform: translateY(-1px);
}

#iotRealtimePanel .iot-data-card em,
#iotRealtimePanel .iot-quality-card em {
  position: relative;
  z-index: 1;
  margin-top: 11px;
  color: #7790a4;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

#iotRealtimePanel .iot-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.9fr);
  gap: 16px;
  align-items: stretch;
}

#iotRealtimePanel .iot-flow-panel,
#iotRealtimePanel .iot-quality-panel {
  padding: 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 0 0 1px rgba(48, 108, 150, 0.12), 0 10px 26px rgba(15, 48, 78, 0.05);
}

#iotRealtimePanel .iot-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(48, 108, 150, 0.12);
}

#iotRealtimePanel .iot-section-head h3 {
  margin: 0;
  color: #17324d;
  font-size: 16px;
}

#iotRealtimePanel .iot-section-head p {
  margin: 5px 0 0;
  color: #7790a4;
  font-size: 12px;
}

#iotRealtimePanel .iot-section-head > span {
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(15, 159, 147, 0.1);
  color: #087f75;
  font-size: 12px;
  font-weight: 800;
}

#iotRealtimePanel .iot-flow-section-head { align-items: center; }

#iotRealtimePanel .iot-flow-tools { position: relative; flex: 0 0 auto; }

#iotRealtimePanel .iot-flow-action-buttons {
  display: flex;
  gap: 8px;
}

#iotRealtimePanel .iot-flow-tool {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(41, 109, 157, 0.2);
  border-radius: 8px;
  background: rgba(248, 252, 255, 0.9);
  color: #275d86;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

#iotRealtimePanel .iot-flow-tool:hover,
#iotRealtimePanel .iot-flow-tool[aria-expanded="true"] {
  border-color: rgba(22, 133, 209, 0.42);
  background: #e8f6ff;
  color: #0870b8;
  transform: translateY(-1px);
}

#iotRealtimePanel .iot-flow-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 8;
  display: grid;
  gap: 12px;
  width: min(466px, calc(100vw - 72px));
  padding: 15px;
  border: 1px solid rgba(43, 111, 157, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 36px rgba(22, 60, 88, 0.18);
}

#iotRealtimePanel .iot-flow-popover-head,
#iotRealtimePanel .iot-search-result-head,
#iotRealtimePanel .iot-flow-popover-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

#iotRealtimePanel .iot-flow-popover-head strong,
#iotRealtimePanel .iot-search-result strong { color: #193d5d; font-size: 13px; }

#iotRealtimePanel .iot-flow-popover-head button {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 7px;
  background: #f0f6fa;
  color: #6e8698;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

#iotRealtimePanel .iot-range-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

#iotRealtimePanel .iot-range-inputs label,
#iotRealtimePanel .iot-search-input {
  display: grid;
  gap: 6px;
  color: #607b91;
  font-size: 12px;
  font-weight: 800;
}

#iotRealtimePanel .iot-range-inputs input,
#iotRealtimePanel .iot-search-input input {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  box-sizing: border-box;
  border: 1px solid rgba(61, 119, 158, 0.2);
  border-radius: 7px;
  background: #f9fcfe;
  color: #24455e;
  font: inherit;
  font-weight: 600;
}

#iotRealtimePanel .iot-range-presets { display: flex; flex-wrap: wrap; gap: 7px; }

#iotRealtimePanel .iot-range-presets button,
#iotRealtimePanel .iot-flow-popover-actions button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(61, 119, 158, 0.18);
  border-radius: 7px;
  background: #f4f9fc;
  color: #356b91;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

#iotRealtimePanel .iot-flow-popover-actions .primary {
  border-color: #1685d1;
  background: #1685d1;
  color: #ffffff;
}

#iotRealtimePanel .iot-flow-popover-actions .quiet { background: transparent; color: #6c8496; }

#iotRealtimePanel .iot-search-popover > p { margin: -4px 0 0; color: #8095a5; font-size: 12px; }

#iotRealtimePanel .iot-search-result {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid rgba(58, 117, 158, 0.14);
}

#iotRealtimePanel .iot-search-result-head p { margin: 3px 0 0; color: #7c93a5; font-size: 11px; }
#iotRealtimePanel .iot-search-result-head > span { color: #5d819b; font-size: 11px; font-weight: 700; text-align: right; }

#iotRealtimePanel .iot-search-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

#iotRealtimePanel .iot-search-metrics > div {
  display: grid;
  gap: 3px;
  padding: 8px 9px;
  border-radius: 8px;
  background: #f3f8fb;
}

#iotRealtimePanel .iot-search-metrics span { color: #708ba0; font-size: 11px; font-weight: 700; }
#iotRealtimePanel .iot-search-metrics strong { color: #1d4968; font-family: Consolas, "SFMono-Regular", monospace; font-size: 13px; }
#iotRealtimePanel .iot-search-result.is-empty p { margin: 4px 0 0; color: #7c93a5; font-size: 12px; }

.iot-search-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(21, 47, 71, 0.28);
  backdrop-filter: blur(4px);
}

.iot-search-modal {
  display: grid;
  gap: 18px;
  width: min(680px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  padding: 24px;
  border: 1px solid rgba(40, 104, 148, 0.2);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 24px 64px rgba(12, 43, 68, 0.26);
}

.iot-search-modal-head,
.iot-search-modal .iot-flow-popover-actions,
.iot-search-modal .iot-search-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.iot-search-modal-head span { color: #2380bb; font-size: 12px; font-weight: 800; }
.iot-search-modal-head h3 { margin: 5px 0 0; color: #183b58; font-size: 20px; }

.iot-search-modal-head button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: #eef5f9;
  color: #617f94;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.iot-search-modal form { display: grid; gap: 10px; }
.iot-search-modal .iot-search-input { display: grid; gap: 7px; color: #607b91; font-size: 13px; font-weight: 800; }
.iot-search-modal .iot-search-input input { min-height: 40px; box-sizing: border-box; border: 1px solid rgba(61, 119, 158, 0.22); border-radius: 8px; background: #f9fcfe; color: #24455e; font: inherit; }
.iot-search-modal form > p { margin: 0; color: #7b94a6; font-size: 13px; }

.iot-search-modal .iot-flow-popover-actions .primary {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid #1685d1;
  border-radius: 8px;
  background: #1685d1;
  color: #ffffff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.iot-search-modal .iot-search-result { display: grid; gap: 12px; padding-top: 18px; border-top: 1px solid rgba(58, 117, 158, 0.14); }
.iot-search-modal .iot-search-result-head strong { color: #193d5d; font-size: 15px; }
.iot-search-modal .iot-search-result-head p { margin: 4px 0 0; color: #7c93a5; font-size: 12px; }
.iot-search-modal .iot-search-result-head > span { color: #48799b; font-size: 12px; font-weight: 700; text-align: right; }

.iot-search-modal .iot-search-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.iot-search-modal .iot-search-metrics > div { display: grid; gap: 4px; min-height: 56px; padding: 10px; border-radius: 9px; background: #f2f8fb; }
.iot-search-modal .iot-search-metrics span { color: #708ba0; font-size: 12px; font-weight: 700; }
.iot-search-modal .iot-search-metrics strong { color: #1d4968; font-family: Consolas, "SFMono-Regular", monospace; font-size: 14px; }
.iot-search-modal .iot-search-result.is-empty p { margin: 4px 0 0; color: #7c93a5; font-size: 13px; }

#iotRealtimePanel .iot-flow-summary {
  display: flex;
  gap: 24px;
  margin: 16px 0 6px;
}

#iotRealtimePanel .iot-flow-summary > div {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  column-gap: 6px;
}

#iotRealtimePanel .iot-flow-summary span {
  grid-column: 1 / -1;
  margin-bottom: 4px;
  color: #6d879d;
  font-size: 12px;
  font-weight: 700;
}

#iotRealtimePanel .iot-flow-summary strong {
  color: #17324d;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 22px;
}

#iotRealtimePanel .iot-flow-summary em {
  color: #7790a4;
  font-size: 12px;
  font-style: normal;
}

#iotRealtimePanel [data-iot-flow-chart] svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 234px;
  margin-top: 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

#iotRealtimePanel .iot-chart-grid line {
  stroke: rgba(63, 111, 151, 0.14);
  stroke-width: 1;
}

#iotRealtimePanel .iot-chart-grid text {
  fill: #8aa0b3;
  font-size: 11px;
  font-weight: 700;
  text-anchor: end;
}

#iotRealtimePanel .iot-chart-area { opacity: 1; }
#iotRealtimePanel .iot-chart-area.inflow { fill: url("#iotInflowArea"); }
#iotRealtimePanel .iot-chart-area.outflow { fill: url("#iotOutflowArea"); }

#iotRealtimePanel .iot-chart-line {
  fill: none;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: none;
  stroke-dashoffset: 0;
  animation: none;
}

#iotRealtimePanel .iot-chart-line.inflow { stroke: url("#iotInflowLine"); }
#iotRealtimePanel .iot-chart-line.outflow { stroke: url("#iotOutflowLine"); }

#iotRealtimePanel .iot-chart-point { stroke: #ffffff; stroke-width: 2.5; }
#iotRealtimePanel .iot-chart-point.inflow { fill: #1685d1; }
#iotRealtimePanel .iot-chart-point.outflow { fill: #0f9f93; }

#iotRealtimePanel .iot-chart-labels text {
  fill: #7790a4;
  font-size: 11px;
  font-weight: 700;
  text-anchor: middle;
}

#iotRealtimePanel .iot-chart-stage { position: relative; }

#iotRealtimePanel .iot-flow-chart-svg {
  cursor: crosshair;
  touch-action: none;
}

#iotRealtimePanel .iot-chart-hover-line {
  stroke: rgba(22, 133, 209, 0.62);
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
  pointer-events: none;
}

#iotRealtimePanel .iot-chart-tooltip {
  position: absolute;
  top: 8px;
  z-index: 4;
  min-width: 148px;
  padding: 10px 12px;
  border: 1px solid rgba(42, 104, 148, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 24px rgba(19, 57, 89, 0.16);
  color: #17324d;
  pointer-events: none;
  transform: translateX(-50%);
}

#iotRealtimePanel .iot-chart-tooltip strong {
  display: block;
  margin-bottom: 7px;
  color: #58738a;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 12px;
}

#iotRealtimePanel .iot-chart-tooltip div {
  display: grid;
  grid-template-columns: 8px auto 1fr;
  align-items: center;
  column-gap: 6px;
  min-width: 0;
  line-height: 1.7;
}

#iotRealtimePanel .iot-chart-tooltip span { width: 8px; height: 8px; border-radius: 50%; }
#iotRealtimePanel .iot-chart-tooltip .inflow-dot { background: #1685d1; }
#iotRealtimePanel .iot-chart-tooltip .outflow-dot { background: #0f9f93; }
#iotRealtimePanel .iot-chart-tooltip b { color: #5b7488; font-size: 12px; font-weight: 700; }
#iotRealtimePanel .iot-chart-tooltip em { color: #17324d; font-family: Consolas, "SFMono-Regular", monospace; font-size: 12px; font-style: normal; font-weight: 800; text-align: right; }

#iotRealtimePanel .iot-flow-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 2px;
  color: #6d879d;
  font-size: 12px;
  font-weight: 700;
}

#iotRealtimePanel .iot-flow-legend span { display: inline-flex; align-items: center; }
#iotRealtimePanel .iot-flow-legend i { width: 8px; height: 8px; margin-right: 5px; border-radius: 50%; }
#iotRealtimePanel .iot-flow-legend .inflow-dot { background: #1685d1; }
#iotRealtimePanel .iot-flow-legend .outflow-dot { background: #0f9f93; }
#iotRealtimePanel .iot-flow-legend em { margin-left: auto; color: #90a5b7; font-style: normal; }

#iotRealtimePanel .iot-quality-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

#iotRealtimePanel .iot-quality-card {
  min-height: 118px;
  padding: 13px;
  border-radius: 12px;
  background: rgba(244, 249, 253, 0.78);
  box-shadow: inset 0 0 0 1px rgba(48, 108, 150, 0.12);
}

#iotRealtimePanel .iot-quality-card > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#iotRealtimePanel .iot-quality-card span { color: #637e94; font-size: 12px; font-weight: 800; }
#iotRealtimePanel .iot-quality-card strong { margin-top: 12px; color: #17324d; font-size: 32px; line-height: 1.08; }
#iotRealtimePanel .iot-status-dot { width: 7px; height: 7px; border-radius: 50%; background: #9fb3c3; }
#iotRealtimePanel .iot-status-dot.is-live { background: #13a779; box-shadow: 0 0 0 4px rgba(19, 167, 121, 0.1); }

#iotRealtimePanel .iot-live-value.is-alert-normal { color: #12865d; text-shadow: 0 2px 10px rgba(18, 134, 93, 0.12); }
#iotRealtimePanel .iot-live-value.is-alert-warning { color: #d87913; text-shadow: 0 2px 10px rgba(216, 121, 19, 0.14); }
#iotRealtimePanel .iot-live-value.is-alert-alarm { color: #d64646; text-shadow: 0 2px 10px rgba(214, 70, 70, 0.14); }
#iotRealtimePanel .iot-data-card.is-alert-normal,
#iotRealtimePanel .iot-quality-card.is-alert-normal { box-shadow: inset 0 0 0 1px rgba(18, 134, 93, 0.18), 0 8px 20px rgba(18, 134, 93, 0.04); }
#iotRealtimePanel .iot-data-card.is-alert-warning,
#iotRealtimePanel .iot-quality-card.is-alert-warning { background: rgba(255, 249, 238, 0.94); box-shadow: inset 0 0 0 1px rgba(216, 121, 19, 0.24), 0 8px 20px rgba(216, 121, 19, 0.06); }
#iotRealtimePanel .iot-data-card.is-alert-alarm,
#iotRealtimePanel .iot-quality-card.is-alert-alarm { background: rgba(255, 244, 244, 0.94); box-shadow: inset 0 0 0 1px rgba(214, 70, 70, 0.3), 0 8px 20px rgba(214, 70, 70, 0.07); }
#iotRealtimePanel .iot-data-card.is-alert-normal .iot-data-card-head i,
#iotRealtimePanel .iot-status-dot.is-alert-normal { background: #16a36f; box-shadow: 0 0 0 5px rgba(22, 163, 111, 0.1); }
#iotRealtimePanel .iot-data-card.is-alert-warning .iot-data-card-head i,
#iotRealtimePanel .iot-status-dot.is-alert-warning { background: #e29422; box-shadow: 0 0 0 5px rgba(226, 148, 34, 0.12); }
#iotRealtimePanel .iot-data-card.is-alert-alarm .iot-data-card-head i,
#iotRealtimePanel .iot-status-dot.is-alert-alarm { background: #dd4e4e; box-shadow: 0 0 0 5px rgba(221, 78, 78, 0.12); }
#iotRealtimePanel .iot-live-value.is-alert-normal.iot-value-updated { color: #12865d; }
#iotRealtimePanel .iot-live-value.is-alert-warning.iot-value-updated { color: #d87913; }
#iotRealtimePanel .iot-live-value.is-alert-alarm.iot-value-updated { color: #d64646; }

@media (max-width: 1120px) {
  #iotRealtimePanel .iot-dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  #iotRealtimePanel .iot-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #iotRealtimePanel .iot-quality-grid { grid-template-columns: 1fr; }
  #iotRealtimePanel .iot-flow-section-head { align-items: flex-start; }
  #iotRealtimePanel .iot-flow-popover { width: min(380px, calc(100vw - 40px)); }
  #iotRealtimePanel .iot-range-inputs,
  #iotRealtimePanel .iot-search-metrics { grid-template-columns: 1fr; }
  .iot-search-modal-backdrop { padding: 16px; }
  .iot-search-modal { max-height: calc(100vh - 32px); padding: 18px; }
  .iot-search-modal .iot-search-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.iot-live-value {
  transform-origin: left center;
  transition: color 0.25s ease, text-shadow 0.25s ease;
}

.iot-live-value.iot-value-updated {
  animation: iot-value-update 0.46s cubic-bezier(0.22, 1, 0.36, 1);
  color: #087ea4;
  text-shadow: 0 2px 12px rgba(8, 126, 164, 0.2);
}

.iot-alert-settings-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1260;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(18, 46, 70, 0.25);
  backdrop-filter: blur(5px);
}

.iot-alert-settings-modal {
  display: grid;
  gap: 18px;
  width: min(830px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  padding: 24px;
  border: 1px solid rgba(56, 117, 158, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 28px 72px rgba(12, 43, 68, 0.25);
}

.iot-alert-settings-head,
.iot-alert-settings-actions,
.iot-alert-rule-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.iot-alert-settings-head > div > span { color: #2380bb; font-size: 12px; font-weight: 800; }
.iot-alert-settings-head h3 { margin: 4px 0 0; color: #183b58; font-size: 21px; }
.iot-alert-settings-head > button {
  display: grid;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  place-items: center;
  background: #eef6fb;
  color: #547187;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.iot-alert-settings-modal form { display: grid; gap: 15px; }
.iot-alert-settings-intro { padding: 12px 14px; border-radius: 10px; background: #eff8fc; }
.iot-alert-settings-intro strong { color: #1a5f89; font-size: 13px; }
.iot-alert-settings-intro p { margin: 5px 0 0; color: #638298; font-size: 12px; line-height: 1.6; }
.iot-alert-rule-list { display: grid; gap: 9px; }
.iot-alert-rule {
  display: grid;
  grid-template-columns: minmax(160px, 1.15fr) repeat(4, minmax(92px, 0.7fr));
  gap: 10px;
  align-items: end;
  padding: 13px;
  border: 1px solid rgba(57, 111, 151, 0.14);
  border-radius: 10px;
  background: #fbfdfe;
}
.iot-alert-rule-title { align-self: stretch; align-items: flex-start; }
.iot-alert-rule-title > div { display: grid; gap: 4px; min-width: 0; }
.iot-alert-rule-title strong { overflow: hidden; color: #254760; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.iot-alert-rule-title span { color: #8398a8; font-family: Consolas, "SFMono-Regular", monospace; font-size: 11px; }
.iot-alert-rule-title em { flex: 0 0 auto; padding: 4px 7px; border-radius: 999px; font-size: 11px; font-style: normal; font-weight: 800; }
.iot-alert-rule-title em.is-normal { background: #e8f7ef; color: #16845c; }
.iot-alert-rule-title em.is-warning { background: #fff4dd; color: #c77713; }
.iot-alert-rule-title em.is-alarm { background: #ffebeb; color: #ce4444; }
.iot-alert-rule-title em.is-unset { background: #f0f4f6; color: #778b9b; }
.iot-alert-rule > label { display: grid; gap: 5px; color: #607b91; font-size: 11px; font-weight: 800; }
.iot-alert-rule input { box-sizing: border-box; width: 100%; min-height: 36px; padding: 0 9px; border: 1px solid rgba(61, 119, 158, 0.21); border-radius: 7px; background: #ffffff; color: #254760; font: inherit; }
.iot-alert-rule input:focus { outline: none; border-color: #2d95d2; box-shadow: 0 0 0 3px rgba(45, 149, 210, 0.1); }
.iot-alert-rule input:disabled { cursor: not-allowed; background: #f4f7f9; color: #8598a7; }
.iot-alert-threshold.is-warning { color: #c77713; }
.iot-alert-threshold.is-warning input { border-color: rgba(199, 119, 19, 0.34); background: #fffaf1; }
.iot-alert-threshold.is-alarm { color: #ce4444; }
.iot-alert-threshold.is-alarm input { border-color: rgba(206, 68, 68, 0.3); background: #fff8f8; }
.iot-alert-settings-actions { justify-content: flex-end; padding-top: 3px; }
.iot-alert-readonly,
.iot-alert-settings-empty { padding: 20px; border-radius: 10px; background: #f3f8fb; color: #688196; font-size: 13px; text-align: center; }
.iot-alert-settings-loading { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 22px 0 4px; }
.iot-alert-settings-loading span { height: 52px; border-radius: 9px; background: linear-gradient(90deg, #eef5f8 25%, #f9fcfd 37%, #eef5f8 63%); background-size: 400% 100%; animation: iot-alert-shimmer 1.2s ease infinite; }
.iot-alert-settings-loading p { grid-column: 1 / -1; margin: 4px 0 0; color: #7890a0; font-size: 12px; text-align: center; }

@keyframes iot-alert-shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

@media (max-width: 760px) {
  .iot-alert-settings-backdrop { padding: 14px; }
  .iot-alert-settings-modal { max-height: calc(100vh - 28px); padding: 18px; }
  .iot-alert-rule { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .iot-alert-rule-title { grid-column: 1 / -1; }
}

@keyframes iot-value-update {
  0% { opacity: 0.55; transform: translateY(3px) scale(0.97); }
  65% { opacity: 1; transform: translateY(-1px) scale(1.035); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .iot-live-value.iot-value-updated {
    animation: none;
  }
}

.chart-empty {
  display: grid;
  place-items: center;
  min-height: 154px;
  border: 1px dashed rgba(100, 116, 139, 0.28);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(248, 251, 253, 0.88), rgba(255, 255, 255, 0.94));
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.bars {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  min-height: 154px;
  padding-top: 10px;
}

.bar {
  display: grid;
  grid-template-rows: 24px 1fr 18px;
  align-items: end;
  justify-items: center;
  gap: 6px;
  height: 132px;
}

.bar strong {
  align-self: start;
  color: #10243e;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 12px;
  font-weight: 900;
}

.bar span {
  display: block;
  width: min(100%, 30px);
  min-height: 10px;
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, rgba(15, 118, 110, 0.95), rgba(37, 99, 235, 0.78));
}

.bars.tone-amber .bar span {
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.92), rgba(124, 58, 237, 0.74));
}

.bars.tone-manager .bar span,
.bars.tone-blue .bar span {
  background: linear-gradient(180deg, rgba(0, 184, 217, 0.9), rgba(37, 99, 235, 0.74));
}

.bar em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.table {
  display: grid;
  gap: 8px;
}

.tr {
  display: grid;
  grid-template-columns: var(--cols);
  gap: 10px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.tr.head {
  background: #edf3f8;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.tr:not(.head):hover {
  transform: translateX(4px) scale(1.005);
  border-color: rgba(37, 99, 235, 0.24);
  box-shadow: 0 12px 28px rgba(30, 48, 70, 0.09);
}

.tr div {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: #eef2f6;
  color: #405066;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.pill.teal {
  background: #dff5ef;
  color: var(--teal-dark);
}

.pill.green {
  background: #dcfce7;
  color: #166534;
}

.pill.amber {
  background: #fef3c7;
  color: #92400e;
}

.pill.neutral {
  background: #eef2f6;
  color: #64748b;
}

.empty {
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 14px;
}

.user-layout {
  align-items: start;
}

.checkline {
  display: flex !important;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px !important;
  width: fit-content;
}

.checkline input {
  width: 18px;
  min-height: 18px;
}

.role-list,
.task-list,
.timeline {
  display: grid;
  gap: 10px;
}

.role-list article,
.task-list article,
.timeline article {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.role-list article:hover,
.task-list article:hover,
.timeline article:hover {
  transform: translateY(-3px) scale(1.01);
  border-color: rgba(15, 118, 110, 0.28);
  box-shadow: 0 12px 28px rgba(30, 48, 70, 0.1);
}

.role-list strong,
.task-list strong,
.timeline strong {
  display: block;
  font-size: 15px;
}

.role-list span,
.task-list span,
.timeline span,
.photo-grid span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.role-list p,
.timeline p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.task-list article.warn {
  border-color: #f4c27a;
  background: #fff8eb;
}

.link-btn {
  padding: 6px 8px;
  border-radius: 8px;
  background: transparent;
  color: var(--teal);
  font-weight: 900;
}

.link-btn:hover {
  background: rgba(15, 118, 110, 0.08);
}

.link-btn:disabled,
.link-btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.48;
}

.link-btn.danger,
.danger-text {
  color: #dc2626;
}

.link-btn.danger:hover {
  background: rgba(220, 38, 38, 0.08);
}

.btn.danger {
  min-height: 46px;
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  color: #fff;
  box-shadow: 0 14px 30px rgba(220, 38, 38, 0.2);
}

.user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.user-create-form {
  animation: fadeSlide 0.28s ease both;
}

.user-create-panel {
  display: grid;
  gap: 18px;
}

.user-account-browser {
  display: grid;
  gap: 14px;
}

.account-browser-head {
  align-items: end;
}

.account-site-filter {
  display: grid;
  min-width: min(320px, 100%);
  gap: 7px;
  color: #34536a;
  font-size: 13px;
  font-weight: 800;
}

.account-site-filter select {
  min-height: 42px;
  border-color: rgba(14, 116, 144, 0.22);
  background: rgba(255, 255, 255, 0.9);
  color: #17364d;
}

.project-account-fold,
.role-template-fold,
.user-create-fold {
  overflow: hidden;
  border: 1px solid rgba(42, 101, 139, 0.16);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(246, 251, 254, 0.94), rgba(239, 249, 249, 0.78));
}

.project-account-fold summary,
.role-template-fold summary,
.user-create-fold summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px;
  cursor: pointer;
  color: #17364d;
  font-size: 15px;
  font-weight: 900;
  list-style: none;
}

.project-account-fold summary::-webkit-details-marker,
.role-template-fold summary::-webkit-details-marker,
.user-create-fold summary::-webkit-details-marker {
  display: none;
}

.project-account-fold summary::after,
.role-template-fold summary::after,
.user-create-fold summary::after {
  content: "+";
  margin-left: auto;
  color: #0f7490;
  font-size: 20px;
  line-height: 1;
}

.project-account-fold[open] summary::after,
.role-template-fold[open] summary::after,
.user-create-fold[open] summary::after {
  content: "-";
}

.project-account-fold summary small,
.role-template-fold summary small,
.user-create-fold summary small {
  color: #668196;
  font-size: 13px;
  font-weight: 700;
}

.project-account-content,
.role-template-content,
.user-create-content {
  padding: 0 18px 18px;
  animation: fadeSlide 0.2s ease both;
}

.user-create-hint {
  margin: 0 0 14px;
  color: #668196;
  font-size: 13px;
  line-height: 1.7;
}

.project-account-content .compact-table {
  margin: 0;
}

.compact-role-list {
  max-height: 540px;
  overflow: auto;
  padding-right: 4px;
}

.modal-backdrop.user-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 34px;
  background: rgba(15, 23, 42, 0.36);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.18s ease both;
}

.modal-card {
  width: min(820px, calc(100vw - 56px));
  max-height: min(86vh, 760px);
  overflow: auto;
  padding: 34px 38px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 252, 255, 0.96)),
    #fff;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.24);
  animation: modalLift 0.22s ease both;
}

.user-delete-card {
  width: min(680px, calc(100vw - 56px));
  padding: 34px 38px 30px;
}

.password-change-card {
  width: min(520px, calc(100vw - 56px));
}

.default-password-warning {
  margin: -6px 0 20px;
  padding: 12px 14px;
  border: 1px solid rgba(245, 158, 11, 0.24);
  border-radius: 12px;
  background: #fffbeb;
  color: #8a4b08;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
}

.default-password-warning strong {
  font-family: "JetBrains Mono", Consolas, monospace;
}

.password-change-form {
  display: grid;
  gap: 18px;
}

.password-change-form label {
  display: grid;
  gap: 9px;
  color: #28425d;
  font-weight: 800;
}

.password-change-form input {
  min-height: 46px;
}

.password-change-form small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.55;
}

.forgot-password-link {
  width: fit-content;
  margin: -4px 0 2px auto;
  padding: 3px 0;
  color: #1d4f91;
  background: transparent;
  font-size: 13px;
  font-weight: 800;
}

.forgot-password-link:hover {
  color: var(--teal-dark);
  text-decoration: underline;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
  padding-bottom: 4px;
}

.modal-head h2 {
  margin: 10px 0 10px;
  font-size: 28px;
  line-height: 1.2;
}

.modal-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.modal-close {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: #eef5fb;
  color: #334155;
  font-size: 24px;
  line-height: 1;
}

.user-permission-card .form.compact,
.user-delete-card .form.compact {
  display: grid;
  gap: 22px;
}

.user-permission-card .form-grid {
  gap: 20px 24px;
}

.user-permission-card .form label,
.user-delete-card .form label {
  gap: 10px;
}

.user-permission-card textarea,
.user-delete-card textarea {
  min-height: 82px;
}

.user-permission-card .checkline {
  margin-top: 2px;
}

.user-project-grants {
  display: grid;
  gap: 13px;
  margin: 0;
  padding: 16px;
  border: 1px solid rgba(42, 101, 139, 0.16);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(238, 249, 255, 0.82), rgba(246, 252, 250, 0.82));
}

.user-project-grants legend {
  padding: 0 7px;
  color: #1e405c;
  font-size: 14px;
  font-weight: 900;
}

.user-project-grants > p {
  margin: -3px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.project-grant-list {
  display: grid;
  gap: 10px;
}

.project-grant-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr auto 34px;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 5px 16px rgba(35, 82, 112, 0.05);
}

.project-grant-row label {
  min-width: 0;
}

.project-grant-row select {
  min-width: 0;
}

.project-grant-default {
  display: inline-flex !important;
  min-height: 42px;
  align-items: center;
  gap: 6px !important;
  white-space: nowrap;
}

.project-grant-remove {
  width: 34px;
  height: 34px;
  align-self: end;
  border: 1px solid rgba(220, 38, 38, 0.18);
  border-radius: 9px;
  color: #b42318;
  background: #fff;
  font-size: 20px;
  line-height: 1;
}

.project-grant-remove:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.user-permission-card .button-row,
.user-delete-card .button-row {
  gap: 14px;
  margin-top: 2px;
}

.modal-close:hover {
  background: #dceaf6;
  transform: scale(1.04);
}

@keyframes modalLift {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeSlide {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.muted-small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.public-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 18px;
  align-items: center;
  min-height: 230px;
  padding: 26px;
  margin-bottom: 16px;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.92), rgba(37, 99, 235, 0.74)),
    #0f766e;
  color: #fff;
  box-shadow: var(--shadow);
}

.public-hero h2 {
  margin: 14px 0 10px;
  font-size: 34px;
}

.public-hero p {
  max-width: 720px;
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 16px;
}

.progress-big {
  display: grid;
  place-items: center;
  width: 198px;
  height: 198px;
  border: 16px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.progress-big strong {
  font-size: 42px;
  line-height: 1;
}

.progress-big span {
  margin-top: -42px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 13px;
  font-weight: 800;
}

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

.photo-grid article {
  display: grid;
  align-content: end;
  min-height: 150px;
  padding: 16px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.88), rgba(37, 99, 235, 0.72));
  color: #fff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.photo-grid article:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 18px 42px rgba(37, 99, 235, 0.18);
}

.photo-grid strong {
  font-size: 16px;
}

.photo-grid span {
  color: rgba(255, 255, 255, 0.84);
}

.toast {
  position: fixed;
  top: max(20px, env(safe-area-inset-top));
  left: 50%;
  z-index: 1000;
  width: min(480px, calc(100vw - 40px));
  padding: 14px 18px;
  border: 1px solid transparent;
  border-radius: 14px;
  box-shadow: 0 18px 42px rgba(21, 42, 58, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.72);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.5;
  text-align: center;
  white-space: pre-wrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -18px);
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.toast--error {
  border-color: #fca5a5;
  background: linear-gradient(135deg, #fee2e2, #fff1f2);
  color: #991b1b;
  box-shadow: 0 18px 42px rgba(185, 28, 28, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.toast.toast--warning {
  border-color: #fdba74;
  background: linear-gradient(135deg, #ffedd5, #fff7ed);
  color: #9a3412;
  box-shadow: 0 18px 42px rgba(194, 65, 12, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.toast.toast--success {
  border-color: #86efac;
  background: linear-gradient(135deg, #dcfce7, #f0fdf4);
  color: #166534;
  box-shadow: 0 18px 42px rgba(22, 101, 52, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

/* First-release visual refresh */
body {
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.12), transparent 28%),
    linear-gradient(315deg, rgba(180, 83, 9, 0.1), transparent 24%),
    #eef3f7;
}

.login {
  background:
    linear-gradient(110deg, rgba(15, 118, 110, 0.1), transparent 42%),
    linear-gradient(290deg, rgba(37, 99, 235, 0.08), transparent 38%),
    #edf4f8;
}

.login-visual {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    linear-gradient(128deg, rgba(7, 89, 83, 0.96), rgba(29, 78, 216, 0.84) 52%, rgba(180, 83, 9, 0.72)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1400' height='1000' viewBox='0 0 1400 1000'%3E%3Crect width='1400' height='1000' fill='%230f766e'/%3E%3Cpath d='M0 702 C150 628 314 710 476 644 C650 573 780 455 964 486 C1146 517 1224 675 1400 598 L1400 1000 L0 1000 Z' fill='%232563eb' opacity='.56'/%3E%3Cpath d='M0 250 C202 190 362 322 548 270 C748 214 880 86 1080 132 C1218 164 1286 240 1400 210 L1400 0 L0 0 Z' fill='%23ffffff' opacity='.13'/%3E%3Cpath d='M120 820 L430 620 L690 700 L1020 500 L1320 560' fill='none' stroke='%23ffffff' stroke-width='2' opacity='.22'/%3E%3Cpath d='M180 210 L500 328 L760 190 L1060 300 L1280 210' fill='none' stroke='%23ffffff' stroke-width='2' opacity='.16'/%3E%3C/svg%3E");
  background-size: cover;
}

.login-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(255,255,255,.09) 1px, transparent 1px) 0 0 / 54px 54px,
    linear-gradient(0deg, rgba(255,255,255,.07) 1px, transparent 1px) 0 0 / 54px 54px;
  mask-image: linear-gradient(120deg, rgba(0,0,0,.9), rgba(0,0,0,.15));
}

.brand h1 {
  max-width: 740px;
  font-size: 50px;
  line-height: 1.04;
  text-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
}

.brand p {
  max-width: 760px;
  font-size: 17px;
}

.login-highlights span {
  position: relative;
  overflow: hidden;
  min-height: 118px;
  padding: 18px;
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(14px);
}

.login-highlights span::before {
  content: "";
  display: block;
  width: 34px;
  height: 4px;
  margin-bottom: 16px;
  border-radius: 999px;
  background: #facc15;
}

.login-card {
  position: relative;
  overflow: hidden;
  width: min(590px, calc(100% - 52px));
  padding: 34px;
  border-color: rgba(15, 118, 110, 0.22);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 30px 80px rgba(18, 40, 62, 0.18);
  backdrop-filter: blur(18px);
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  z-index: 0;
  height: 7px;
  background: linear-gradient(90deg, #0f766e, #2563eb, #b45309);
}

.login-card > * {
  position: relative;
  z-index: 1;
}

.card-title h2 {
  font-size: 34px;
}

.role-tabs,
.mode-tabs {
  padding: 6px;
  border-color: rgba(15, 118, 110, 0.18);
  background: linear-gradient(180deg, #eef7f6, #eaf0f6);
}

.role-tabs button,
.mode-tabs button {
  min-height: 44px;
  border: 1px solid transparent;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.role-tabs button:hover,
.mode-tabs button:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.72);
  color: var(--teal-dark);
}

.role-tabs button.active,
.mode-tabs button.active {
  border-color: rgba(255, 255, 255, 0.78);
  background: linear-gradient(135deg, #0f766e, #2563eb);
  color: #fff;
  box-shadow: 0 12px 26px rgba(15, 118, 110, 0.22);
}

.form label {
  color: #26364d;
}

.form input,
.form select,
.form textarea {
  border-color: #cddae5;
  background: rgba(255, 255, 255, 0.96);
}

.btn.primary {
  min-height: 46px;
  background: linear-gradient(135deg, #0f766e, #1d4ed8);
  box-shadow: 0 14px 30px rgba(15, 118, 110, 0.22);
}

.btn.primary:hover {
  background: linear-gradient(135deg, #0b5e58, #1e40af);
}

.sidebar {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(243, 248, 252, 0.92)),
    #fff;
  box-shadow: 12px 0 34px rgba(22, 36, 56, 0.06);
}

.side-brand {
  padding: 15px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #e6f4f1, #edf4ff);
}

.side-brand strong {
  color: #083f3b;
}

.side-nav {
  gap: 11px;
  position: relative;
  overflow: visible;
}

.side-nav-group {
  position: relative;
  isolation: isolate;
}

.side-nav-group.has-children:hover,
.side-nav-group.has-children:focus-within {
  z-index: 140;
}

.side-nav-group.has-children::after {
  content: "";
  position: absolute;
  top: -6px;
  left: 100%;
  width: 18px;
  height: calc(100% + 12px);
}

.side-nav button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 0 15px 0 18px;
  border: 1px solid #cfdae5;
  border-left: 5px solid #9fb0c2;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f3f7fb);
  color: #26364d;
  box-shadow: 0 8px 20px rgba(30, 48, 70, 0.08);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.side-nav button::after {
  content: ">";
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #e6edf4;
  color: #526174;
  font-weight: 900;
}

.side-nav button:hover {
  transform: translateX(3px);
  border-color: rgba(15, 118, 110, 0.32);
  border-left-color: var(--teal);
  box-shadow: 0 14px 30px rgba(15, 118, 110, 0.14);
}

.side-nav button.active {
  border-color: transparent;
  border-left-color: #facc15;
  background: linear-gradient(135deg, #0f766e, #1d4ed8);
  color: #fff;
  box-shadow: 0 16px 36px rgba(15, 118, 110, 0.26);
}

.side-nav button.active::after {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.side-nav-group.has-children > button::after {
  content: ">";
}

.side-subnav {
  position: absolute;
  top: 0;
  left: calc(100% - 2px);
  z-index: 180;
  display: grid;
  min-width: 168px;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(122, 153, 176, 0.28);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 22px 52px rgba(30, 48, 70, 0.18);
  backdrop-filter: blur(16px);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-8px) translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.side-nav-group.has-children:hover .side-subnav,
.side-nav-group.has-children:focus-within .side-subnav {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0) translateY(0);
}

.side-nav .side-subnav .sub-nav-button {
  min-height: 42px;
  padding: 0 12px;
  border-left-width: 1px;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff, #f7fbff);
  box-shadow: none;
  font-size: 14px;
}

.side-nav .side-subnav .sub-nav-button::after {
  content: "";
  display: none;
}

.side-nav .side-subnav .sub-nav-button.active {
  background: linear-gradient(135deg, #e0f7ff, #e8f0ff);
  color: #075985;
  border-color: rgba(0, 168, 216, 0.36);
  border-left-color: #00a8d8;
}

@media (max-width: 1020px) {
  .side-subnav {
    position: static;
    min-width: 0;
    margin-top: 8px;
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }
}

.user-box {
  border-color: rgba(37, 99, 235, 0.16);
  background: linear-gradient(135deg, #ffffff, #f0f7ff);
}

.panel,
.metric {
  border-color: rgba(119, 139, 160, 0.28);
}

.metric {
  box-shadow: 0 14px 34px rgba(22, 36, 56, 0.08);
}

.refined-login {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  grid-template-columns: minmax(460px, 1.04fr) minmax(420px, 0.96fr);
  background:
    radial-gradient(circle at 18% 18%, rgba(20, 184, 166, 0.34), transparent 30%),
    radial-gradient(circle at 82% 22%, rgba(59, 130, 246, 0.26), transparent 28%),
    radial-gradient(circle at 74% 82%, rgba(245, 158, 11, 0.18), transparent 28%),
    linear-gradient(135deg, #071f2e, #0f766e 42%, #1d4ed8);
  background-size: 150% 150%;
  animation: login-bg-flow 16s ease-in-out infinite;
}

.refined-login::before,
.refined-login::after {
  content: "";
  position: absolute;
  inset: -16%;
  z-index: -2;
  pointer-events: none;
}

.refined-login::before {
  background:
    linear-gradient(90deg, rgba(255,255,255,.1) 1px, transparent 1px) 0 0 / 58px 58px,
    linear-gradient(0deg, rgba(255,255,255,.08) 1px, transparent 1px) 0 0 / 58px 58px;
  mask-image: linear-gradient(125deg, rgba(0,0,0,.82), rgba(0,0,0,.2));
  animation: water-sweep 18s linear infinite;
}

.refined-login::after {
  z-index: -1;
  background:
    linear-gradient(104deg, transparent 0 18%, rgba(255, 255, 255, 0.13) 18% 19%, transparent 19% 38%, rgba(255, 255, 255, 0.08) 38% 39%, transparent 39%),
    radial-gradient(circle at 52% 48%, rgba(255, 255, 255, 0.16), transparent 30%);
  transform: rotate(-8deg);
  animation: tide-panel 12s ease-in-out infinite;
}

.refined-login .login-visual {
  overflow: hidden;
  align-content: center;
  gap: 30px;
  background: transparent;
  z-index: 1;
}

.company-lockup {
  position: absolute;
  top: 22px;
  left: 28px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  min-height: 50px;
  max-width: min(430px, calc(100% - 56px));
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 14px 36px rgba(4, 19, 35, 0.13);
  backdrop-filter: blur(18px);
}

.company-logo-full {
  display: block;
  width: 318px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  filter: saturate(0.88) contrast(0.94) brightness(0.98);
  opacity: 0.94;
}

.refined-login .login-visual::after {
  content: "";
  position: absolute;
  inset: auto -12% -24% -12%;
  height: 44%;
  background:
    linear-gradient(6deg, rgba(255, 255, 255, 0.18) 0 1px, transparent 1px 34px),
    linear-gradient(104deg, rgba(255, 255, 255, 0.1), transparent 54%);
  transform: skewY(-7deg);
  animation: tide-panel 10s ease-in-out infinite;
}

.water-scene {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.water-scene::before,
.water-scene::after {
  content: "";
  position: absolute;
  inset: -20% -12%;
  background:
    repeating-linear-gradient(
      108deg,
      rgba(255, 255, 255, 0.18) 0 1px,
      transparent 1px 48px
    );
  transform: translate3d(-4%, 0, 0);
  animation: water-sweep 13s linear infinite;
}

.water-scene::after {
  background:
    repeating-linear-gradient(
      24deg,
      rgba(255, 255, 255, 0.12) 0 1px,
      transparent 1px 64px
    );
  animation-duration: 18s;
  animation-direction: reverse;
}

.water-scene span {
  position: absolute;
  left: -8%;
  right: -8%;
  height: 120px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-left: 0;
  border-right: 0;
  transform: rotate(-7deg);
  animation: wave-drift 9s ease-in-out infinite;
}

.water-scene span:nth-child(1) {
  top: 18%;
}

.water-scene span:nth-child(2) {
  top: 38%;
  animation-delay: -2s;
  opacity: 0.68;
}

.water-scene span:nth-child(3) {
  top: 58%;
  animation-delay: -4s;
  opacity: 0.55;
}

.water-scene span:nth-child(4) {
  top: 78%;
  animation-delay: -6s;
  opacity: 0.42;
}

.minimal-brand {
  max-width: 780px;
  animation: brand-enter 0.78s ease-out both;
}

.minimal-brand h1 {
  font-size: 82px;
  line-height: 0.94;
  margin-top: 16px;
}

.minimal-brand h1 span {
  display: block;
}

.minimal-brand p {
  width: fit-content;
  margin-top: 22px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
  font-size: 15px;
  font-weight: 800;
  backdrop-filter: blur(12px);
}

.login-platform-status {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 720px;
  animation: brand-enter 0.78s 0.08s ease-out both;
}

.login-platform-status-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid rgba(219, 234, 254, 0.5);
  border-radius: 999px;
  background: rgba(7, 54, 89, 0.48);
  color: #eff6ff;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(2, 16, 31, 0.18);
  backdrop-filter: blur(10px);
}

.login-platform-status-item::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: #7dd3fc;
  box-shadow: 0 0 0 5px rgba(125, 211, 252, 0.14);
}

.login-platform-status-item b {
  color: #dbeafe;
  font-weight: 800;
}

.login-platform-status-item strong {
  color: #fff;
  font-weight: 900;
  text-shadow: 0 1px 8px rgba(1, 15, 29, 0.4);
}

.login-platform-status-item[data-state="waiting"]::before,
.login-platform-status-item[data-state="starting"]::before {
  background: #fbbf24;
  box-shadow: 0 0 0 5px rgba(251, 191, 36, 0.14);
}

.login-platform-status-item[data-state="unavailable"]::before {
  background: #fda4af;
  box-shadow: 0 0 0 5px rgba(253, 164, 175, 0.14);
}

.login-platform-status-item.is-loading::before {
  animation: login-status-pulse 1.2s ease-in-out infinite;
}

@keyframes login-status-pulse {
  50% {
    opacity: 0.45;
    transform: scale(0.82);
  }
}

.login-status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  animation: brand-enter 0.78s 0.12s ease-out both;
}

.login-status-strip span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(219, 234, 254, 0.5);
  border-radius: 999px;
  background: rgba(7, 54, 89, 0.48);
  color: #eff6ff;
  font-size: 12px;
  font-weight: 800;
  text-shadow: 0 1px 6px rgba(1, 15, 29, 0.38);
  backdrop-filter: blur(10px);
}

.login-status-strip span::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: #7dd3fc;
  box-shadow: 0 0 0 4px rgba(125, 211, 252, 0.14);
}

.refined-login .login-card {
  z-index: 2;
  animation: card-rise 0.62s ease-out both;
}

.refined-login .login-card::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 -60%;
  z-index: 0;
  width: 46%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.42), transparent);
  transform: skewX(-18deg);
  animation: card-gloss 5.2s ease-in-out infinite;
  pointer-events: none;
}

.refined-login .mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.login-role-select {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(15, 118, 110, 0.16);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(240, 249, 247, 0.86), rgba(239, 246, 255, 0.82));
}

.role-step {
  display: grid;
  gap: 18px;
}

.login-project-select {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid rgba(81, 132, 167, 0.2);
  border-radius: 14px;
  background: linear-gradient(140deg, rgba(237, 248, 255, 0.92), rgba(246, 252, 252, 0.9));
}

.login-project-select > span,
.login-role-caption {
  color: #31425a;
  font-size: 13px;
  font-weight: 900;
}

.login-project-select select {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid rgba(67, 113, 146, 0.22);
  border-radius: 10px;
  outline: 0;
  color: #17324a;
  font-size: 15px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.92);
}

.login-project-select select:focus {
  border-color: rgba(14, 116, 144, 0.55);
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.12);
}

.login-role-caption {
  margin-bottom: -7px;
}

.role-choice-grid {
  display: grid;
  gap: 12px;
}

.role-choice {
  position: relative;
  display: grid;
  gap: 6px;
  min-height: 82px;
  padding: 16px 18px 16px 20px;
  border: 1px solid rgba(15, 118, 110, 0.14);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(239, 246, 255, 0.9));
  color: #26364d;
  text-align: left;
  box-shadow: 0 8px 24px rgba(30, 48, 70, 0.07);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.role-choice::before {
  content: "";
  position: absolute;
  inset: 14px auto 14px 0;
  width: 4px;
  border-radius: 0 999px 999px 0;
  background: #9fb0c2;
}

.role-choice strong {
  font-size: 18px;
}

.role-choice span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.role-choice:hover {
  transform: translateY(-3px) scale(1.01);
  border-color: rgba(37, 99, 235, 0.32);
  box-shadow: 0 18px 42px rgba(15, 118, 110, 0.16);
}

.role-choice.active {
  border-color: transparent;
  background: linear-gradient(135deg, #0f766e, #2563eb);
  color: #fff;
  box-shadow: 0 18px 42px rgba(37, 99, 235, 0.22);
}

.role-choice.active::before {
  background: #facc15;
}

.role-choice.active span {
  color: rgba(255, 255, 255, 0.82);
}

.login-role-select::before {
  content: "";
  position: absolute;
  inset: 14px auto 14px 0;
  width: 4px;
  border-radius: 0 999px 999px 0;
  background: linear-gradient(180deg, #0f766e, #2563eb);
}

.login-role-select > span {
  color: #31425a;
  font-size: 13px;
  font-weight: 900;
}

.role-tabs.compact {
  margin-top: 0;
}

.role-tabs.compact button {
  flex: 1 1 0;
}

.mock-qr {
  position: relative;
  overflow: hidden;
  min-height: 228px;
  color: #0f172a;
  background:
    linear-gradient(90deg, rgba(15, 23, 42, 0.9) 10px, transparent 10px) 0 0 / 28px 28px,
    linear-gradient(rgba(15, 23, 42, 0.9) 10px, transparent 10px) 0 0 / 28px 28px,
    linear-gradient(135deg, #ffffff, #eaf7f5);
}

.mock-qr::before {
  content: "";
  position: absolute;
  inset: -46% 36%;
  background: linear-gradient(180deg, transparent, rgba(15, 118, 110, 0.32), transparent);
  transform: rotate(16deg);
  animation: scan-line 2.8s ease-in-out infinite;
}

.mock-qr::after {
  content: "";
  position: absolute;
  inset: 18px;
  border: 2px solid rgba(15, 118, 110, 0.2);
  border-radius: 8px;
  box-shadow:
    inset 0 0 0 8px rgba(255, 255, 255, 0.42),
    0 0 0 1px rgba(255, 255, 255, 0.72);
}

.mock-qr span,
.mock-qr strong {
  position: relative;
  z-index: 1;
  display: block;
}

.wechat-box p {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.mock-qr span {
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.mock-qr strong {
  max-width: 250px;
  margin-top: 12px;
  padding: 9px 11px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: #1f2a3d;
  font-size: 12px;
  word-break: break-all;
}

.mock-qr.dingtalk {
  background:
    linear-gradient(90deg, rgba(15, 23, 42, 0.9) 10px, transparent 10px) 0 0 / 28px 28px,
    linear-gradient(rgba(15, 23, 42, 0.9) 10px, transparent 10px) 0 0 / 28px 28px,
    linear-gradient(135deg, #ffffff, #eaf2ff);
}

.mock-qr.dingtalk span {
  color: #1d4ed8;
}

.project-switch {
  display: grid;
  gap: 7px;
  align-self: start;
  min-width: 220px;
  padding: 10px 12px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 24px rgba(22, 36, 56, 0.08);
}

.project-switch span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.project-switch select {
  min-height: 38px;
  padding: 6px 9px;
  border-radius: 6px;
  font-weight: 900;
}

.ops-overview-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 18px;
  align-items: center;
  min-height: 168px;
  padding: 24px;
  margin-bottom: 16px;
  border: 1px solid rgba(15, 118, 110, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.94), rgba(29, 78, 216, 0.84)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.14) 1px, transparent 1px) 0 0 / 42px 42px;
  color: #fff;
  box-shadow: 0 18px 46px rgba(15, 76, 86, 0.18);
}

.ops-overview-hero h2 {
  margin: 12px 0 8px;
  font-size: 36px;
}

.ops-overview-hero p {
  max-width: 760px;
  margin: 0;
  color: rgba(255, 255, 255, 0.84);
}

.hero-status {
  display: grid;
  place-items: center;
  width: 132px;
  height: 132px;
  justify-self: end;
  border: 12px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.hero-status strong {
  font-size: 28px;
  line-height: 1;
}

.hero-status span {
  margin-top: -28px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 900;
}

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

.overview-grid.lower {
  grid-template-columns: minmax(460px, 1.35fr) minmax(320px, 0.85fr);
}

.overview-card {
  position: relative;
  overflow: hidden;
  min-width: 0;
  padding: 21px;
  border: 1px solid rgba(139, 157, 177, 0.24);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 252, 255, 0.94)),
    #fff;
  box-shadow: 0 18px 46px rgba(22, 36, 56, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.overview-card::after {
  content: "";
  position: absolute;
  inset: -40% -20%;
  background:
    radial-gradient(circle at 20% 20%, rgba(15, 118, 110, 0.08), transparent 24%),
    radial-gradient(circle at 85% 16%, rgba(37, 99, 235, 0.06), transparent 26%),
    radial-gradient(circle at 50% 100%, rgba(180, 83, 9, 0.05), transparent 28%);
  animation: soft-drift 14s ease-in-out infinite alternate;
  pointer-events: none;
}

.overview-card:hover {
  transform: translateY(-4px) scale(1.005);
  border-color: rgba(15, 118, 110, 0.28);
  box-shadow: 0 18px 46px rgba(22, 36, 56, 0.13);
}

.overview-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, rgba(15, 118, 110, 0.82), rgba(37, 99, 235, 0.72));
}

.overview-card-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.overview-card-head h3 {
  margin: 0;
  font-size: 21px;
}

.overview-card-head span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef7f6;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 900;
}

.plc-list {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
}

.plc-row {
  --row-accent: #0f766e;
  --row-soft: rgba(15, 118, 110, 0.14);
  --row-soft-2: rgba(255, 255, 255, 0.88);
  --row-line: rgba(15, 118, 110, 0.18);
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 12px 15px 12px 17px;
  border: 1px solid var(--row-line);
  border-radius: 11px;
  background:
    linear-gradient(90deg, var(--row-soft), var(--row-soft-2) 42%, rgba(255, 255, 255, 0.96)),
    #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.plc-row::before {
  content: "";
  position: absolute;
  inset: 12px auto 12px 0;
  width: 4px;
  border-radius: 999px;
  background: var(--row-accent);
}

.plc-row::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.54) 38%, transparent 75%),
    radial-gradient(circle at 100% 0%, var(--row-soft), transparent 62%);
  pointer-events: none;
  opacity: 0.9;
  animation: row-sheen 8s ease-in-out infinite alternate;
}

.plc-row:hover {
  transform: translateY(-3px) scale(1.005);
  border-color: rgba(15, 118, 110, 0.28);
  box-shadow: 0 14px 30px rgba(22, 36, 56, 0.1);
}

.plc-row[data-tone="blue"] {
  --row-accent: #2563eb;
  --row-soft: rgba(37, 99, 235, 0.14);
  --row-line: rgba(37, 99, 235, 0.2);
}

.plc-row[data-tone="green"] {
  --row-accent: #16a34a;
  --row-soft: rgba(22, 163, 74, 0.14);
  --row-line: rgba(22, 163, 74, 0.2);
}

.plc-row[data-tone="cyan"] {
  --row-accent: #0891b2;
  --row-soft: rgba(8, 145, 178, 0.14);
  --row-line: rgba(8, 145, 178, 0.2);
}

.plc-row[data-tone="amber"] {
  --row-accent: #d97706;
  --row-soft: rgba(217, 119, 6, 0.14);
  --row-line: rgba(217, 119, 6, 0.22);
}

.plc-row[data-tone="violet"] {
  --row-accent: #7c3aed;
  --row-soft: rgba(124, 58, 237, 0.14);
  --row-line: rgba(124, 58, 237, 0.19);
}

.plc-row[data-tone="rose"] {
  --row-accent: #e11d48;
  --row-soft: rgba(225, 29, 72, 0.13);
  --row-line: rgba(225, 29, 72, 0.18);
}

.plc-list span {
  position: relative;
  z-index: 1;
  color: #26374f;
  font-weight: 900;
}

.plc-list strong {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  color: #1c2b40;
  font-size: 26px;
  line-height: 1;
}

.plc-list em,
.plc-list small {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
}

.plc-list sup,
.plc-list sub {
  font-size: 0.64em;
  line-height: 0;
}

.plc-list sup {
  vertical-align: super;
}

.plc-list sub {
  vertical-align: sub;
}

.plc-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 124px;
  min-height: 32px;
  border: 1px solid rgba(15, 118, 110, 0.12);
  border-radius: 9px;
  background:
    linear-gradient(180deg, rgba(233, 244, 255, 0.98), rgba(226, 237, 247, 0.94));
  color: #243447;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 22px;
  letter-spacing: 0;
}

.chart-panel {
  min-height: 380px;
}

.line-chart-card {
  display: grid;
  gap: 12px;
}

.line-chart-card svg {
  display: block;
  width: 100%;
  min-height: 260px;
  border: 1px solid #dbe6ee;
  border-radius: 10px;
  background:
    linear-gradient(180deg, #f8fbfd, #ffffff);
}

.chart-grid line {
  stroke: #dbe6ee;
  stroke-width: 1;
}

.chart-area {
  opacity: 0.11;
}

.chart-area.inflow {
  fill: #0f766e;
}

.chart-line {
  fill: none;
  stroke-width: 5;
  stroke-linecap: round;
}

.chart-line.inflow {
  stroke: url("#inflowLine");
}

.chart-line.outflow {
  stroke: url("#outflowLine");
}

.chart-labels text {
  fill: #64748b;
  font-size: 13px;
  font-weight: 800;
  text-anchor: middle;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.chart-legend span,
.chart-legend strong {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef3f8;
}

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

.inflow-dot {
  background: #0f766e;
}

.outflow-dot {
  background: #2563eb;
}

.ops-note-list,
.alarm-list {
  display: grid;
  gap: 12px;
}

.ops-note-list article,
.alarm-list article {
  padding: 14px;
  border: 1px solid #dbe6ee;
  border-radius: 8px;
  background: #f8fbfd;
}

.ops-note-list strong,
.alarm-list strong {
  display: block;
  font-size: 15px;
}

.ops-note-list p,
.alarm-list p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.alarm-panel {
  margin-bottom: 16px;
}

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

.alarm-list article:first-child {
  border-color: rgba(180, 83, 9, 0.28);
  background: #fff8eb;
}

.ops-overview-hero,
.overview-card,
.line-chart-card svg,
.plc-row,
.alarm-list article,
.ops-note-list article {
  position: relative;
  overflow: hidden;
}

.module-placeholder {
  display: grid;
  gap: 22px;
  min-height: 520px;
  padding: 26px;
  border: 1px solid rgba(119, 139, 160, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(239, 246, 255, 0.9)),
    #fff;
  box-shadow: var(--shadow-soft);
}

.module-placeholder h2 {
  margin: 12px 0 8px;
  font-size: 32px;
}

.module-placeholder p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
}

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

.placeholder-grid article {
  min-height: 150px;
  padding: 18px;
  border: 1px solid #dbe6ee;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(22, 36, 56, 0.07);
}

.placeholder-grid strong {
  display: block;
  font-size: 18px;
}

.placeholder-grid span {
  display: block;
  margin-top: 10px;
  color: var(--muted);
}

@keyframes login-bg-flow {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@keyframes tide-panel {
  0%,
  100% {
    transform: translateY(0) skewY(-7deg);
  }
  50% {
    transform: translateY(-18px) skewY(-7deg);
  }
}

@keyframes brand-enter {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes card-gloss {
  0%,
  35% {
    transform: translateX(0) skewX(-18deg);
  }
  70%,
  100% {
    transform: translateX(360%) skewX(-18deg);
  }
}

@keyframes insight-pulse {
  0%,
  100% {
    transform: scaleX(0.58);
    opacity: 0.62;
  }
  50% {
    transform: scaleX(0.96);
    opacity: 0.95;
  }
}

@keyframes console-grid-flow {
  0% {
    transform: translate3d(-2%, 0, 0) rotate(-6deg);
  }
  100% {
    transform: translate3d(2%, 0, 0) rotate(-6deg);
  }
}

@keyframes water-sweep {
  0% {
    transform: translate3d(-6%, 0, 0);
  }
  100% {
    transform: translate3d(6%, 0, 0);
  }
}

@keyframes wave-drift {
  0%,
  100% {
    transform: translate3d(-2%, 0, 0) rotate(-7deg);
  }
  50% {
    transform: translate3d(3%, -12px, 0) rotate(-7deg);
  }
}

@keyframes scan-line {
  0%,
  100% {
    transform: translateY(-62%) rotate(16deg);
  }
  50% {
    transform: translateY(62%) rotate(16deg);
  }
}

@keyframes card-rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes soft-drift {
  0% {
    transform: translate3d(-1.5%, -1%, 0) scale(1);
  }
  100% {
    transform: translate3d(1.5%, 1%, 0) scale(1.02);
  }
}

@keyframes row-sheen {
  0% {
    transform: translateX(-2%);
    opacity: 0.72;
  }
  100% {
    transform: translateX(2%);
    opacity: 1;
  }
}

@media (max-width: 1180px) {
  .grid.metrics,
  .grid.two,
  .split,
  .overview-grid,
  .overview-grid.lower,
  .alarm-list,
  .photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shell {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .minimal-brand h1 {
    font-size: 72px;
  }
}

@media (max-width: 920px) {
  .login,
  .shell {
    grid-template-columns: 1fr;
  }

  .login-visual {
    min-height: 350px;
    padding-top: 92px;
  }

  .company-lockup {
    left: 20px;
    right: 20px;
    max-width: none;
  }

  .sidebar {
    position: static;
    height: auto;
    gap: 12px;
    padding: 14px;
  }

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

  .side-nav button {
    justify-content: center;
    min-height: 42px;
    text-align: center;
  }

  .public-hero {
    grid-template-columns: 1fr;
  }

  .minimal-brand h1 {
    font-size: 58px;
  }

  .login-platform-status {
    gap: 8px;
  }
}

@media (max-width: 700px) {
  .modal-backdrop.user-modal {
    padding: 16px;
  }

  .modal-card,
  .user-delete-card {
    width: min(100%, calc(100vw - 24px));
    padding: 24px 20px;
  }

  .modal-head {
    gap: 14px;
    margin-bottom: 20px;
  }

  .modal-head h2 {
    font-size: 24px;
  }

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

  .project-grant-default,
  .project-grant-remove {
    align-self: center;
  }

  .workspace,
  .login-visual {
    padding: 20px;
  }

  .login-visual {
    padding-top: 94px;
  }

  .company-lockup {
    top: 14px;
    left: 14px;
    right: 14px;
    padding: 8px 10px;
  }

  .company-logo-full {
    width: 276px;
  }

  .login-card {
    width: calc(100% - 28px);
    padding: 20px;
  }

  .brand h1,
  .public-hero h2 {
    font-size: 44px;
  }

  .login-platform-status {
    gap: 8px;
  }

  .login-platform-status-item {
    min-height: 36px;
    padding: 0 13px;
    font-size: 12px;
  }

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

  .topbar {
    display: grid;
  }

  .project-switch {
    width: 100%;
  }

  .ops-overview-hero,
  .overview-grid,
  .overview-grid.lower,
  .alarm-list,
  .placeholder-grid {
    grid-template-columns: 1fr;
  }

  .ops-overview-hero h2 {
    font-size: 30px;
  }

  .hero-status {
    justify-self: start;
    width: 112px;
    height: 112px;
  }

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

  .plc-list strong {
    font-size: 22px;
  }

  .login-highlights,
  .grid.metrics,
  .grid.two,
  .split,
  .form-grid,
  .photo-grid,
  .code-row {
    grid-template-columns: 1fr;
  }

  .side-nav {
    grid-template-columns: 1fr;
  }

  .tr,
  .tr.head {
    grid-template-columns: 1fr !important;
  }

  .tr.head {
    display: none;
  }

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

  .progress-big {
    width: 172px;
    height: 172px;
  }

  .role-choice:hover,
  .panel:hover,
  .metric:hover,
  .photo-grid article:hover,
  .role-list article:hover,
  .task-list article:hover,
  .timeline article:hover {
    transform: none;
  }
}
