:root,
body {
  font-family: "Lufga", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji",
    "Segoe UI Emoji";
}

@font-face {
  font-family: "Lufga";
  src: url("/fonts/Lufga-Light.otf") format("opentype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Lufga";
  src: url("/fonts/Lufga-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Lufga";
  src: url("/fonts/Lufga-Medium.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Lufga";
  src: url("/fonts/Lufga-SemiBold.otf") format("opentype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Lufga";
  src: url("/fonts/Lufga-Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Lufga";
  src: url("/fonts/Lufga-Black.otf") format("opentype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #f6f9ff;
  --card: #ffffff;
  --text: #1a1a1a;
  --muted: #6b7280;
  --primary: #0b67b2;
  --primary-2: #0a4d86;
  --border: #e5e7eb;
  --shadow: 0 10px 30px rgba(2, 6, 23, 0.06);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: radial-gradient(1200px 500px at 20% 0%, rgba(11, 103, 178, 0.35), rgba(15, 23, 42, 0)),
    linear-gradient(90deg, #0b1220, #0f172a);
  color: #ffffff;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-user {
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  white-space: nowrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  height: 30px;
  width: auto;
  display: block;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.2));
}

.brand-text {
  display: grid;
}

.brand-title {
  font-weight: 700;
  letter-spacing: 0.2px;
}

.brand-subtitle {
  color: rgba(255, 255, 255, 0.75);
  font-size: 12px;
  margin-top: 2px;
}

.container {
  max-width: 1200px;
  margin: 18px auto;
  padding: 0 16px 32px;
}

body:not(.authed) .container {
  max-width: 1100px;
  margin: 0 auto;
  min-height: calc(100vh - 64px);
  display: grid;
  align-items: center;
}

body:not(.authed) #loginPanel.panel {
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.login-shell {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 14px;
  align-items: stretch;
}

.login-hero {
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 18px;
  background: radial-gradient(900px 420px at 20% 0%, rgba(11, 103, 178, 0.26), rgba(15, 23, 42, 0)),
    linear-gradient(180deg, rgba(11, 18, 32, 0.94), rgba(15, 23, 42, 0.94));
  color: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
}

.login-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: 0.6px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(255, 255, 255, 0.08);
}

.login-title {
  margin-top: 10px;
  font-size: 26px;
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: 0.2px;
}

.login-subtitle {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.74);
  max-width: 44ch;
}

.login-bullets {
  display: grid;
  gap: 10px;
  padding-top: 8px;
}

.login-bullet {
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.35);
  padding: 12px;
}

.login-bullet-title {
  font-weight: 850;
  letter-spacing: 0.2px;
}

.login-bullet-body {
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  line-height: 1.4;
}

.login-hero-foot {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.login-foot-muted {
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
}

.login-card {
  border-radius: 14px;
  border: 1px solid rgba(229, 231, 235, 0.9);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow);
  padding: 18px;
  display: grid;
  gap: 12px;
  align-content: start;
}

.login-card-title {
  font-weight: 900;
  font-size: 18px;
  color: rgba(15, 23, 42, 0.96);
}

.login-card-subtitle {
  margin-top: 6px;
  font-size: 12px;
  color: rgba(2, 6, 23, 0.62);
}

.login-form {
  max-width: 100%;
}

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

.login-hint {
  margin-top: 4px;
}

@media (max-width: 960px) {
  body:not(.authed) .container {
    min-height: auto;
    margin: 16px auto;
  }

  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-title {
    font-size: 22px;
  }
}

.authed .container {
  max-width: 100%;
  margin: 0;
  padding: 0;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - 64px);
}

.sidebar {
  background: linear-gradient(180deg, rgba(11, 18, 32, 0.98), rgba(15, 23, 42, 0.98));
  border-right: 1px solid rgba(148, 163, 184, 0.15);
  color: rgba(255, 255, 255, 0.92);
  padding: 16px 14px;
}

.sidebar-head {
  padding: 8px 10px 14px;
}

.sidebar-title {
  font-weight: 750;
  letter-spacing: 0.3px;
}

.sidebar-subtitle {
  color: rgba(255, 255, 255, 0.66);
  font-size: 12px;
  margin-top: 4px;
}

.nav {
  display: grid;
  gap: 8px;
  padding: 0 6px;
}

.nav-item {
  text-align: left;
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(15, 23, 42, 0.45);
  color: rgba(255, 255, 255, 0.88);
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
}

.nav-item:hover {
  background: rgba(15, 23, 42, 0.65);
}

.nav-item.active {
  background: rgba(11, 103, 178, 0.22);
  border-color: rgba(59, 130, 246, 0.35);
}

.nav-sep {
  height: 1px;
  background: rgba(148, 163, 184, 0.18);
  margin: 6px 4px;
}

.app-main {
  background: var(--bg);
  padding: 18px 18px 32px;
}

.app-main-head {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 14px 14px 10px;
  margin-bottom: 14px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
}

.page-title-text {
  font-size: 18px;
  font-weight: 800;
  color: rgba(2, 6, 23, 0.85);
}

.pages {
  display: grid;
  gap: 14px;
}

.page {
  display: grid;
  gap: 14px;
}

.customer-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.customer-badge-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(229, 231, 235, 0.9);
  padding: 6px;
}

