:root {
  color-scheme: light;
  --font-sans: "Acumin Pro", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  --radius-sm: 5px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-1: 0 3px 6px rgba(0, 0, 0, 0.16);
  --shadow-2: 0 12px 30px rgba(15, 23, 42, 0.18);
  --body-background: var(--surface-0);
  --surface-0: #ffffff;
  --surface-1: #f6f6f6;
  --surface-2: #eeeeee;
  --surface-elevated: rgba(255, 255, 255, 0.96);
  --surface-side: #eeeeee;
  --surface-border: rgba(15, 23, 42, 0.08);
  --surface-backdrop-filter: none;
  --chrome-surface: var(--surface-elevated);
  --chrome-border: var(--surface-border);
  --chrome-shadow: var(--shadow-1);
  --chrome-highlight: transparent;
  --button-primary-background: var(--primary-button);
  --button-primary-shadow: none;
  --button-primary-border: transparent;
  --device-card-border: transparent;
  --device-card-shadow: var(--shadow);
  --device-card-backdrop-filter: none;
  --tab-active-bg: var(--surface-1);
  --bottom-nav-surface: var(--surface-elevated);
  --bottom-nav-border: var(--surface-border);
  --bottom-nav-shadow: 0 -8px 20px rgba(0, 0, 0, 0.16);
  --text-primary: #111827;
  --text-muted: #6b7280;
  --border-subtle: #d0d0d0;
  --border-strong: #717171;
  --accent: #348fca;
  --accent-contrast: #ffffff;
  --danger: #d32f2f;
  --success: #1f9d55;
  --warning: #b7791f;
  --card-ok: #61d96a;
  --card-alert: #f8a6a6;
  --card-offline: #a6a6a6;
  --card-maintenance: #ffcc00;
  --overlay: rgba(0, 0, 0, 0.35);
  --card-control-bg: rgba(255, 255, 255, 0.6);
  --card-control-bg-hover: rgba(255, 255, 255, 0.82);
  --primary: var(--accent);
  --primary-button: var(--accent);
  --title: var(--text-primary);
  --muted: var(--text-muted);
  --bg: var(--surface-0);
  --side: var(--surface-side);
  --content-big: var(--surface-1);
  --content-small: var(--surface-2);
  --shadow: var(--shadow-1);
  --radius: var(--radius-md);
  --font: var(--font-sans);
}

html[data-theme="material"] {
  --surface-0: #ffffff;
  --surface-1: #f6f6f6;
  --surface-2: #eeeeee;
  --surface-elevated: rgba(255, 255, 255, 0.98);
  --surface-side: #eeeeee;
  --accent: #348fca;
  --card-ok: #3bda37;
  --card-alert: #f8a6a6;
  --card-offline: #a6a6a6;
  --card-maintenance: #ffcc00;
}

html[data-theme="steel"] {
  --body-background:
    radial-gradient(900px 380px at 12% -8%, rgba(255, 255, 255, 0.58) 0%, rgba(255, 255, 255, 0) 55%),
    radial-gradient(760px 320px at 100% 16%, rgba(171, 184, 196, 0.36) 0%, rgba(171, 184, 196, 0) 58%),
    linear-gradient(180deg, #f2f5f8 0%, #dbe1e7 44%, #eef2f5 100%);
  --surface-0: #eef1f4;
  --surface-1: #dde2e8;
  --surface-2: #d2d8df;
  --surface-elevated: rgba(248, 250, 252, 0.94);
  --surface-side:
    linear-gradient(180deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0) 18%),
    linear-gradient(180deg, #edf1f5 0%, #d8dee5 100%);
  --surface-border: rgba(15, 23, 42, 0.12);
  --chrome-surface:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62) 0%, rgba(255, 255, 255, 0.16) 14%, rgba(255, 255, 255, 0.02) 100%),
    linear-gradient(180deg, rgba(239, 243, 247, 0.96) 0%, rgba(214, 221, 228, 0.98) 100%);
  --chrome-border: rgba(93, 107, 122, 0.28);
  --chrome-shadow: 0 14px 30px rgba(31, 41, 51, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.82);
  --text-primary: #1f2933;
  --text-muted: #52606d;
  --border-subtle: #b6c2cf;
  --border-strong: #7b8794;
  --accent: #5f8fb1;
  --button-primary-background: linear-gradient(180deg, #8eb0c7 0%, #5f8fb1 100%);
  --button-primary-shadow: 0 12px 24px rgba(63, 91, 114, 0.18);
  --button-primary-border: rgba(255, 255, 255, 0.42);
  --card-ok: #95c89c;
  --card-alert: #e8b0b0;
  --card-offline: #b8c0c8;
  --card-maintenance: #d8ba6a;
  --shadow-1: 0 4px 14px rgba(31, 41, 51, 0.14);
  --shadow-2: 0 18px 34px rgba(31, 41, 51, 0.18);
  --card-control-bg: rgba(255, 255, 255, 0.72);
  --card-control-bg-hover: rgba(255, 255, 255, 0.92);
  --device-card-border: rgba(98, 111, 124, 0.24);
  --device-card-shadow: 0 16px 28px rgba(31, 41, 51, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.42);
  --tab-active-bg: rgba(255, 255, 255, 0.52);
  --bottom-nav-surface:
    linear-gradient(180deg, rgba(255, 255, 255, 0.6) 0%, rgba(214, 221, 228, 0.96) 100%);
  --bottom-nav-border: rgba(93, 107, 122, 0.24);
  --bottom-nav-shadow: 0 -8px 20px rgba(31, 41, 51, 0.12);
}

html[data-theme="glass"] {
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --body-background:
    radial-gradient(1200px 520px at -5% -10%, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0) 54%),
    radial-gradient(780px 440px at 105% 10%, rgba(117, 196, 255, 0.36) 0%, rgba(117, 196, 255, 0) 58%),
    radial-gradient(720px 420px at 18% 100%, rgba(255, 178, 216, 0.26) 0%, rgba(255, 178, 216, 0) 56%),
    linear-gradient(180deg, #f3f8ff 0%, #dfeeff 42%, #eef6ff 100%);
  --surface-0: #eff6ff;
  --surface-1: rgba(247, 251, 255, 0.56);
  --surface-2: rgba(230, 239, 252, 0.44);
  --surface-elevated: rgba(255, 255, 255, 0.34);
  --surface-side: linear-gradient(180deg, rgba(255, 255, 255, 0.36) 0%, rgba(229, 239, 255, 0.2) 100%);
  --surface-border: rgba(255, 255, 255, 0.5);
  --surface-backdrop-filter: blur(26px) saturate(180%);
  --chrome-surface: linear-gradient(180deg, rgba(255, 255, 255, 0.42) 0%, rgba(255, 255, 255, 0.22) 100%);
  --chrome-border: rgba(255, 255, 255, 0.56);
  --chrome-shadow: 0 22px 48px rgba(27, 44, 76, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.72);
  --chrome-highlight: rgba(255, 255, 255, 0.68);
  --text-primary: #0b1220;
  --text-muted: rgba(25, 37, 61, 0.72);
  --border-subtle: rgba(140, 158, 189, 0.34);
  --border-strong: rgba(97, 114, 138, 0.48);
  --accent: #007aff;
  --button-primary-background: linear-gradient(180deg, #4fb2ff 0%, #0a84ff 100%);
  --button-primary-shadow: 0 16px 30px rgba(10, 132, 255, 0.28);
  --button-primary-border: rgba(255, 255, 255, 0.52);
  --card-ok: linear-gradient(180deg, rgba(214, 255, 237, 0.54) 0%, rgba(112, 223, 166, 0.56) 100%);
  --card-alert: linear-gradient(180deg, rgba(255, 235, 242, 0.54) 0%, rgba(244, 143, 177, 0.58) 100%);
  --card-offline: linear-gradient(180deg, rgba(240, 245, 252, 0.56) 0%, rgba(164, 176, 193, 0.58) 100%);
  --card-maintenance: linear-gradient(180deg, rgba(255, 247, 214, 0.54) 0%, rgba(250, 204, 21, 0.56) 100%);
  --shadow-1: 0 12px 28px rgba(56, 88, 129, 0.14);
  --shadow-2: 0 28px 56px rgba(56, 88, 129, 0.18);
  --card-control-bg: rgba(255, 255, 255, 0.34);
  --card-control-bg-hover: rgba(255, 255, 255, 0.5);
  --device-card-border: rgba(255, 255, 255, 0.42);
  --device-card-shadow: 0 22px 44px rgba(31, 46, 78, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.46);
  --device-card-backdrop-filter: blur(20px) saturate(150%);
  --tab-active-bg: rgba(255, 255, 255, 0.42);
  --bottom-nav-surface: linear-gradient(180deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.24) 100%);
  --bottom-nav-border: rgba(255, 255, 255, 0.58);
  --bottom-nav-shadow: 0 22px 48px rgba(20, 34, 63, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.68);
}