.customer-badge-name {
  font-weight: 750;
  letter-spacing: 0.2px;
}

.dash-hero-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 14px;
}

.dash-hero-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.dash-hero-title {
  font-weight: 800;
  color: rgba(2, 6, 23, 0.85);
  margin-bottom: 0;
}

.dash-hero-view {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.seg {
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(11, 103, 178, 0.22);
  background: rgba(11, 103, 178, 0.06);
  color: rgba(2, 6, 23, 0.92);
  font-weight: 800;
  cursor: pointer;
}

.seg-active {
  border-color: rgba(11, 103, 178, 0.38);
  background: rgba(11, 103, 178, 0.12);
}

.hero-image-wrap--dash {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.04);
}

.hmi {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(2, 6, 23, 0.04);
}

.hmi-frame {
  background: linear-gradient(180deg, rgba(13, 124, 190, 0.92), rgba(5, 86, 156, 0.92));
  min-height: 520px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  position: relative;
}

.hmi-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: var(--hmi-machine-image, none);
  background-repeat: no-repeat;
  background-position: 14px center;
  background-size: 300px auto;
  opacity: 0.18;
  filter: grayscale(1) contrast(1.05);
}

.hmi-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.16);
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
}

.hmi-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hmi-bar-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.hmi-logo {
  height: 26px;
  width: auto;
  background: rgba(255, 255, 255, 0.85);
  padding: 4px 8px;
  border-radius: 10px;
}

.hmi-clock {
  min-width: 74px;
  text-align: center;
  background: rgba(2, 6, 23, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: rgba(255, 255, 255, 0.92);
  font-weight: 900;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 12px;
}

.hmi-bar-title {
  font-weight: 950;
  letter-spacing: 0.6px;
  color: rgba(255, 255, 255, 0.92);
}

.hmi-bar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hmi-bar-subtitle {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.90);
  font-weight: 800;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.hmi-live {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.9);
  box-shadow: 0 0 0 5px rgba(148, 163, 184, 0.18);
}

.hmi-live.hmi-live-ok {
  background: rgba(34, 197, 94, 0.95);
  box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.18);
}

.hmi-live.hmi-live-bad {
  background: rgba(239, 68, 68, 0.95);
  box-shadow: 0 0 0 5px rgba(239, 68, 68, 0.18);
}

.hmi-main {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 12px;
  padding: 14px;
  align-items: start;
}

.hmi-bg {
  position: absolute;
  inset: 14px;
  border-radius: 16px;
  background:
    radial-gradient(360px 240px at 65% 35%, rgba(255, 255, 255, 0.20), rgba(255, 255, 255, 0)),
    radial-gradient(540px 360px at 40% 80%, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0));
  pointer-events: none;
  opacity: 0.85;
}

.hmi-start {
  grid-column: 1 / 2;
  height: 54px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.30);
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.92), rgba(220, 38, 38, 0.92));
  color: rgba(2, 6, 23, 0.92);
  font-weight: 950;
  letter-spacing: 1px;
  font-size: 18px;
}

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

.hmi-alarm {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.92);
  padding: 14px;
  box-shadow: 0 16px 40px rgba(2, 6, 23, 0.22);
  display: grid;
  gap: 10px;
  min-height: 150px;
  align-content: center;
}

.hmi-alarm.hmi-alarm-ok {
  background: rgba(34, 197, 94, 0.92);
  color: rgba(2, 6, 23, 0.92);
}

.hmi-alarm.hmi-alarm-warn {
  background: rgba(245, 158, 11, 0.92);
  color: rgba(2, 6, 23, 0.92);
}