html[data-theme="steel"] .login-layout,
html[data-theme="steel"] .shell,
html[data-theme="steel"] .main {
  background: transparent;
}

html[data-theme="steel"] .sidebar,
html[data-theme="steel"] .topbar,
html[data-theme="steel"] .simple-card,
html[data-theme="steel"] .device-tabs,
html[data-theme="steel"] .modal,
html[data-theme="steel"] .bottom-nav,
html[data-theme="steel"] .device-card,
html[data-theme="steel"] .login-image {
  position: relative;
}

html[data-theme="steel"] .sidebar::before,
html[data-theme="steel"] .topbar::before,
html[data-theme="steel"] .simple-card::before,
html[data-theme="steel"] .device-tabs::before,
html[data-theme="steel"] .modal::before,
html[data-theme="steel"] .bottom-nav::before,
html[data-theme="steel"] .device-card::before,
html[data-theme="steel"] .login-image::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.42) 0%, rgba(255, 255, 255, 0.08) 18%, rgba(255, 255, 255, 0) 100%),
    repeating-linear-gradient(
      100deg,
      rgba(255, 255, 255, 0.2) 0 1px,
      rgba(205, 212, 220, 0.02) 1px 4px,
      rgba(123, 135, 148, 0.08) 4px 5px,
      rgba(226, 232, 238, 0.04) 5px 8px
    );
  opacity: 0.8;
}

html[data-theme="steel"] .menu-item.active,
html[data-theme="steel"] .bottom-nav button.active {
  color: #496d87;
}

html[data-theme="steel"] .avatar {
  background: linear-gradient(180deg, #8aa9bf 0%, #637f95 100%);
  box-shadow: 0 10px 20px rgba(49, 63, 76, 0.16);
}

html[data-theme="steel"] .card-settings-btn {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82), 0 6px 14px rgba(31, 41, 51, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--body-background);
  background-attachment: fixed;
  color: var(--text-primary);
}

img {
  max-width: 100%;
  display: block;
}

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

button {
  font-family: inherit;
}

.hidden {
  display: none !important;
}

.root {
  min-height: 100%;
  position: relative;
  z-index: 1;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(17, 24, 39, 0.12);
  border-top-color: rgba(17, 24, 39, 0.45);
  border-radius: 999px;
  animation: spin 900ms linear infinite;
  margin: 24px auto;
}

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

/* Login / Forgot */
.login-layout {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
}

.login-panel {
  width: 100%;
  padding: 32px;
}

@media (min-width: 640px) {
  .login-panel {
    width: 520px;
  }
}

.login-title {
  color: var(--title);
  font-weight: 700;
  font-size: 24px;
  margin: 16px 0 0;
}

.form-space {
  height: 56px;
}

.field {
  margin-top: 24px;
}

.label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.input-row {
  position: relative;
}

.input {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 0 8px;
  font-size: 12px;
  outline: none;
  background: transparent;
  color: var(--text-primary);
}

.input::placeholder {
  color: #a2a0a0;
}

.input-toggle {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
}

.hint-link {
  display: inline-block;
  color: var(--accent);
  font-size: 14px;
  cursor: pointer;
}

.hint-right {
  margin-top: 16px;
  text-align: right;
}

.error-text {
  margin-top: 10px;
  color: var(--danger);
  font-size: 12px;
  font-weight: 600;
}