.hmi-alarm.hmi-alarm-fault {
  background: rgba(239, 68, 68, 0.92);
  color: rgba(2, 6, 23, 0.92);
}

.hmi-alarm.hmi-alarm-neutral {
  background: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.92);
}

.hmi-alarm-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.22);
  font-weight: 950;
}

.hmi-alarm-text {
  font-weight: 950;
  letter-spacing: 0.4px;
  font-size: 20px;
  white-space: pre-line;
  line-height: 1.2;
}

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

.hmi-mid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
}

.hmi-mini-grid {
  display: grid;
  gap: 10px;
}

.hmi-mini-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: center;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.14);
  padding: 10px 10px;
}

.hmi-mini-label {
  color: rgba(255, 255, 255, 0.92);
  font-weight: 900;
  letter-spacing: 0.35px;
  font-size: 12px;
}

.hmi-mini-value {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.92);
  color: rgba(2, 6, 23, 0.92);
  font-weight: 950;
  text-align: center;
  padding: 10px 10px;
  font-size: 18px;
}

.hmi-right {
  position: relative;
  z-index: 1;
  max-height: 430px;
  overflow: auto;
  padding-right: 2px;
}

.hmi-grid {
  display: grid;
  gap: 10px;
}

.hmi-config {
  margin-top: 12px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.92);
  padding: 12px;
}

.hmi-config-title {
  font-weight: 900;
  color: rgba(2, 6, 23, 0.88);
  margin-bottom: 8px;
}

.hmi-config-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}

.hmi-config-list {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.hmi-config-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 10px;
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.75);
}

.hmi-config-row-left {
  display: grid;
  gap: 2px;
}

.hmi-config-row-title {
  font-weight: 900;
  font-size: 13px;
}

.hmi-config-row-sub {
  font-size: 12px;
  color: rgba(2, 6, 23, 0.62);
}

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

.hmi-row {
  display: grid;
  grid-template-columns: 1fr 110px 70px;
  gap: 10px;
  align-items: center;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.14);
  padding: 10px 10px;
}

.hmi-label {
  color: rgba(255, 255, 255, 0.92);
  font-weight: 900;
  letter-spacing: 0.35px;
  font-size: 12px;
}

.hmi-value {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.92);
  color: rgba(2, 6, 23, 0.92);
  font-weight: 950;
  text-align: right;
  padding: 10px 10px;
  font-size: 22px;
}

.hmi-unit {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.32);
  color: rgba(255, 255, 255, 0.92);
  text-align: center;
  padding: 10px 8px;
  font-weight: 900;
}

.hmi-nav {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.20);
  background: rgba(2, 6, 23, 0.08);
}

.hmi-nav-btn {
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.92);
  font-weight: 900;
  letter-spacing: 0.3px;
}

.hmi-nav-btn:disabled {
  opacity: 0.55;
}

.hmi-nav-active {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.18);
}

.hmi .muted {
  color: rgba(255, 255, 255, 0.72);
}

.hmi-frame .btn,
.hmi-frame .field,
.hmi-frame .file-btn,
.hmi-frame .overlay-controls,
.hmi-frame .overlay-list {
  display: none;
}

.hmi .switch {
  filter: brightness(1.2);
}

@media (max-width: 980px) {
  .hmi-main {
    grid-template-columns: 1fr;
  }
  .hmi-start {
    grid-column: 1 / -1;
  }
  .hmi-mid {
    grid-template-columns: 1fr;
  }
}

.spacer {
  height: 10px;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 2;
    border-right: none;
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
  }
  .nav {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .nav-sep {
    display: none;
  }
}

.hero {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.hero-copy {
  background: radial-gradient(900px 340px at 15% 30%, rgba(11, 103, 178, 0.12), rgba(255, 255, 255, 0)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.75));
  border: 1px solid rgba(229, 231, 235, 0.8);
  border-radius: 14px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.hero-kicker {
  color: var(--primary);
  font-weight: 800;
  letter-spacing: 0.6px;
  font-size: 12px;
  text-transform: uppercase;
}

.hero-title {
  margin: 8px 0 8px;
  font-size: 28px;
  line-height: 1.15;
}

.hero-body {
  color: rgba(2, 6, 23, 0.72);
  font-size: 14px;
  line-height: 1.55;
  max-width: 54ch;
}

.hero-media {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.8));
  border: 1px solid rgba(229, 231, 235, 0.8);
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
}