.btn-primary {
  width: 100%;
  border: none;
  background: var(--button-primary-background);
  color: var(--accent-contrast);
  border-radius: var(--radius-sm);
  border: 1px solid var(--button-primary-border);
  box-shadow: var(--button-primary-shadow);
  padding: 10px 16px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

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

.btn-transparent {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 15px;
  cursor: pointer;
}

.store-row {
  display: none;
  margin-top: 48px;
  gap: 16px;
  justify-content: space-evenly;
  align-items: center;
}

@media (min-width: 640px) {
  .store-row {
    display: flex;
  }
}

.copyright {
  margin-top: auto;
  text-align: center;
  font-weight: 700;
  font-size: 12px;
}

@media (min-width: 640px) {
  .copyright {
    font-size: 14px;
  }
}

.login-image {
  display: none;
  flex: 1;
  background: var(--surface-elevated);
}

@media (min-width: 640px) {
  .login-image {
    display: block;
  }
}

.login-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* App shell (RootContainer-like) */
.shell {
  min-height: 100vh;
  display: flex;
  background: var(--bg);
}

.sidebar {
  display: none;
  width: 240px;
  background: var(--side);
  border-right: 1px solid var(--surface-border);
  backdrop-filter: var(--surface-backdrop-filter);
  padding: 64px 32px 0;
}

@media (min-width: 640px) {
  .sidebar {
    display: block;
  }
}

.menu {
  margin-top: 64px;
  display: grid;
  gap: 40px;
}

.menu-divider {
  height: 1px;
  background: var(--border-strong);
  margin: 20px 0;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  user-select: none;
  color: var(--text-muted);
}

.menu-item .material-icons-outlined {
  font-size: 28px;
  width: 28px;
  flex: 0 0 28px;
  overflow: hidden;
}

.menu-item .menu-label {
  font-size: 18px;
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  background: var(--chrome-surface);
  border-bottom: 1px solid var(--chrome-border);
  box-shadow: var(--chrome-shadow);
  backdrop-filter: var(--surface-backdrop-filter);
  padding: 0 16px;
  height: 80px;
  display: grid;
  align-content: center;
  gap: 6px;
}

@media (min-width: 640px) {
  .topbar {
    height: 64px;
    padding: 0 32px;
    grid-template-columns: 1fr auto;
    gap: 0;
    align-items: center;
  }
}

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

.topbar-title {
  color: var(--title);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

@media (min-width: 640px) {
  .topbar-title {
    font-size: 24px;
  }
}

.user-area {
  display: flex;
  align-items: center;
  gap: 16px;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--accent-contrast);
  display: grid;
  place-items: center;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
}

.logout {
  display: none;
  cursor: pointer;
  color: var(--primary);
}

@media (min-width: 640px) {
  .logout {
    display: inline-flex;
  }
}

.main {
  flex: 1;
  overflow: auto;
  background: var(--content-small);
  padding: 0 16px 92px;
}

@media (min-width: 640px) {
  .main {
    background: var(--content-big);
    padding: 0 32px 24px;
  }
}

.simple-card {
  background: var(--chrome-surface);
  border: 1px solid var(--chrome-border);
  backdrop-filter: var(--surface-backdrop-filter);
  border-radius: var(--radius);
  box-shadow: var(--chrome-shadow);
  padding: 16px;
  width: 100%;
}

.spacer-16 {
  height: 16px;
}

.filter-bar {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

@media (min-width: 640px) {
  .filter-bar {
    justify-content: flex-end;
  }
}

.focus-btn {
  width: 104px;
  padding: 6px 8px;
  border-radius: 5px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-primary);
}

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

.devices-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.devices-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.device-card {
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--device-card-border);
  box-shadow: var(--device-card-shadow);
  backdrop-filter: var(--device-card-backdrop-filter);
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
  position: relative;
  overflow: hidden;
}

.device-card--skeleton {
  background: #f4f5f7;
  cursor: default;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.device-card--skeleton .device-head {
  align-items: center;
}

.device-card--skeleton .device-head-right {
  justify-content: flex-end;
}

.skeleton-line,
.skeleton-circle,
.skeleton-icon {
  position: relative;
  overflow: hidden;
  background: linear-gradient(90deg, rgba(210, 214, 220, 0.95) 0%, rgba(235, 237, 241, 1) 50%, rgba(210, 214, 220, 0.95) 100%);
  background-size: 220% 100%;
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
}

.skeleton-line {
  display: block;
  border-radius: 999px;
}

.skeleton-line--title {
  height: 24px;
}

.skeleton-line--meta {
  height: 14px;
}

.skeleton-line--value {
  height: 18px;
}

.skeleton-line--label {
  height: 12px;
}

.skeleton-line--mini {
  height: 10px;
}

.skeleton-circle {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.skeleton-icon {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  flex: 0 0 auto;
}

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

  100% {
    background-position: -100% 0;
  }
}

.device-card > :not(.card-sparkline) {
  position: relative;
  z-index: 1;
}

.card-sparkline {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.3;
  pointer-events: none;
}

.device-card--maintenance {
  background: var(--card-maintenance);
}

.device-card--offline {
  background: var(--card-offline);
}

.device-card--alert {
  background: var(--card-alert);
}

.device-card--ok {
  background: var(--card-ok);
}

.device-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 32px;
}