.hero-image-wrap {
  position: relative;
  border-radius: 12px;
  border: 1px dashed rgba(11, 103, 178, 0.35);
  background: radial-gradient(600px 240px at 50% 0%, rgba(11, 103, 178, 0.08), rgba(255, 255, 255, 0));
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 380px;
}

.hero-image {
  max-width: 100%;
  max-height: 440px;
  object-fit: contain;
  display: block;
}

.overlay-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.overlay-layer.editing {
  pointer-events: auto;
}

.overlay-block {
  position: absolute;
  transform: translate(-50%, -50%);
  border-radius: 12px;
  border: 1px solid rgba(11, 103, 178, 0.32);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 26px rgba(2, 6, 23, 0.08);
  backdrop-filter: blur(6px);
  cursor: grab;
  user-select: none;
  touch-action: none;
  min-width: 120px;
}

.overlay-layer:not(.editing) .overlay-block {
  cursor: default;
}

.overlay-block.size-sm {
  padding: 8px 10px;
}

.overlay-block.size-md {
  padding: 10px 12px;
}

.overlay-block.size-lg {
  padding: 12px 14px;
  min-width: 150px;
}

.overlay-title {
  font-size: 12px;
  color: rgba(2, 6, 23, 0.62);
  font-weight: 700;
}

.overlay-value {
  margin-top: 6px;
  font-size: 18px;
  font-weight: 800;
  color: rgba(2, 6, 23, 0.9);
  letter-spacing: 0.2px;
}

.overlay-layer.editing .overlay-block::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 16px;
  border: 1px dashed rgba(11, 103, 178, 0.25);
  pointer-events: none;
}

.overlay-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}

.overlay-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.overlay-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 10px;
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.75);
}

.overlay-row-left {
  display: grid;
  gap: 2px;
}

.overlay-row-title {
  font-weight: 800;
  font-size: 13px;
}

.overlay-row-sub {
  font-size: 12px;
  color: var(--muted);
}

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

.btn-ghost {
  height: 32px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(11, 103, 178, 0.22);
  background: rgba(11, 103, 178, 0.06);
  color: rgba(2, 6, 23, 0.92);
  font-weight: 800;
  cursor: pointer;
}

.btn-danger {
  height: 32px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(220, 38, 38, 0.22);
  background: rgba(220, 38, 38, 0.06);
  color: rgba(127, 29, 29, 0.95);
  font-weight: 800;
  cursor: pointer;
}

.switch {
  height: 18px;
  width: 18px;
}

.hero-media-actions {
  display: grid;
  gap: 6px;
}

.file-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(11, 103, 178, 0.35);
  background: rgba(11, 103, 178, 0.08);
  color: rgba(2, 6, 23, 0.9);
  font-weight: 700;
  cursor: pointer;
  width: fit-content;
}

.file-btn input[type="file"] {
  display: none;
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.panel + .panel {
  margin-top: 16px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.panel > .muted {
  margin-top: 6px;
}

.customer {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(229, 231, 235, 0.8);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow);
}

.customer-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.customer-logo {
  height: 42px;
  width: 42px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #ffffff;
  padding: 6px;
}

.customer-name {
  font-weight: 900;
  color: rgba(15, 23, 42, 0.95);
}

.customer-settings {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.customer-settings-title {
  font-weight: 900;
  color: rgba(15, 23, 42, 0.92);
}

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

.customer-thresholds-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.admin {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(229, 231, 235, 0.8);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(11, 103, 178, 0.05), rgba(255, 255, 255, 0.55));
}

.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.admin-title {
  font-weight: 800;
  letter-spacing: 0.3px;
  color: rgba(15, 23, 42, 0.95);
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.admin-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.admin-card.full {
  grid-column: 1 / -1;
}

.admin-card-title {
  font-weight: 800;
  color: rgba(15, 23, 42, 0.92);
}

.admin-tabs {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 12px;
}

.tab-btn {
  height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(2, 6, 23, 0.12);
  background: rgba(255, 255, 255, 0.75);
  color: rgba(2, 6, 23, 0.9);
  font-weight: 800;
  cursor: pointer;
}

.tab-btn[aria-selected='true'] {
  border-color: rgba(11, 103, 178, 0.32);
  background: rgba(11, 103, 178, 0.09);
}

.admin-split {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 12px;
  align-items: start;
}

.admin-detail {
  display: grid;
  gap: 10px;
}

.admin-detail-title {
  font-weight: 800;
  color: rgba(15, 23, 42, 0.92);
}

.admin-list-title {
  font-weight: 800;
  font-size: 12px;
  color: rgba(15, 23, 42, 0.8);
  margin: 4px 0 6px;
}

.admin-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px 12px;
  margin-top: 10px;
  margin-bottom: 10px;
}

.admin-pager {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.stack {
  display: grid;
  gap: 10px;
}

.wizard-steps {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.wizard-step {
  height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(2, 6, 23, 0.12);
  background: rgba(255, 255, 255, 0.7);
  color: rgba(2, 6, 23, 0.9);
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
}

.wizard-step[aria-selected='true'] {
  border-color: rgba(11, 103, 178, 0.32);
  background: rgba(11, 103, 178, 0.09);
}

@media (max-width: 960px) {
  .admin-split {
    grid-template-columns: 1fr;
  }
}

.codebox {
  margin: 0;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.04);
  color: rgba(15, 23, 42, 0.9);
  font-size: 12px;
  line-height: 1.35;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  width: 100%;
}

.panel-title {
  margin: 0 0 12px 0;
  font-size: 18px;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.form-grid {
  display: grid;
  gap: 12px;
  max-width: 640px;
}

.field {
  display: grid;
  gap: 6px;
}

.field.inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.field-label {
  font-size: 12px;
  color: var(--muted);
}

input,
select {
  height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
  color: var(--text);
  outline: none;
}

input:focus,
select:focus {
  border-color: rgba(11, 103, 178, 0.55);
  box-shadow: 0 0 0 3px rgba(11, 103, 178, 0.14);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn {
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 600;
}

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

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.app-main .btn-secondary,
.panel .btn-secondary {
  background: rgba(11, 103, 178, 0.08);
  border-color: rgba(11, 103, 178, 0.22);
  color: rgba(2, 6, 23, 0.92);
}

.app-main .btn-secondary:hover,
.panel .btn-secondary:hover {
  background: rgba(11, 103, 178, 0.12);
  border-color: rgba(11, 103, 178, 0.28);
}

.app-main .btn-secondary:disabled,
.panel .btn-secondary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-outline {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(11, 103, 178, 0.28);
  color: rgba(2, 6, 23, 0.92);
}

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

.status-online {
  color: #065f46;
  font-weight: 700;
}

.status-offline {
  color: #b91c1c;
  font-weight: 700;
}

.status-pending {
  color: #b45309;
  font-weight: 700;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.2px;
  border: 1px solid rgba(2, 6, 23, 0.08);
  background: rgba(255, 255, 255, 0.85);
}

.pill-online {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.28);
  color: #065f46;
}

.pill-offline {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.3);
  color: #991b1b;
}

.pill-pending {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.3);
  color: #92400e;
}

.pill-muted {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.22);
  color: rgba(2, 6, 23, 0.65);
}

.device-cell {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.device-cell-title {
  font-weight: 800;
  color: rgba(15, 23, 42, 0.92);
}

.device-cell-meta {
  margin-top: 2px;
  font-size: 12px;
}

.device-cell-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 1px;
  white-space: nowrap;
}

.hint {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

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

.card {
  grid-column: span 6;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}

.card.wide {
  grid-column: span 12;
}

.card-title {
  font-weight: 700;
  margin-bottom: 10px;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.health-pills {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.kv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
}

.kv-grid-auto {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  justify-content: space-between;
}

#kpiGrid {
  margin-bottom: 10px;
}

#healthText {
  margin-top: 6px;
}

.kv {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
}

.kv-k {
  font-size: 12px;
  color: var(--muted);
}

.kv-v {
  font-size: 18px;
  font-weight: 700;
  margin-top: 4px;
}

.value-ok {
  color: #16a34a;
}

.value-bad {
  color: #dc2626;
}

.chart {
  height: 420px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: radial-gradient(900px 300px at 50% 0%, rgba(11, 103, 178, 0.07), rgba(255, 255, 255, 0));
  overflow: hidden;
}

.chart-controls {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 10px;
}

.table-wrap {
  overflow: auto;
}

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

.table th,
.table td {
  border-bottom: 1px solid var(--border);
  padding: 10px;
  text-align: left;
  font-size: 13px;
}

@media (max-width: 920px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .customer-settings-grid {
    grid-template-columns: 1fr;
  }
  .admin-grid {
    grid-template-columns: 1fr;
  }
  .card {
    grid-column: span 12;
  }
  .panel-head {
    flex-direction: column;
  }
  .controls {
    justify-content: flex-start;
  }
  .chart {
    height: 320px;
  }
}