.device-head-right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: 45%;
}

.device-name {
  font-size: 17px;
  font-weight: 700;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.device-desc {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
  min-width: 0;
}

.card-settings-btn {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 0;
  background: var(--card-control-bg);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.card-settings-btn:hover {
  background: var(--card-control-bg-hover);
}

.card-settings-btn .material-icons-outlined {
  font-size: 18px;
}

.device-tabs {
  height: 60px;
  display: flex;
  gap: 12px;
  padding: 12px 24px;
  border-radius: 12px;
  background: var(--chrome-surface);
  border: 1px solid var(--chrome-border);
  box-shadow: var(--chrome-shadow);
  backdrop-filter: var(--surface-backdrop-filter);
}

.device-tab {
  flex: 1;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-weight: 700;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-primary);
}

.device-tab--active {
  background: var(--tab-active-bg);
  color: var(--primary);
}

.badges-row {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.duration-badge {
  padding: 6px 24px;
  border-radius: 8px;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  text-align: center;
}

.chart-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.chart-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.3px;
}

.chart-meta {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}

.chart-icon {
  font-size: 14px;
}

.chart-thresholds {
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 700;
  font-size: 10px;
}

.chart-threshold--max {
  color: var(--danger);
}

.chart-threshold--min {
  color: var(--primary);
}

.chart-canvas {
  width: 100%;
  height: 220px;
  display: block;
  border-radius: 10px;
  background: var(--surface-elevated);
}

.chart-empty {
  width: 100%;
  height: 220px;
  border-radius: 10px;
  background: var(--surface-1);
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 700;
}

.chart-stats {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  font-weight: 700;
}

.state-box {
  width: 128px;
  height: 128px;
  border-radius: 16px;
  display: grid;
  place-items: center;
}

.state-box--alert {
  background: var(--danger);
}

.state-box--ok {
  background: var(--success);
}

.state-box-icon {
  font-size: 80px;
  color: #fff;
}

.device-body {
  display: flex;
  align-items: flex-start;
  min-height: 64px;
}

.device-body > * {
  flex: 1 1 auto;
  min-width: 0;
}

.device-card--maintenance .device-body {
  align-items: center;
}

.dash-icons {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 14px;
  width: 100%;
  margin-top: 8px;
}

.dash-item {
  display: grid;
  grid-template-rows: auto auto;
  align-content: start;
  justify-items: start;
  text-align: left;
  row-gap: 4px;
  padding: 2px 0;
  min-width: 0;
}

.flash {
  animation: flash-ring 850ms ease-out;
}

@keyframes flash-ring {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }

  20% {
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.85);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
}

.dash-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  justify-content: start;
  gap: 8px;
  width: 100%;
  min-height: 24px;
}

.dash-top .material-icons-outlined {
  font-size: 19px;
  line-height: 1;
}

.dash-value {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  min-width: 0;
}

.dash-value--state {
  font-size: 12px;
  letter-spacing: 0.04em;
}

.dash-label {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.15;
  width: 100%;
}

.maintenance-text {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.alerted {
  color: var(--danger);
}

.device-foot {
  min-height: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
}

.meta-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.meta-left .material-icons-outlined {
  font-size: 16px;
}

.mini {
  font-size: 9px;
}

.battery {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.rotate-90 {
  transform: rotate(90deg);
}

.signal {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.signal .label {
  margin: 0;
  font-size: 9px;
  font-weight: 700;
  color: var(--text-primary);
}

.signal .value {
  font-size: 9px;
  color: var(--text-primary);
}

/* Selector modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 50;
}

.modal {
  width: min(380px, 100%);
  border-radius: 10px;
  overflow: hidden;
  background: var(--chrome-surface);
  border: 1px solid var(--chrome-border);
  box-shadow: var(--shadow-2), var(--chrome-shadow);
  backdrop-filter: var(--surface-backdrop-filter);
}

.modal-header {
  padding: 14px 16px;
  font-weight: 700;
  color: var(--title);
}

.modal-option {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text-primary);
  text-align: left;
  padding: 14px 16px;
  cursor: pointer;
  font-size: 14px;
  border-top: 1px solid var(--surface-border);
}

/* Bottom navigation (mobile) */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(68px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--bottom-nav-surface);
  border-top: 1px solid var(--bottom-nav-border);
  box-shadow: var(--bottom-nav-shadow);
  backdrop-filter: var(--surface-backdrop-filter);
  display: flex;
  overflow: hidden;
}

html[data-theme="glass"] body {
  min-height: 100vh;
}

html[data-theme="glass"] .login-layout,
html[data-theme="glass"] .shell,
html[data-theme="glass"] .main {
  background: transparent;
}

html[data-theme="glass"] .login-image,
html[data-theme="glass"] .sidebar,
html[data-theme="glass"] .topbar,
html[data-theme="glass"] .simple-card,
html[data-theme="glass"] .device-tabs,
html[data-theme="glass"] .modal,
html[data-theme="glass"] .bottom-nav {
  position: relative;
}

html[data-theme="glass"] .login-image::before,
html[data-theme="glass"] .sidebar::before,
html[data-theme="glass"] .topbar::before,
html[data-theme="glass"] .simple-card::before,
html[data-theme="glass"] .device-tabs::before,
html[data-theme="glass"] .modal::before,
html[data-theme="glass"] .bottom-nav::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.38) 0%, rgba(255, 255, 255, 0.04) 42%, rgba(255, 255, 255, 0) 100%);
}

html[data-theme="glass"] .menu-item,
html[data-theme="glass"] .logout {
  color: rgba(11, 18, 32, 0.72);
}

html[data-theme="glass"] .menu-item:hover,
html[data-theme="glass"] .menu-item.active,
html[data-theme="glass"] .bottom-nav button.active {
  color: var(--accent);
}

html[data-theme="glass"] .avatar {
  background: linear-gradient(180deg, rgba(88, 188, 255, 0.98) 0%, rgba(0, 122, 255, 0.96) 100%);
  box-shadow: 0 12px 20px rgba(0, 122, 255, 0.22);
}

html[data-theme="glass"] .focus-btn--active,
html[data-theme="glass"] .device-tab--active {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 10px 22px rgba(20, 34, 63, 0.08);
}

html[data-theme="glass"] .device-card {
  overflow: hidden;
}

html[data-theme="glass"] .device-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.34) 0%, rgba(255, 255, 255, 0.08) 55%, rgba(255, 255, 255, 0) 100%);
}

html[data-theme="glass"] .card-settings-btn {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 10px 18px rgba(20, 34, 63, 0.08);
}

html[data-theme="glass"] .bottom-nav {
  left: 14px;
  right: 14px;
  bottom: calc(env(safe-area-inset-bottom) + 12px);
  height: 68px;
  padding-bottom: 0;
  border: 1px solid var(--bottom-nav-border);
  border-radius: 28px;
}

@media (max-width: 639px) {
  html[data-theme="glass"] .main {
    padding-bottom: 118px;
  }
}

html[data-theme="glass"] .device-card--maintenance,
html[data-theme="glass"] .device-card--offline,
html[data-theme="glass"] .device-card--alert,
html[data-theme="glass"] .device-card--ok {
  background-blend-mode: screen;
}

html[data-theme="glass"] .device-card--maintenance .maintenance-text,
html[data-theme="glass"] .signal .label,
html[data-theme="glass"] .signal .value,
html[data-theme="glass"] .chart-meta {
  color: rgba(11, 18, 32, 0.82);
}

@media (min-width: 640px) {
  .bottom-nav {
    display: none;
  }
}

.bottom-nav button {
  flex: 1;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.bottom-nav button.active {
  color: var(--primary);
}

.bottom-nav .material-icons-outlined {
  font-size: 26px;
}

.bottom-nav-label {
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  color: inherit;
}

@media (max-width: 520px) {
  .device-body {
    min-height: 120px;
  }

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

  .dash-item {
    padding: 4px 0;
  }

  .dash-value {
    font-size: 16px;
  }

  .dash-value--state {
    font-size: 11px;
  }

  .dash-label {
    font-size: 11px;
  }
}

@media (max-width: 360px) {
  .device-body {
    min-height: 156px;
  }

  .dash-top {
    gap: 6px;
  }

  .dash-top .material-icons-outlined {
    font-size: 18px;
  }

  .dash-value {
    font-size: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
