:root {
    --brand-primary: #015581;
    --brand-primary-dark: #015581;
    --brand-primary-soft: #e6f3f9;
    --brand-border: #cfe4f7;
    --danger: #e5007f;
    --danger-hover: #c9006e;
    --danger-active: #b80064;
    --danger-soft: #fff0f7;
    --danger-text: #8f004e;
    --danger-border: rgba(229, 0, 127, .3);
    --danger-ring: rgba(229, 0, 127, .14);
    --status-error: var(--danger);
    --dashboard-bg: #f5f7fa;
    --dashboard-dot: rgba(100, 116, 139, .18);
    --dashboard-content-max: 118rem;
    --dashboard-content-gutter: clamp(1rem, 1.55vw, 2rem);
    --dashboard-panel-width: clamp(32rem, 33vw, 46rem);
  }

  /* Dashboard starts directly at the top edge; the normal base-layout padding would create a visible gap above the header. */
  #appShell > main {
    max-width: none !important;
    padding-top: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  #appShell > footer {
    display: none !important;
  }

  html, body {
    background-color: var(--dashboard-bg) !important;
    background-image: radial-gradient(circle, var(--dashboard-dot) 1px, transparent 1px) !important;
    background-size: 18px 18px !important;
  }

  /* Safari renders native selects with a different height and control shape.
     Keep every dashboard select aligned with the other form controls. */
  body select:not([multiple]) {
    min-height: 2.75rem;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='m6 9 6 6 6-6' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-position: right .85rem center;
    background-repeat: no-repeat;
    background-size: 1rem 1rem;
    padding-right: 2.5rem;
  }

  .logs-list {
  display: grid;
  gap: .75rem;
}

/* Energy monitoring */
.energy-page {
  --energy-accent: var(--brand-primary, #015581);
  --energy-accent-soft: var(--brand-primary-soft, #e6f3f9);
  --energy-border: #e2e8f0;
}

.energy-page-head {
  align-items: flex-start;
}

.energy-page-actions,
.energy-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.energy-page-actions {
  align-items: flex-start;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.energy-range-control {
  display: inline-grid;
  grid-template-columns: repeat(3, auto);
  height: 2.35rem;
  box-sizing: border-box;
  gap: .2rem;
  padding: .25rem;
  border: 1px solid var(--energy-border);
  border-radius: .9rem;
  background: #f8fafc;
}

.energy-range-button {
  min-height: 0;
  border: 0;
  border-radius: .68rem;
  background: transparent;
  color: #64748b;
  padding: .3rem .75rem;
  font: inherit;
  font-size: .78rem;
  font-weight: 850;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .16s ease, color .16s ease, box-shadow .16s ease;
}

.energy-range-button:hover {
  color: #0f172a;
  background: #fff;
}

.energy-range-button.is-active,
.energy-range-button[aria-pressed="true"] {
  color: var(--energy-accent);
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .1);
}

.energy-range-button:focus-visible {
  outline: 3px solid rgba(1, 85, 129, .28);
  outline-offset: 1px;
}

.energy-content,
.energy-loading-state {
  display: grid;
  gap: 1rem;
}

.energy-loading-state.energy-state-error {
  min-height: 14rem;
  place-content: center;
  justify-items: center;
  text-align: center;
  color: var(--danger, #e5007f);
}

.energy-loading-spinner {
  width: 1.5rem;
  height: 1.5rem;
  border: 3px solid var(--energy-border);
  border-top-color: var(--energy-accent);
  border-radius: 999px;
  animation: energy-spin .8s linear infinite;
}

.energy-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .8rem;
}

.energy-kpi-card {
  min-width: 0;
  border: 1px solid var(--energy-border);
  border-radius: 1.15rem;
  background: #fff;
  padding: 1rem;
}

.energy-kpi-label {
  color: #64748b;
  font-size: .76rem;
  font-weight: 800;
  line-height: 1.25;
}

.energy-kpi-value {
  margin-top: .45rem;
  color: #0f172a;
  font-size: clamp(1.45rem, 2.5vw, 2rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.025em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.energy-kpi-meta {
  margin-top: .55rem;
  color: #94a3b8;
  font-size: .7rem;
  font-weight: 700;
  line-height: 1.3;
}

.energy-chart-panel,
.energy-devices-panel {
  min-width: 0;
}

.energy-panel-head {
  align-items: flex-start;
  margin-bottom: .85rem;
}

.energy-panel-head .feature-panel-title {
  margin: 0;
}

.energy-chart-legend {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  flex: 0 0 auto;
  color: #64748b;
  font-size: .72rem;
  font-weight: 750;
}

.energy-chart-legend span {
  width: .65rem;
  height: .65rem;
  border-radius: 999px;
  background: var(--energy-accent);
}

.energy-chart {
  position: relative;
  width: calc(100% + 2rem);
  min-height: 18rem;
  margin-inline: -1rem;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.energy-chart svg {
  display: block;
  width: 100%;
  height: 18rem;
  overflow: visible;
}

.energy-chart-grid-line {
  stroke: #e2e8f0;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.energy-chart-area {
  fill: rgba(1, 85, 129, .14);
}

.energy-chart-line {
  fill: none;
  stroke: var(--energy-accent);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.energy-chart-point {
  fill: #fff;
  stroke: var(--energy-accent);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.energy-chart-label {
  fill: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.energy-chart-empty {
  min-height: 18rem;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  color: #64748b;
  font-size: .82rem;
  font-weight: 700;
  text-align: center;
}

.energy-chart-summary {
  margin: .65rem 0 0;
  color: #64748b;
  font-size: .75rem;
  font-weight: 650;
  line-height: 1.4;
}

.energy-devices-list {
  display: grid;
  gap: .5rem;
}

.energy-device-header,
.energy-device-row {
  display: grid;
  grid-template-columns: minmax(11rem, 1.5fr) repeat(4, minmax(5.5rem, .65fr));
  gap: .75rem;
  align-items: center;
}

.energy-device-header {
  padding: 0 .85rem .3rem;
  color: #94a3b8;
  font-size: .68rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .045em;
}

.energy-device-row {
  min-width: 0;
  border: 1px solid var(--energy-border);
  border-radius: .9rem;
  background: #fff;
  padding: .8rem .85rem;
}

.energy-device-main {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-width: 0;
}

.energy-device-icon {
  width: 2.15rem;
  height: 2.15rem;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: .75rem;
  background: var(--energy-accent-soft);
  color: var(--energy-accent);
}

.energy-device-icon svg {
  width: 1.15rem;
  height: 1.15rem;
}

.energy-device-copy {
  min-width: 0;
}

.energy-device-name {
  overflow: hidden;
  color: #0f172a;
  font-size: .84rem;
  font-weight: 850;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.energy-device-meta,
.energy-device-reading-label {
  margin-top: .16rem;
  color: #94a3b8;
  font-size: .68rem;
  font-weight: 700;
}

.energy-device-reading {
  min-width: 0;
  color: #334155;
  font-size: .82rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.energy-device-reading-value {
  overflow-wrap: anywhere;
}

.energy-device-reading-label {
  display: none;
}

.energy-device-status {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: #475569;
  font-size: .72rem;
  font-weight: 800;
}

.energy-status-dot {
  width: .5rem;
  height: .5rem;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 3px #dcfce7;
}

.energy-device-status.is-stale .energy-status-dot {
  background: #f59e0b;
  box-shadow: 0 0 0 3px #fef3c7;
}

.energy-device-status.is-offline .energy-status-dot {
  background: var(--danger, #e5007f);
  box-shadow: 0 0 0 3px var(--danger-ring, rgba(229, 0, 127, .14));
}

.energy-devices-empty {
  border: 1px dashed #cbd5e1;
  border-radius: .9rem;
  background: #f8fafc;
  padding: 1rem;
  color: #64748b;
  font-size: .8rem;
  font-weight: 700;
  text-align: center;
}

.energy-empty-state {
  min-height: 22rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: clamp(1.5rem, 5vw, 3.5rem);
  text-align: left;
}

.energy-empty-icon {
  width: 3.5rem;
  height: 3.5rem;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  background: var(--energy-accent-soft);
  color: var(--energy-accent);
}

.energy-empty-icon svg {
  width: 1.8rem;
  height: 1.8rem;
}

.energy-empty-title {
  margin: 0;
  color: #0f172a;
  font-size: 1.05rem;
  font-weight: 900;
}

.energy-empty-description,
.energy-empty-hint {
  max-width: 40rem;
  margin: .35rem 0 0;
  color: #64748b;
  font-size: .82rem;
  font-weight: 650;
  line-height: 1.5;
}

.energy-empty-hint {
  color: #94a3b8;
  font-size: .74rem;
}

.energy-skeleton-card span,
.energy-skeleton-card strong,
.energy-skeleton-card small,
.energy-skeleton-chart::before {
  display: block;
  border-radius: .45rem;
  background: linear-gradient(90deg, #edf2f7 25%, #f8fafc 45%, #edf2f7 65%);
  background-size: 220% 100%;
  animation: energy-shimmer 1.25s ease-in-out infinite;
}

.energy-skeleton-card span {
  width: 55%;
  height: .65rem;
}

.energy-skeleton-card strong {
  width: 72%;
  height: 1.65rem;
  margin-top: .55rem;
}

.energy-skeleton-card small {
  width: 44%;
  height: .55rem;
  margin-top: .65rem;
}

.energy-skeleton-chart {
  min-height: 20rem;
}

.energy-skeleton-chart::before {
  content: "";
  width: 100%;
  min-height: 17.8rem;
}

@keyframes energy-shimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

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

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

  .energy-device-header {
    display: none;
  }

  .energy-device-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .8rem 1rem;
  }

  .energy-device-main {
    grid-column: 1 / -1;
  }

  .energy-device-reading-label {
    display: block;
  }
}

@media (max-width: 640px) {
  .energy-page-head,
  .energy-page-actions {
    align-items: stretch;
  }

  .energy-page-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .energy-range-control {
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .energy-range-button {
    min-width: 0;
    padding-inline: .4rem;
  }

  .energy-kpi-grid {
    grid-template-columns: 1fr;
  }

  .energy-chart {
    min-height: 14rem;
  }

  .energy-chart svg {
    height: 14rem;
  }

  .energy-empty-state {
    min-height: 18rem;
    flex-direction: column;
    text-align: center;
  }

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

  .energy-device-main {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .energy-skeleton-card span,
  .energy-skeleton-card strong,
  .energy-skeleton-card small,
  .energy-skeleton-chart::before,
  .energy-loading-spinner {
    animation: none;
  }
}

.log-item {
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: #fff;
  padding: .9rem;
}

.log-item-text {
  font-size: .9rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.45;
  word-break: break-word;
}

.log-item-time {
  margin-top: .35rem;
  font-size: .75rem;
  color: #64748b;
}

.log-empty {
  border: 1px dashed #cbd5e1;
  border-radius: 1rem;
  background: #f8fafc;
  padding: 1rem;
  font-size: .85rem;
  color: #64748b;
}

.tank-card-title-row {
  display: flex;
  align-items: flex-start;
  gap: .45rem;
  min-width: 0;
  width: 100%;
}

.tank-card-title-row .card-title {
  flex: 1 1 auto;
  min-width: 0;
  padding-right: .2rem;
}

.tank-hidden-badge {
  flex: 0 0 auto;
  align-self: center;
  padding: .18rem .45rem;
  border-radius: 999px;
  background: #eef2f7;
  color: #64748b;
  font-size: .68rem;
  font-weight: 800;
  line-height: 1;
}

.tank-card-hidden {
  border-style: dashed;
}

.signal-pill {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  border: 0;
  background: transparent;
  color: #94a3b8;
  line-height: 1;
  outline: none;
}

.signal-pill svg {
  width: 1.05rem;
  height: 1.05rem;
  overflow: visible;
}

.signal-pill.tank-card-signal-floating {
  position: absolute;
  right: .85rem;
  bottom: .95rem;
  z-index: 24;
}

.signal-pill.tank-card-signal-floating.hidden {
  display: none;
}

.signal-pill .signal-icon-bar {
  opacity: .24;
  transition: opacity .16s ease, color .16s ease;
}

.signal-pill-strong {
  color: var(--brand-primary, #015581);
}

.signal-pill-ok {
  color: #d97706;
}

.signal-pill-weak {
  color: var(--danger, #e5007f);
}

.signal-pill-unknown {
  color: #94a3b8;
}

.signal-pill-weak .signal-icon-bar-1,
.signal-pill-ok .signal-icon-bar-1,
.signal-pill-ok .signal-icon-bar-2,
.signal-pill-ok .signal-icon-bar-3,
.signal-pill-strong .signal-icon-bar {
  opacity: 1;
}

.signal-pill:hover::after,
.signal-pill:focus-visible::after {
  content: attr(data-signal-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + .45rem);
  z-index: 60;
  transform: translateX(-50%);
  width: max-content;
  max-width: 12rem;
  border-radius: .65rem;
  background: #0f172a;
  color: #fff;
  padding: .38rem .55rem;
  font-size: .72rem;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
  box-shadow: 0 10px 26px rgba(15, 23, 42, .18);
  pointer-events: none;
}

.signal-pill:hover::before,
.signal-pill:focus-visible::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + .18rem);
  z-index: 61;
  transform: translateX(-50%);
  border: .32rem solid transparent;
  border-top-color: #0f172a;
  pointer-events: none;
}

.signal-pill.tank-card-signal-floating:hover::after,
.signal-pill.tank-card-signal-floating:focus-visible::after {
  right: 0;
  left: auto;
  transform: none;
}

.signal-pill.tank-card-signal-floating:hover::before,
.signal-pill.tank-card-signal-floating:focus-visible::before {
  right: .12rem;
  left: auto;
  transform: none;
}

.signal-text-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.signal-modal-section {
  display: grid;
  gap: .75rem;
  margin-bottom: 1rem;
}

.signal-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
}

.signal-card {
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: #fff;
  padding: .9rem;
}

.signal-card-label {
  font-size: .72rem;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.signal-card-value {
  margin-top: .25rem;
  font-size: 1.15rem;
  font-weight: 900;
  color: #0f172a;
}

.signal-card-sub {
  margin-top: .15rem;
  font-size: .76rem;
  color: #64748b;
}

.signal-bar {
  margin-top: .55rem;
  height: .55rem;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.signal-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--brand-primary, #015581);
}

.signal-chart-shell {
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: #fff;
  padding: .9rem;
}

.signal-chart-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .65rem;
  font-size: .8rem;
  font-weight: 900;
  color: #0f172a;
}

.signal-chart-title span:last-child {
  font-size: .72rem;
  font-weight: 700;
  color: #64748b;
}

.signal-chart-svg {
  width: 100%;
  height: 150px;
  display: block;
}

.logs-section-title {
  margin: .25rem 0 .65rem;
  font-size: .8rem;
  font-weight: 900;
  color: #0f172a;
  text-transform: uppercase;
  letter-spacing: .04em;
}

@media (max-width: 640px) {
  .signal-overview {
    grid-template-columns: 1fr;
  }
}
  .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }

  .pill {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .22rem .6rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .02em;
  }

  .dot {
    width: .45rem;
    height: .45rem;
    border-radius: 999px;
    display: inline-block;
  }

  .pill-on { background:#e8fff1; color:#0f6b2f; border:1px solid #b7f0cc; }
  .pill-off { background:#f2f2f2; color:#444; border:1px solid #ddd; }
  .pill-offline { background:var(--danger-soft, #fff0f7); color:var(--danger-text, #8f004e); border:1px solid var(--danger-border, rgba(229, 0, 127, .3)); }
  .pill-unk { background:#fff7e6; color:#7a4b00; border:1px solid #ffe1a3; }
  .pill-info { background:var(--brand-primary-soft, #e6f3f9); color:var(--brand-primary, #015581); border:1px solid #cfe4f7; }

  .text-amber-700 { color: #b45309; }
  .text-danger-text { color: var(--danger-text, #8f004e) !important; }

  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .55rem .8rem;
    border-radius: .9rem;
    font-weight: 700;
    font-size: .85rem;
  }

  .btn-primary { background:var(--brand-primary, #015581); color:#fff; box-shadow:0 1px 2px rgba(0,0,0,.08); }
  .btn-primary:hover { background:var(--brand-primary-dark, #015581); }
  .btn-ghost { background:#fff; border:1px solid #e2e8f0; color:#0f172a; }
  .btn-ghost:hover { background:#f8fafc; }
  .btn-danger { background:var(--danger, #e5007f); border:1px solid var(--danger, #e5007f); color:#fff; box-shadow:0 1px 2px rgba(143, 0, 78, .16); }
  .btn-danger:hover { background:var(--danger-hover, #c9006e); border-color:var(--danger-hover, #c9006e); }
  .btn-danger:active { background:var(--danger-active, #b80064); border-color:var(--danger-active, #b80064); }
  .btn-danger:focus-visible { outline:3px solid var(--danger-border, rgba(229, 0, 127, .3)); outline-offset:2px; }
  .btn-danger:disabled,
  .btn-danger:disabled:hover,
  .btn-danger:disabled:active { background:#f8fafc; border-color:#e2e8f0; color:#94a3b8; box-shadow:none; cursor:not-allowed; }

  .icon { width:1rem; height:1rem; display:inline-block; }

  .check {
    width: 1.1rem;
    height: 1.1rem;
    border-radius: .35rem;
    border: 1px solid #cbd5e1;
    accent-color: var(--brand-primary, #015581);
    flex: 0 0 auto;
  }

  input[type="range"] { width: 100%; }
  .kpi { font-weight: 800; }


.dashboard-topbar {
  position: sticky;
  top: 0;
  z-index: 80;
  width: 100%;
  box-sizing: border-box;
  border-bottom: 1px solid #e2e8f0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(18px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.dashboard-topbar-inner {
  max-width: none;
  margin: 0;
  padding: .85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.dashboard-brand {
  display: flex;
  align-items: center;
  gap: .9rem;
  min-width: 0;
}

.dashboard-brand-logo-wrap {
  display: flex;
  height: 2.7rem;
  align-items: center;
  flex: 0 0 auto;
}

.dashboard-brand-logo {
  height: 2.35rem;
  width: auto;
  object-fit: contain;
}

.dashboard-brand-title {
  font-size: 1.1rem;
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: -.025em;
  color: #0f172a;
}

.dashboard-brand-subtitle {
  margin-top: .15rem;
  font-size: .78rem;
  font-weight: 700;
  color: #64748b;
}

.dashboard-topbar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .6rem;
}

.dashboard-menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: .95rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #0f172a;
  box-shadow: none;
}

.dashboard-menu-toggle svg {
  width: 1.2rem;
  height: 1.2rem;
}

.dashboard-menu-toggle:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.dashboard-live-pill {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  border: 1px solid var(--brand-primary-soft, #e6f3f9);
  border-radius: 999px;
  background: var(--brand-primary-soft, #e6f3f9);
  color: #015581;
  padding: .5rem .75rem;
  font-size: .78rem;
  font-weight: 900;
  white-space: nowrap;
}

.dashboard-live-pill::before {
  content: "";
  width: .48rem;
  height: .48rem;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, .12);
}

.dashboard-demo-banner {
  border-top: 1px solid #fde68a;
  background: #fffbeb;
  color: #92400e;
  font-size: .86rem;
  line-height: 1.45;
}

.dashboard-demo-banner-inner {
  max-width: none;
  margin: 0;
  padding: .65rem 1.25rem;
}

.dashboard-shell {
  --sidebar-expanded-width: 16.5rem;
  --sidebar-collapsed-width: 4.9rem;
  --sidebar-width: var(--sidebar-expanded-width);
  --dashboard-topbar-height: 3.55rem;
  display: block;
  width: 100%;
  min-height: 100vh;
  background-color: var(--dashboard-bg);
  background-image: radial-gradient(circle, var(--dashboard-dot) 1px, transparent 1px);
  background-size: 18px 18px;
}

@media (min-width: 1024px) {
  .dashboard-shell {
    background-attachment: fixed;
  }
}

.dashboard-sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 70;
  width: var(--sidebar-width);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  overflow-x: hidden;
  border-right: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: none;
  transition: width .18s ease;
}

.dashboard-sidebar-inner {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: .9rem;
  padding: 0 .9rem .9rem;
}

.dashboard-sidebar-brand {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: .85rem;
  min-height: var(--dashboard-topbar-height);
  box-sizing: border-box;
  padding: .35rem .2rem;
  border-bottom: 1px solid #eef2f7;
}

.dashboard-sidebar-nav-scroll {
  display: grid;
  flex: 1 1 auto;
  min-height: 0;
  align-content: start;
  grid-auto-rows: max-content;
  gap: .85rem;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding-right: .15rem;
  scrollbar-gutter: stable;
}

.dashboard-sidebar-logo {
  height: 2.65rem;
  width: auto;
  max-width: 9.5rem;
  object-fit: contain;
  flex: 0 0 auto;
}

.dashboard-sidebar-logo-compact {
  display: none;
}

.dashboard-sidebar-title {
  font-size: 1.05rem;
  font-weight: 900;
  color: #0f172a;
  line-height: 1.1;
  letter-spacing: -.02em;
}

.dashboard-sidebar-subtitle {
  margin-top: .2rem;
  font-size: .78rem;
  font-weight: 800;
  color: #64748b;
}

.dashboard-sidebar-section {
  display: grid;
  align-content: start;
  grid-auto-rows: max-content;
  gap: .35rem;
}

.dashboard-sidebar-section-label {
  padding: 0 .55rem .35rem;
  font-size: .78rem;
  font-weight: 900;
  color: #6b7280;
  letter-spacing: .02em;
}

.dashboard-sidebar-section-label-offset {
  padding-top: .1rem;
}

.dashboard-side-link {
  display: flex;
  align-items: center;
  gap: .85rem;
  width: 100%;
  min-height: 3rem;
  border: 0;
  border-radius: .95rem;
  background: transparent;
  color: #3f3f46;
  padding: .65rem .7rem;
  text-align: left;
  text-decoration: none;
  font-size: .98rem;
  font-weight: 800;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}

.dashboard-side-link:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.dashboard-logout-form {
  margin: 0;
  width: 100%;
}

.dashboard-logout-form .dashboard-side-link {
  cursor: pointer;
}

.dashboard-logout-link {
  min-height: 2.6rem;
  color: #64748b;
  font-size: .9rem;
  font-weight: 700;
  padding: .55rem .7rem;
}

.dashboard-logout-link .dashboard-side-icon {
  width: 1.1rem;
  height: 1.1rem;
  opacity: .78;
}

.dashboard-logout-link:hover {
  background: transparent;
  color: #334155;
}

.dashboard-side-link.active {
  background: transparent;
  color: #3f3f46;
}

.dashboard-side-link.active > span,
.dashboard-side-link.active .dashboard-settings-summary-main > span {
  color: var(--brand-primary, #015581);
}

.dashboard-side-link.active .dashboard-side-icon {
  color: var(--brand-primary, #015581);
}

.dashboard-settings-dropdown {
  display: grid;
  align-content: start;
  grid-auto-rows: max-content;
  gap: .35rem;
}

.dashboard-settings-dropdown > summary {
  list-style: none;
  cursor: pointer;
}

.dashboard-settings-dropdown > summary::-webkit-details-marker {
  display: none;
}

.dashboard-settings-summary {
  justify-content: space-between;
}

.dashboard-settings-summary-main {
  display: inline-flex;
  align-items: center;
  gap: .85rem;
  min-width: 0;
}

.dashboard-side-link > span:not(.dashboard-settings-summary-main),
.dashboard-settings-summary-main > span {
  line-height: 1;
  transform: translateY(.04rem);
}

.dashboard-settings-caret {
  width: .95rem;
  height: .95rem;
  flex: 0 0 auto;
  color: #64748b;
  transition: transform .16s ease;
}

.dashboard-settings-dropdown[open] .dashboard-settings-caret {
  transform: rotate(180deg);
}

.dashboard-settings-items {
  display: grid;
  align-content: start;
  grid-auto-rows: max-content;
  gap: .25rem;
  padding-left: .45rem;
}

.dashboard-side-sub-link {
  min-height: 2.65rem;
  padding-left: 1rem;
  font-size: .92rem;
  font-weight: 800;
}

.dashboard-side-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex: 0 0 auto;
}

.dashboard-sidebar-bottom {
  margin-top: auto;
  flex: 0 0 auto;
  display: grid;
  gap: .65rem;
  padding-top: .8rem;
  border-top: 1px solid #eef2f7;
}

.dashboard-sidebar-bottom-row {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.dashboard-sidebar-bottom-row .dashboard-logout-link {
  flex: 1 1 auto;
  min-width: 0;
}

.dashboard-feedback-link {
  min-height: 2.6rem;
  color: #475569;
  font-size: .9rem;
  padding: .55rem .7rem;
  cursor: pointer;
}

.dashboard-feedback-link .dashboard-side-icon {
  width: 1.1rem;
  height: 1.1rem;
}

.dashboard-language-form {
  flex: 0 0 auto;
}

.dashboard-language-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .1rem;
  min-height: 2rem;
}

.dashboard-language-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  height: 1.75rem;
  border: 0;
  border-radius: .55rem;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  font: inherit;
  font-size: .72rem;
  font-weight: 950;
  line-height: 1;
  text-align: center;
}

.dashboard-language-option:hover {
  color: #334155;
  background: #f8fafc;
}

.dashboard-language-option.active {
  color: var(--brand-primary, #015581);
  background: var(--brand-primary-soft, #e6f3f9);
}

.dashboard-language-option:focus-visible {
  outline: 2px solid rgba(1, 85, 129, .35);
  outline-offset: 2px;
}

.dashboard-sidebar-footer {
  padding: .9rem;
  border: 1px solid #e2e8f0;
  border-radius: 1.15rem;
  background: #fff;
}

.dashboard-sidebar-footer-title {
  font-size: .8rem;
  font-weight: 900;
  color: #0f172a;
}

.dashboard-sidebar-footer-text {
  margin-top: .25rem;
  font-size: .75rem;
  line-height: 1.35;
  color: #64748b;
}

.dashboard-sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 65;
  display: none;
  background: rgba(15, 23, 42, .38);
  backdrop-filter: blur(3px);
}

body.dashboard-sidebar-collapsed .dashboard-shell {
  --sidebar-width: var(--sidebar-collapsed-width);
}

body.dashboard-sidebar-collapsed .dashboard-sidebar-inner {
  align-items: center;
  gap: .75rem;
  padding: 0 .5rem .75rem;
}

body.dashboard-sidebar-collapsed .dashboard-sidebar-brand {
  justify-content: center;
  min-height: var(--dashboard-topbar-height);
  padding: .35rem 0;
}

body.dashboard-sidebar-collapsed .dashboard-sidebar-logo {
  max-width: 3.4rem;
  height: 2.15rem;
}

body.dashboard-sidebar-collapsed .dashboard-sidebar-logo-full {
  display: none;
}

body.dashboard-sidebar-collapsed .dashboard-sidebar-logo-compact {
  display: block;
}

body.dashboard-sidebar-collapsed .dashboard-sidebar-section {
  width: 100%;
}

body.dashboard-sidebar-collapsed .dashboard-sidebar-nav-scroll {
  width: 100%;
  gap: .75rem;
  overflow-x: hidden;
  padding-right: 0;
  scrollbar-gutter: auto;
}

body.dashboard-sidebar-collapsed .dashboard-sidebar-section-label,
body.dashboard-sidebar-collapsed .dashboard-side-link span,
body.dashboard-sidebar-collapsed .dashboard-settings-caret,
body.dashboard-sidebar-collapsed .dashboard-sidebar-bottom,
body.dashboard-sidebar-collapsed .dashboard-sidebar-footer {
  display: none;
}

body.dashboard-sidebar-collapsed .dashboard-side-link {
  justify-content: center;
  gap: 0;
  min-height: 3.1rem;
  padding: .7rem;
  border-radius: .9rem;
}

body.dashboard-sidebar-collapsed .dashboard-side-link .dashboard-settings-summary-main {
  display: inline-flex;
}

body.dashboard-sidebar-collapsed .dashboard-settings-items {
  display: none;
}

body.dashboard-sidebar-collapsed .dashboard-side-icon {
  width: 1.35rem;
  height: 1.35rem;
}

.dashboard-page-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: .45rem;
  background: transparent;
  color: #0f172a;
  padding: 0;
}

.dashboard-page-toggle:hover {
  background: #f8fafc;
}

.dashboard-page-toggle svg {
  width: 1.15rem;
  height: 1.15rem;
}

.dashboard-main-content {
  min-width: 0;
  width: calc(100% - var(--sidebar-width));
  max-width: none;
  box-sizing: border-box;
  margin: 0 0 0 var(--sidebar-width);
  padding: calc(var(--dashboard-topbar-height) + clamp(.85rem, 1vw, 1.15rem)) var(--dashboard-content-gutter) clamp(2rem, 2vw, 3rem);
  min-height: 100vh;
  background: transparent;
  transition: margin-left .18s ease, width .18s ease, padding-right .18s ease;
}

.dashboard-page-header,
.dashboard-page-view {
  width: 100%;
  max-width: var(--dashboard-content-max);
  margin-left: 0;
  margin-right: auto;
}

/* Shared Dokploy-style page canvas: the dotted app background remains visible
   around one consistent surface containing page heading, actions and cards. */
.dashboard-page-view {
  box-sizing: border-box;
  min-width: 0;
  border: 1px solid #edf0f3;
  border-radius: 1.4rem;
  background: #fff;
  box-shadow: none;
  padding: clamp(1.15rem, 1.55vw, 1.6rem);
}

.dashboard-page-header {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  z-index: 60;
  width: auto;
  max-width: none;
  height: var(--dashboard-topbar-height);
  margin: 0;
  box-sizing: border-box;
  border-bottom: 1px solid #e2e8f0;
  background: rgba(255, 255, 255, .98);
  backdrop-filter: blur(12px);
  padding: .55rem var(--dashboard-content-gutter);
  transition: left .18s ease, right .18s ease;
}

.dashboard-page-header-inner {
  width: 100%;
  max-width: var(--dashboard-content-max);
  margin-left: 0;
  margin-right: auto;
}

.dashboard-page-view.hidden {
  display: none !important;
}

.mobile-page-stack {
  overflow-x: visible;
}

/* The header/sidebar layout is wider than the dashboard cards.
   Parent overflow must stay visible, otherwise the full-width elements are clipped. */
html, body {
  overflow-x: hidden;
}

.dashboard-kpi-section {
  border: 1px solid #e2e8f0;
  border-radius: 1.25rem;
  background: #fff;
  box-shadow: none;
  overflow: hidden;
}

.dashboard-kpi-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem .75rem;
  border-bottom: 1px solid #f1f5f9;
}

.dashboard-kpi-title {
  font-size: .85rem;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.dashboard-kpi-subtitle {
  font-size: .78rem;
  font-weight: 700;
  color: #64748b;
}

.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  padding: 1rem;
}

#tanks-body {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  justify-content: start;
  align-items: stretch;
}

@media (max-width: 1399px) {
  #tanks-body {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 1023px) {
  #tanks-body {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 639px) {
  #tanks-body {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* Constrain toolbar controls and their dropdowns to the dashboard content at
   every viewport width so they cannot overtake global navigation surfaces. */
.home-prounits-toolbar {
  position: relative;
  z-index: 5;
}

@media (min-width: 1024px) {
  #dashboardHomePage {
    height: calc(100dvh - var(--dashboard-topbar-height) - 1.45rem);
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  #dashboardHomePage .operator-user-banner {
    flex: 0 0 auto;
  }

  .home-prounits-shell {
    flex: 1 1 auto;
    min-height: 0;
    margin-top: 1rem !important;
  }

  .home-prounits-section,
  .home-prounits-panel {
    min-height: 0;
    height: 100%;
  }

  .home-prounits-section,
  .home-prounits-panel,
  .home-prounits-body {
    display: flex;
    flex-direction: column;
  }

  .home-prounits-panel {
    overflow: hidden;
  }

  .home-prounits-head,
  .home-prounits-toolbar {
    flex: 0 0 auto;
  }

  .home-prounits-toolbar {
    background: #fff;
  }

  .home-prounits-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }

  .home-prounits-grid {
    flex: 1 1 auto;
    min-height: 0;
    align-content: start;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 1.35rem .85rem 1.15rem 1.35rem;
    scrollbar-gutter: stable;
  }
}

.dashboard-kpi-card {
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: #fff;
  padding: .9rem;
}

.dashboard-kpi-label {
  font-size: .68rem;
  font-weight: 900;
  color: #64748b;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.dashboard-kpi-value {
  margin-top: .25rem;
  font-size: 1.45rem;
  line-height: 1;
  color: #0f172a;
}

@media (min-width: 768px) {
  .dashboard-kpi-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 1023px) {
  .dashboard-shell {
    --sidebar-width: 0rem;
  }

  .dashboard-sidebar {
    z-index: 90;
    width: min(18rem, calc(100vw - 3rem));
    transform: translateX(-100%);
    box-shadow: none;
    transition: transform .2s ease, box-shadow .2s ease;
  }

  .dashboard-sidebar-inner {
    align-items: stretch;
    gap: 1.35rem;
    padding: 1rem;
  }

  .dashboard-sidebar-brand {
    justify-content: flex-start;
    padding: .45rem .35rem 1rem;
  }

  .dashboard-sidebar-logo {
    max-width: 9.5rem;
    height: 3.1rem;
  }

  .dashboard-sidebar-section {
    width: 100%;
  }

  .dashboard-sidebar-section-label {
    display: block;
  }

  .dashboard-side-link span {
    display: inline;
  }

  .dashboard-sidebar-footer {
    display: block;
  }

  .dashboard-sidebar-bottom {
    display: grid;
  }

  .dashboard-side-link {
    justify-content: flex-start;
    gap: .85rem;
    min-height: 3rem;
    padding: .65rem .7rem;
    border-radius: .95rem;
  }

  .dashboard-side-icon {
    width: 1.25rem;
    height: 1.25rem;
  }

  .dashboard-main-content {
    width: 100%;
    margin-left: 0;
    padding: calc(var(--dashboard-topbar-height) + .85rem) .75rem 1.5rem;
  }

  body.dashboard-sidebar-mobile-open .dashboard-sidebar {
    transform: translateX(0);
    box-shadow: 16px 0 36px rgba(15, 23, 42, 0.16);
  }

  body.dashboard-sidebar-mobile-open .dashboard-sidebar-backdrop {
    display: block;
  }

  body.dashboard-sidebar-collapsed .dashboard-shell {
    --sidebar-width: 0rem;
  }

  body.dashboard-sidebar-collapsed .dashboard-sidebar-inner {
    align-items: stretch;
    gap: 1.35rem;
    padding: 1rem;
  }

  body.dashboard-sidebar-collapsed .dashboard-sidebar-brand {
    justify-content: flex-start;
    padding: .45rem .35rem 1rem;
  }

  body.dashboard-sidebar-collapsed .dashboard-sidebar-logo {
    max-width: 9.5rem;
    height: 3.1rem;
  }

  body.dashboard-sidebar-collapsed .dashboard-sidebar-logo-full {
    display: block;
  }

  body.dashboard-sidebar-collapsed .dashboard-sidebar-logo-compact {
    display: none;
  }

  body.dashboard-sidebar-collapsed .dashboard-sidebar-section {
    width: 100%;
  }

  body.dashboard-sidebar-collapsed .dashboard-sidebar-nav-scroll,
  .dashboard-sidebar-nav-scroll {
    width: 100%;
  }

  body.dashboard-sidebar-collapsed .dashboard-sidebar-section-label {
    display: block;
  }

  body.dashboard-sidebar-collapsed .dashboard-side-link span {
    display: inline;
  }

  body.dashboard-sidebar-collapsed .dashboard-sidebar-footer {
    display: block;
  }

  body.dashboard-sidebar-collapsed .dashboard-sidebar-bottom {
    display: grid;
  }

  body.dashboard-sidebar-collapsed .dashboard-settings-caret {
    display: block;
  }

  body.dashboard-sidebar-collapsed .dashboard-settings-items {
    display: grid;
  }

  body.dashboard-sidebar-collapsed .dashboard-side-link {
    justify-content: flex-start;
    gap: .85rem;
    min-height: 3rem;
    padding: .65rem .7rem;
    border-radius: .95rem;
  }

  body.dashboard-sidebar-collapsed .dashboard-side-icon {
    width: 1.25rem;
    height: 1.25rem;
  }
}

@media (min-width: 1024px) {
  .dashboard-main-content {
    width: calc(100% - var(--sidebar-width));
  }
}

@media (max-width: 1023px) {
  .modal-backdrop {
    width: 100vw;
  }
}

@media (max-width: 640px) {
  .dashboard-main-content {
    padding: calc(var(--dashboard-topbar-height) + .75rem) .75rem 1.5rem;
  }

  .dashboard-page-view {
    border-radius: 1.05rem;
    padding: .9rem;
  }

  .dashboard-kpi-head {
    align-items: flex-start;
    flex-direction: column;
    gap: .25rem;
  }

  .dashboard-kpi-grid {
    display: flex;
    gap: .65rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .dashboard-kpi-card {
    min-width: 7.2rem;
    flex: 0 0 auto;
    scroll-snap-align: start;
  }
}


.dashboard-page-header {
  margin: 0;
}

.dashboard-page-header-inner {
  min-height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: 0;
}

.dashboard-page-title-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-width: 0;
  flex: 1 1 auto;
}

.dashboard-page-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 1.45rem;
  min-width: 0;
  color: #64748b;
  font-size: .86rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
}

.dashboard-page-breadcrumb-root {
  color: #64748b;
}

.dashboard-page-breadcrumb-root,
.dashboard-page-section {
  text-decoration: none;
  cursor: pointer;
}

.dashboard-page-breadcrumb-root:hover,
.dashboard-page-section:hover {
  color: #0f172a;
  text-decoration: underline;
  text-underline-offset: .2rem;
}

.dashboard-page-breadcrumb-root:focus-visible,
.dashboard-page-section:focus-visible {
  border-radius: .25rem;
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.dashboard-page-breadcrumb-root,
.dashboard-page-section,
.dashboard-page-title {
  transform: translateY(.15rem);
}

.dashboard-page-section {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #64748b;
}

.dashboard-page-breadcrumb-separator {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  color: #334155;
}

.dashboard-page-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: .88rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
}

.dashboard-topbar-actions {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .65rem;
}

.dashboard-demo-badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.45rem;
  border: 1px solid #fed7aa;
  border-radius: 999px;
  background: #fff7ed;
  color: #9a3412;
  padding: .18rem .55rem;
  font-size: .68rem;
  font-weight: 950;
  line-height: 1;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.dashboard-help-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #475569;
  font-size: .92rem;
  font-weight: 950;
  line-height: 1;
  box-shadow: none;
  transition: color .16s ease;
}

.dashboard-help-button:hover,
.dashboard-help-button[aria-expanded="true"] {
  background: transparent;
  color: var(--brand-primary, #015581);
  box-shadow: none;
}

.dashboard-help-button:focus-visible {
  outline: 2px solid rgba(1, 85, 129, .35);
  outline-offset: 2px;
}

.dashboard-help-popover {
  position: absolute;
  top: calc(100% + .7rem);
  right: 0;
  z-index: 85;
  width: min(23rem, calc(100vw - 2rem));
  border: 1px solid #dbe5ef;
  border-radius: 1rem;
  background: #fff;
  padding: 1rem;
  box-shadow: 0 24px 55px rgba(15, 23, 42, .18);
}

.dashboard-help-popover.hidden {
  display: none !important;
}

.dashboard-help-popover::before {
  content: "";
  position: absolute;
  top: -.45rem;
  right: .78rem;
  width: .8rem;
  height: .8rem;
  border-left: 1px solid #dbe5ef;
  border-top: 1px solid #dbe5ef;
  background: #fff;
  transform: rotate(45deg);
}

.dashboard-help-popover-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
}

.dashboard-help-eyebrow {
  color: #64748b;
  font-size: .68rem;
  font-weight: 950;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.dashboard-help-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  border: 0;
  border-radius: .6rem;
  background: transparent;
  color: #64748b;
  font-size: 1.35rem;
  line-height: 1;
}

.dashboard-help-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.dashboard-help-title {
  position: relative;
  z-index: 1;
  margin-top: .35rem;
  color: #0f172a;
  font-size: 1.05rem;
  font-weight: 950;
  line-height: 1.2;
}

.dashboard-help-body {
  position: relative;
  z-index: 1;
  margin-top: .45rem;
  color: #475569;
  font-size: .84rem;
  font-weight: 650;
  line-height: 1.45;
}

.dashboard-help-list {
  position: relative;
  z-index: 1;
  display: grid;
  gap: .45rem;
  margin: .75rem 0 0;
  padding: .75rem 0 0;
  border-top: 1px solid #eef2f7;
  list-style: none;
}

.dashboard-help-list:empty {
  display: none;
}

.dashboard-help-list li {
  position: relative;
  padding-left: 1rem;
  color: #334155;
  font-size: .8rem;
  font-weight: 700;
  line-height: 1.35;
}

.dashboard-help-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .45rem;
  width: .38rem;
  height: .38rem;
  border-radius: 999px;
  background: var(--brand-primary, #015581);
}

.operator-command-center,
.operator-user-banner {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
}

.operator-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid #d7e0ea;
  border-radius: 1.25rem;
  background: #fff;
  padding: 1rem;
}

.operator-summary-ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.operator-summary-warn {
  border-color: #fed7aa;
  background: #fff7ed;
}

.operator-summary-error {
  border-color: var(--danger-border, rgba(229, 0, 127, .3));
  background: var(--danger-soft, #fff0f7);
}

.operator-summary-loading {
  background: #f8fafc;
}

.operator-summary-main {
  min-width: 0;
}

.operator-user-banner {
  position: relative;
  min-height: 12rem;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 1.25rem;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .98), rgba(255, 255, 255, .92)),
    radial-gradient(circle at 82% 18%, rgba(1, 85, 129, .08), transparent 24rem);
  padding: clamp(1.1rem, 2vw, 1.65rem);
}

.operator-user-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(148, 163, 184, .08) 1px, transparent 1px), linear-gradient(90deg, rgba(148, 163, 184, .08) 1px, transparent 1px);
  background-size: 1.35rem 1.35rem;
  mask-image: linear-gradient(90deg, transparent, #000 45%, #000);
  pointer-events: none;
}

.operator-user-banner-warn {
  border-color: var(--danger, #e5007f);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .98), rgba(255, 240, 247, .92)),
    radial-gradient(circle at 82% 18%, rgba(229, 0, 127, .10), transparent 24rem);
}

.operator-user-banner-copy,
.operator-user-actions {
  position: relative;
  z-index: 1;
}

.operator-eyebrow {
  color: #64748b;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.operator-summary-title,
.operator-user-title,
.setup-assistant-title,
.zigbee-action-title {
  margin-top: .25rem;
  color: #0f172a;
  font-size: 1.05rem;
  font-weight: 950;
  line-height: 1.2;
}

.operator-user-title {
  font-size: clamp(1.55rem, 2.4vw, 2.35rem);
}

.operator-summary-text,
.operator-user-text,
.operator-action-text,
.setup-step-text,
.zigbee-action-text {
  margin-top: .3rem;
  color: #475569;
  font-size: .84rem;
  font-weight: 650;
  line-height: 1.4;
}

.operator-user-text {
  max-width: 38rem;
  font-size: .92rem;
}

.operator-user-stats {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-top: .9rem;
}

.operator-user-stats span {
  display: inline-flex;
  align-items: baseline;
  gap: .35rem;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .82);
  padding: .42rem .65rem;
  color: #475569;
  font-size: .78rem;
  font-weight: 800;
}

.operator-user-stats strong {
  color: #0f172a;
  font-size: .92rem;
  font-weight: 950;
}

.operator-summary-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #e2e8f0;
  color: #0f172a;
  padding: .45rem .75rem;
  font-size: .76rem;
  font-weight: 950;
  white-space: nowrap;
}

.operator-summary-ok .operator-summary-badge {
  background: #dcfce7;
  color: #166534;
}

.operator-summary-warn .operator-summary-badge {
  background: #ffedd5;
  color: #9a3412;
}

.operator-summary-error .operator-summary-badge {
  background: var(--danger, #e5007f);
  color: #fff;
}

.operator-action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .8rem;
}

.operator-action-card {
  min-width: 0;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: #fff;
  padding: .9rem;
}

.operator-action-card-ok {
  border-color: #bbf7d0;
}

.operator-action-card-warn {
  border-color: #fed7aa;
}

.operator-action-card-error {
  border-color: var(--danger, #e5007f);
}

.operator-action-card-muted {
  background: #f8fafc;
}

.operator-action-title {
  color: #0f172a;
  font-size: .9rem;
  font-weight: 950;
  line-height: 1.2;
}

.operator-action-footer {
  margin-top: .75rem;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.setup-assistant-panel {
  border: 1px solid #e2e8f0;
  border-radius: 1.25rem;
  background: #fff;
  padding: 1rem;
}

.operator-user-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .6rem;
}

.setup-assistant-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.setup-step-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .7rem;
  margin-top: .9rem;
}

.setup-step {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .65rem;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: #f8fafc;
  padding: .75rem;
}

.setup-step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 999px;
  background: #e2e8f0;
  color: #0f172a;
  font-size: .8rem;
  font-weight: 950;
}

.setup-step-title {
  color: #0f172a;
  font-size: .84rem;
  font-weight: 950;
  line-height: 1.2;
}

.setup-step-ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.setup-step-ok .setup-step-index {
  background: #dcfce7;
  color: #166534;
}

.setup-step-warn {
  border-color: #fed7aa;
  background: #fff7ed;
}

.setup-step-warn .setup-step-index {
  background: #ffedd5;
  color: #9a3412;
}

.setup-step-error {
  border-color: var(--danger-border, rgba(229, 0, 127, .3));
  background: var(--danger-soft, #fff0f7);
}

.setup-step-error .setup-step-index {
  background: var(--danger, #e5007f);
  color: #fff;
}

@media (max-width: 420px) {
  .dashboard-page-header {
    margin: 0;
  }

  .dashboard-page-header-inner {
    min-height: 2.75rem;
  }

  .dashboard-help-popover {
    position: fixed;
    top: calc(var(--dashboard-topbar-height, 3.55rem) + .55rem);
    right: .75rem;
    left: .75rem;
    width: auto;
  }

  .dashboard-help-popover::before {
    right: 1.05rem;
  }
}

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

@media (max-width: 760px) {
  .operator-summary,
  .operator-user-banner,
  .setup-assistant-head {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .operator-action-grid,
  .setup-step-list {
    grid-template-columns: 1fr;
  }

  .operator-summary-badge,
  .operator-user-actions {
    align-self: flex-start;
    justify-content: flex-start;
  }

}


.tank-card {
  position: relative;
  overflow: visible;
  border-width: 1px;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
  cursor: pointer;
  height: 100%;
}

.tank-card .card-pad {
  display: flex;
  min-height: 100%;
  flex-direction: column;
}

.tank-card .action-row {
  margin-top: auto;
}

.tank-card-status-on {
  border-color: #015581 !important;
  box-shadow: 0 0 0 1px rgba(1, 85, 129, 0.14), 0 10px 24px rgba(1, 85, 129, 0.14);
}

.tank-card-status-off {
  border-color: #94a3b8 !important;
}

.tank-card-status-offline {
  border-color: var(--status-error, #e5007f) !important;
}

.tank-offline-notice {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  min-height: 2.4rem;
  margin-bottom: 0;
  border-radius: .75rem;
  background: var(--danger-soft, #fff0f7);
  color: var(--danger-text, #8f004e);
  padding: .45rem .6rem;
  font-size: .72rem;
  font-weight: 750;
  line-height: 1.35;
}

.tank-online-controls.hidden {
  display: none;
}

.tank-offline-notice.hidden {
  display: none;
}

.tank-offline-notice svg {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  margin-top: .02rem;
}

.tank-card-checking {
  border-color: #f59e0b !important;
}

.tank-card-status-unk {
  border-color: var(--status-error, #e5007f) !important;
}

  .compact-card {
    border-radius: 1.15rem;
  }

  .compact-card .card-pad {
    padding: .95rem;
  }

  .compact-card .card-title {
    font-size: 1rem;
    line-height: 1.2;
  }

  .compact-card .device-line {
    font-size: .72rem;
  }

  .compact-card .brightness-box {
    margin-top: .8rem;
    padding: .7rem;
    border-radius: .9rem;
  }

  .compact-card .divider-compact {
    margin: .8rem 0;
  }

  .compact-card .action-row .btn {
    padding: .42rem .7rem;
    border-radius: .75rem;
    font-size: .78rem;
  }

.compact-card .action-row {
  padding-right: 1.7rem;
}

.tank-card[data-offline="1"] .action-row {
  padding-right: 0;
}

.tank-card[data-offline="1"] .tank-offline-notice {
  width: 100%;
}

  .action-main-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
  }

  .action-tools {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-left: auto;
  }

  .mini-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: .8rem;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #0f172a;
    box-shadow: none;
    transition: background .15s ease, border-color .15s ease, transform .15s ease;
  }

  .mini-icon-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
  }

  .mini-icon-btn:disabled,
  .mini-icon-btn:disabled:hover {
    border-color: #e2e8f0;
    background: #f8fafc;
    color: #94a3b8;
    opacity: .65;
    cursor: not-allowed;
    transform: none;
  }

  .tank-card[data-offline="1"] .brightness-slider,
  .tank-card[data-offline="1"] .color-picker,
  .tank-card[data-offline="1"] .tank-select {
    cursor: not-allowed;
    opacity: .5;
  }

  .mini-icon-btn.active {
    background: var(--brand-primary-soft, #e6f3f9);
    border-color: #cfe4f7;
    color: var(--brand-primary, #015581);
  }

  .mini-icon-btn svg {
    width: 1rem;
    height: 1rem;
  }

  .tank-control-panel {
    display: none;
    margin-top: .8rem;
    flex: 0 0 100%;
    width: 100%;
  }

  .tank-control-panel.show {
    display: block;
  }

  .action-main-row > .tank-control-panel {
    flex-basis: 100%;
    width: 100%;
  }

  .tank-control-panel input[type="range"] {
    width: 100%;
    display: block;
  }

  .switch-wrap {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
  }

  .switch-label {
    min-width: 2.35rem;
    font-size: .78rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: .02em;
    text-align: left;
  }

  .switch-control {
    position: relative;
    display: inline-flex;
    align-items: center;
  }

  .switch-control input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
  }

  .switch-slider {
    position: relative;
    width: 3.2rem;
    height: 1.9rem;
    border-radius: 999px;
    background: #cbd5e1;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.05);
    transition: background .18s ease;
  }

  .switch-slider::after {
    content: "";
    position: absolute;
    top: .2rem;
    left: .2rem;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
    transition: transform .18s ease;
  }

  .switch-control input:checked + .switch-slider {
    background: var(--brand-primary, #015581);
  }

  .switch-control input:checked + .switch-slider::after {
    transform: translateX(1.3rem);
  }

  .switch-control input:disabled + .switch-slider {
    opacity: .55;
    cursor: not-allowed;
  }

  .tank-card-select-floating {
    position: absolute;
    left: -1rem;
    bottom: -1rem;
    z-index: 25;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
    cursor: pointer;
    opacity: 0;
    transform: translateY(.5rem);
    transition: opacity .18s ease, transform .18s ease, box-shadow .18s ease;
  }

  .tank-card:hover .tank-card-select-floating,
  .tank-card:focus-within .tank-card-select-floating,
  .tank-card.is-selected .tank-card-select-floating {
    opacity: 1;
    transform: translateY(0);
  }

  .tank-card-select-floating:hover {
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.16);
  }

  .tank-card-select-floating .check {
    width: 1.2rem;
    height: 1.2rem;
    margin: 0;
    border-radius: .45rem;
  }

  .status-indicator {
    position: absolute;
    top: -3px;
    right: -3px;
    z-index: 20;
    pointer-events: none;
    line-height: 0;
  }

  .status-dot-top {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    display: block;
  }

  .status-dot-on { background: #015581; }
  .status-dot-off { background: #94a3b8; }
  .status-dot-offline { background: var(--status-error, #e5007f); }
  .status-dot-checking { background: #f59e0b; }
  .status-dot-unk { background: var(--status-error, #e5007f); }

  .tank-menu-wrap {
    position: relative;
    z-index: 40;
  }

  .tank-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    color: #0f172a;
    transition: background .15s ease;
  }

  .tank-menu-btn:hover {
    background: #f1f5f9;
  }

  .tank-menu-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(148,163,184,.25);
  }

  .tank-menu {
    position: absolute;
    top: 2.35rem;
    right: 0;
    min-width: 11rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    box-shadow: 0 10px 30px rgba(15,23,42,.12);
    overflow: hidden;
    display: none;
  }

  .tank-menu.show {
    display: block;
  }

  .tank-menu-item {
    display: flex;
    align-items: center;
    gap: .65rem;
    width: 100%;
    padding: .85rem 1rem;
    font-size: .95rem;
    color: #0f172a;
    background: #fff;
    text-align: left;
    border: 0;
    text-decoration: none;
  }

  .tank-menu-item:hover {
    background: #f8fafc;
  }

  .tank-menu-item-danger {
    color: var(--danger, #e5007f);
  }

  .tank-menu-item-danger:hover {
    background: var(--danger-soft, #fff0f7);
    color: var(--danger-hover, #c9006e);
  }

  .tank-menu-icon {
    width: 1rem;
    height: 1rem;
    flex: 0 0 auto;
  }

  .tank-menu-form {
    margin: 0;
  }

  .helper-card {
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 1.25rem;
    padding: 1rem;
  }

  .collapse-content {
    display: none;
  }

  .collapse-content.show {
    display: block;
  }

.modal-backdrop {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 120;
  width: min(100vw, var(--dashboard-panel-width));
  height: 100vh;
  background: transparent;
  display: block;
  padding: 0;
  pointer-events: none;
  transform: translateX(100%);
  transition: transform .22s ease, box-shadow .22s ease;
}

.modal-backdrop.show {
  pointer-events: auto;
  transform: translateX(0);
}

.modal-card {
  width: 100%;
  height: 100%;
  max-height: none;
  overflow-y: auto;
  border-radius: 0;
  border: 0;
  border-left: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: -12px 0 30px rgba(15, 23, 42, 0.08);
}

.modal-backdrop:not(.show) .modal-card {
  box-shadow: none;
}

.modal-card-lg {
  width: 100%;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.modal-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9999px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #0f172a;
  font-size: 1.25rem;
  line-height: 1;
}

.modal-close-btn:hover {
  background: #f8fafc;
}

.modal-body {
  padding: 1.25rem;
}

.feedback-form,
.feedback-field {
  display: grid;
  gap: .5rem;
}

.feedback-form {
  gap: 1rem;
}

.feedback-label {
  color: #334155;
  font-size: .84rem;
  font-weight: 850;
}

textarea.feature-form-control.feedback-description {
  height: auto;
  min-height: 10rem;
  resize: vertical;
  line-height: 1.5;
  font-weight: 650;
}

.feedback-privacy-note {
  margin: 0;
  color: #64748b;
  font-size: .75rem;
  font-weight: 650;
  line-height: 1.45;
}

.feedback-result {
  display: grid;
  gap: .45rem;
  border: 1px solid #dbe2ea;
  border-radius: .9rem;
  padding: .75rem .85rem;
  color: #334155;
  background: #f8fafc;
  font-size: .8rem;
  font-weight: 750;
  line-height: 1.45;
}

.feedback-result-success {
  border-color: #a7f3d0;
  background: #ecfdf5;
  color: #065f46;
}

.feedback-result-error {
  border-color: var(--danger-border, #f9a8d4);
  background: var(--danger-soft, #fff0f7);
  color: var(--danger-text, #9d0057);
}

.feedback-result-info {
  border-color: #bae6fd;
  background: #f0f9ff;
  color: #075985;
}

.feedback-result a {
  width: max-content;
  color: inherit;
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: .16rem;
}

.feedback-actions {
  display: flex;
  justify-content: flex-end;
  gap: .6rem;
  padding-top: .25rem;
}

.feedback-actions .btn:disabled {
  cursor: not-allowed;
  opacity: .5;
}

.feedback-duplicate-section {
  display: grid;
  gap: .45rem;
  margin-top: .25rem;
  border: 1px solid #f9a8d4;
  border-radius: .9rem;
  background: #fff7fb;
  padding: .75rem;
}

.feedback-duplicate-title {
  color: #9d0057;
  font-size: .8rem;
  font-weight: 900;
}

.feedback-duplicate-hint {
  margin: 0;
  color: #6b294e;
  font-size: .74rem;
  font-weight: 650;
  line-height: 1.4;
}

.feedback-existing {
  display: grid;
  gap: .8rem;
  margin-top: 1.4rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e2e8f0;
}

.feedback-existing-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(8rem, 10rem);
  align-items: end;
  gap: .75rem;
}

.feedback-existing-title {
  margin: 0;
  color: #0f172a;
  font-size: .95rem;
  font-weight: 900;
}

.feedback-existing-subtitle {
  margin: .2rem 0 0;
  color: #64748b;
  font-size: .74rem;
  font-weight: 650;
  line-height: 1.4;
}

.feedback-issue-filter {
  min-width: 0;
}

.feedback-issue-list {
  display: grid;
  gap: .55rem;
}

.feedback-issue-list-compact {
  gap: .4rem;
}

.feedback-issue-item {
  display: grid;
  gap: .35rem;
  min-width: 0;
  border: 1px solid #e2e8f0;
  border-radius: .85rem;
  background: #fff;
  padding: .7rem .75rem;
  color: #0f172a;
  text-decoration: none;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}

.feedback-issue-item:hover {
  border-color: #94a3b8;
  background: #f8fafc;
  transform: translateY(-1px);
}

.feedback-issue-item-compact {
  padding: .6rem .65rem;
}

.feedback-issue-head {
  display: flex;
  align-items: center;
  gap: .45rem;
  min-width: 0;
}

.feedback-issue-badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.35rem;
  border-radius: 999px;
  padding: .15rem .45rem;
  font-size: .66rem;
  font-weight: 900;
  line-height: 1;
}

.feedback-issue-badge-bug {
  background: var(--danger-soft, #fff0f7);
  color: var(--danger-text, #9d0057);
}

.feedback-issue-badge-feature {
  background: #e0f2fe;
  color: #075985;
}

.feedback-issue-key {
  color: #64748b;
  font-size: .7rem;
  font-weight: 850;
}

.feedback-issue-summary {
  min-width: 0;
  color: #0f172a;
  font-size: .8rem;
  font-weight: 850;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.feedback-issue-meta {
  color: #64748b;
  font-size: .7rem;
  font-weight: 650;
  line-height: 1.35;
}

.feedback-issues-state {
  border: 1px dashed #cbd5e1;
  border-radius: .85rem;
  padding: .85rem;
  color: #64748b;
  background: #f8fafc;
  font-size: .78rem;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
}

.feedback-load-more {
  width: 100%;
}

@media (max-width: 480px) {
  .feedback-existing-header {
    grid-template-columns: 1fr;
  }
}

.toolbar-shell {
  display: grid;
  grid-template-columns: auto minmax(14rem, 20rem) minmax(11rem, 16rem) minmax(12rem, max-content);
  gap: .7rem;
  align-items: center;
  justify-content: start;
  padding: .35rem 0 .65rem;
}

.toolbar-select-all {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  min-width: 0;
  font-weight: 700;
  font-size: .95rem;
  color: #0f172a;
  line-height: 1.1;
  white-space: nowrap;
  padding: 0 .1rem;
}

.check {
  width: 1.05rem;
  height: 1.05rem;
  border-radius: .3rem;
  border: 1px solid #cbd5e1;
  accent-color: var(--brand-primary, #015581);
  flex: 0 0 auto;
}

.toolbar-control {
  height: 2.75rem;
  border-radius: .9rem;
  border: 1px solid #dbe2ea;
  background: #ffffff;
  color: #0f172a;
  font-size: .96rem;
  font-weight: 700;
  padding: 0 .9rem;
  width: 100%;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.toolbar-control-white {
  background: #fff;
  border-color: #d1d5db;
}

.toolbar-control::placeholder {
  color: #94a3b8;
  font-weight: 600;
}

.toolbar-control:focus {
  outline: none;
  border-color: #94a3b8;
  box-shadow: 0 0 0 4px rgba(148,163,184,.15);
}

.toolbar-control:disabled {
  opacity: .55;
  cursor: not-allowed;
  background: #f8fafc;
}

.toolbar-bulk-wrap {
  position: relative;
  display: none;
  grid-column: 4;
  order: 4;
  z-index: 110;
}

.toolbar-bulk-wrap.has-selection {
  display: flex;
  animation: toolbarActionSlideIn .18s ease-out both;
}

.toolbar-select-all {
  order: 1;
}

.toolbar-search-wrap {
  order: 2;
  width: min(100%, 20rem);
}

.toolbar-state-wrap {
  position: relative;
  order: 3;
  width: min(100%, 16rem);
  z-index: 110;
}

.toolbar-bulk-wrap .toolbar-bulk-btn {
  width: auto;
  min-width: 12rem;
}

@keyframes toolbarActionSlideIn {
  from {
    opacity: 0;
    transform: translateX(-.45rem) scale(.98);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

.toolbar-bulk-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
}

.toolbar-search-wrap {
  position: relative;
}

.toolbar-search-input {
  padding-right: 3rem;
}

.toolbar-search-icon {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.15rem;
  height: 1.15rem;
  color: #64748b;
  pointer-events: none;
}

.toolbar-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='m6 9 6 6 6-6' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: right 1rem center;
  background-size: 1rem 1rem;
  background-repeat: no-repeat;
  padding-right: 2.6rem;
}

.toolbar-select-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  text-align: left;
}

.toolbar-select-chevron {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  color: #64748b;
}

.toolbar-dropdown {
  position: absolute;
  top: calc(100% + .45rem);
  left: 0;
  min-width: 17rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: .9rem;
  box-shadow: 0 16px 28px rgba(15,23,42,.12);
  padding: .5rem;
  z-index: 160;
  display: none;
}

.toolbar-dropdown.show {
  display: block;
}

.toolbar-dropdown-item {
  width: 100%;
  border: 0;
  background: #fff;
  text-align: left;
  padding: .7rem .8rem;
  border-radius: .7rem;
  font-size: .84rem;
  font-weight: 600;
  color: #0f172a;
}

.toolbar-dropdown-item:hover {
  background: #f8fafc;
}

.toolbar-dropdown-item.active {
  background: var(--brand-primary-soft, #e6f3f9);
  color: var(--brand-primary, #015581);
}

.toolbar-state-menu {
  min-width: 16rem;
}

.toolbar-dropdown-divider {
  height: 1px;
  background: #e5e7eb;
  margin: .45rem 0;
}

.toolbar-dropdown-section {
  padding: .3rem .25rem .15rem;
}

.toolbar-dropdown-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .72rem;
  font-weight: 700;
  color: #475569;
  margin-bottom: .35rem;
}

.toolbar-apply-btn {
  width: 100%;
  margin-top: .55rem;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: .7rem;
  padding: .55rem .75rem;
  font-weight: 700;
  font-size: .8rem;
  color: #0f172a;
}

  .toolbar-apply-btn:hover {
    background: #f1f5f9;
  }

.schedule-grid {
  display: grid;
  gap: .75rem;
  grid-template-columns: 1fr;
}

.schedule-page-content {
  display: grid;
  gap: 1rem;
}

.schedule-page-layout {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(20rem, 1.05fr);
  gap: 1rem;
  align-items: start;
}

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

.schedule-page-main,
.schedule-page-side {
  display: grid;
  gap: 1rem;
}

.schedule-form-shell {
  border: 1px solid #e2e8f0;
  border-radius: 1.5rem;
  background: #fff;
  padding: 1.15rem;
  display: grid;
  gap: 1rem;
}

.schedule-form-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.schedule-section {
  border: 1px solid #e2e8f0;
  border-radius: 1.25rem;
  background: #fff;
  padding: 1rem;
}

.schedule-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .85rem;
}

.schedule-section-title {
  font-size: .95rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

.schedule-section-text {
  margin-top: .2rem;
  font-size: .78rem;
  color: #64748b;
}

.schedule-action-card {
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: #f8fafc;
  padding: .9rem;
  display: grid;
  gap: .75rem;
}

.schedule-check-row {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-size: .86rem;
  font-weight: 800;
  color: #334155;
}

.schedule-brightness-control {
  display: grid;
  gap: .45rem;
}

.schedule-brightness-value {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  color: #64748b;
  font-size: .78rem;
  font-weight: 700;
}

.schedule-brightness-value output {
  color: var(--brand-primary, #015581);
  font-size: .88rem;
  font-weight: 800;
}

.schedule-brightness-range {
  width: 100%;
  accent-color: var(--brand-primary, #015581);
  cursor: pointer;
}

.schedule-brightness-range:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.schedule-segment {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
  gap: .6rem;
}

.schedule-segment-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #dbe2ea;
  background: #fff;
  color: var(--brand-primary, #015581);
  border-radius: 1rem;
  min-height: 3rem;
  font-size: .9rem;
  font-weight: 800;
  transition: border-color .15s ease, background .15s ease, color .15s ease, box-shadow .15s ease;
}

.schedule-segment-btn:hover {
  background: #f8fafc;
}

.schedule-segment-btn.active {
  background: var(--brand-primary, #015581);
  border-color: var(--brand-primary, #015581);
  color: #fff;
  box-shadow: 0 10px 22px rgba(1, 85, 129, .16);
}

.schedule-segment-btn.active:hover {
  background: var(--brand-primary-dark, #015581);
  color: #fff;
}

.schedule-trigger-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
}

.schedule-trigger-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .15rem;
  min-height: 5rem;
  border-radius: 1rem;
  border: 1px solid #dbe2ea;
  background: #fff;
  padding: .9rem;
  text-align: left;
  font-size: .9rem;
  font-weight: 800;
  color: #0f172a;
  transition: border-color .15s ease, background .15s ease, transform .15s ease, box-shadow .15s ease;
}

.schedule-trigger-card small {
  font-size: .72rem;
  font-weight: 600;
  color: #64748b;
}

.schedule-trigger-card:hover {
  background: #f8fafc;
  transform: translateY(-1px);
}

.schedule-trigger-card.active {
  background: var(--brand-primary, #015581);
  border-color: var(--brand-primary, #015581);
  color: #fff;
  box-shadow: 0 10px 22px rgba(1, 85, 129, .16);
}

.schedule-trigger-card.active small {
  color: rgba(255, 255, 255, .8);
}

.schedule-trigger-card.active:hover {
  background: var(--brand-primary-dark, #015581);
  color: #fff;
}

.schedule-extra-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  margin-top: .95rem;
}

.schedule-weekday-presets {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: .8rem;
}

.schedule-weekday-preset {
  border: 1px solid #dbe2ea;
  background: #fff;
  color: #334155;
  border-radius: 999px;
  padding: .4rem .7rem;
  font-size: .76rem;
  font-weight: 700;
  transition: background .15s ease, border-color .15s ease;
}

.schedule-weekday-preset:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.schedule-weekday-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: .55rem;
}

.schedule-weekday-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  border-radius: .95rem;
  border: 1px solid #dbe2ea;
  background: #fff;
  color: #334155;
  font-size: .85rem;
  font-weight: 800;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}

.schedule-weekday-btn:hover {
  background: #f8fafc;
}

.schedule-weekday-btn.active {
  background: var(--brand-primary, #015581);
  border-color: var(--brand-primary, #015581);
  color: #fff;
}

.schedule-actions-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, .9fr);
  gap: 1rem;
}

.schedule-summary {
  border: 1px solid var(--brand-border, #cfe4f7);
  border-radius: 1rem;
  background: var(--brand-primary-soft, #e6f3f9);
  padding: .95rem;
}

.schedule-summary-title {
  font-size: .78rem;
  font-weight: 800;
  color: var(--brand-primary, #015581);
  letter-spacing: .02em;
  text-transform: uppercase;
}

.schedule-summary-text {
  margin-top: .45rem;
  font-size: .92rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.45;
}

.schedule-dry-run-details {
  margin-top: .75rem;
  display: grid;
  gap: .35rem;
  color: #334155;
  font-size: .82rem;
  font-weight: 650;
  line-height: 1.4;
}

.schedule-dry-run-warnings {
  margin-top: .35rem;
  border: 1px solid #fed7aa;
  border-radius: .85rem;
  background: #fff7ed;
  color: #9a3412;
  padding: .55rem .65rem;
  font-size: .78rem;
  font-weight: 750;
}

.schedule-detail-error {
  border-color: var(--danger-border, rgba(229, 0, 127, .3));
  background: var(--danger-soft, #fff0f7);
  color: var(--danger-text, #8f004e);
}

@media (max-width: 900px) {
  .schedule-page-layout,
  .schedule-trigger-grid,
  .schedule-actions-grid,
  .schedule-extra-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .schedule-weekday-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .schedule-segment,
  .schedule-weekday-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .schedule-trigger-grid {
    grid-template-columns: 1fr;
  }
}
@media (min-width: 640px) {
  .schedule-grid.sm\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.schedule-list {
  display: grid;
  gap: .75rem;
}

.schedule-automation-panel {
  min-width: 0;
}

.schedule-drawer {
  --dashboard-panel-width: clamp(34rem, 38vw, 46rem);
}

.schedule-drawer .modal-body {
  padding-bottom: 2rem;
}

.schedule-drawer .schedule-form-header {
  display: none;
}

.schedule-item {
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: #fff;
  padding: .9rem;
}

.schedule-rule {
  display: grid;
  gap: .7rem;
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.schedule-rule:hover {
  border-color: var(--brand-primary, #015581);
  box-shadow: 0 .5rem 1.4rem rgba(15, 23, 42, .07);
  transform: translateY(-1px);
}

.schedule-rule-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
}

.schedule-rule-status {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: .5rem;
}

.schedule-rule-title {
  font-size: .98rem;
  font-weight: 900;
  color: #0f172a;
  line-height: 1.2;
}

.schedule-rule-line {
  margin-top: .25rem;
  font-size: .86rem;
  font-weight: 750;
  color: #334155;
  line-height: 1.35;
}

.schedule-rule-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}

.schedule-rule-chip {
  display: inline-flex;
  align-items: center;
  min-height: 1.75rem;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  padding: .25rem .6rem;
  font-size: .74rem;
  font-weight: 800;
}

.schedule-rule-error {
  border-color: var(--danger-border, rgba(229, 0, 127, .3));
  background: var(--danger-soft, #fff0f7);
  color: var(--danger-text, #8f004e);
}

.schedule-detail-value {
  margin-top: .85rem;
  color: #0f172a;
  font-size: 1rem;
  font-weight: 850;
  line-height: 1.45;
}

.schedule-detail-meta {
  margin-top: .45rem;
  color: #64748b;
  font-size: .82rem;
  font-weight: 700;
  line-height: 1.45;
}

.schedule-overview-grid {
  display: grid;
  grid-template-columns: minmax(20rem, 1fr) minmax(23rem, 1.15fr);
  gap: 1rem;
  align-items: start;
}

.schedule-calendar-panel,
.schedule-timeline-panel {
  min-width: 0;
}

.schedule-calendar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
}

.schedule-calendar-nav {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  flex: 0 0 auto;
}

.schedule-calendar-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  border: 1px solid #e2e8f0;
  border-radius: .65rem;
  background: #fff;
  color: #475569;
}

.schedule-calendar-nav-btn:hover {
  border-color: var(--brand-border, #cfe4f7);
  color: var(--brand-primary, #015581);
  background: #f8fafc;
}

.schedule-calendar-nav-btn svg {
  width: 1rem;
  height: 1rem;
}

.schedule-calendar-today-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 1.85rem;
  border: 1px solid #e2e8f0;
  border-radius: .65rem;
  background: #fff;
  color: #475569;
  padding: 0 .65rem;
  font-size: .72rem;
  font-weight: 900;
  line-height: 1;
}

.schedule-calendar-today-btn:hover {
  border-color: var(--brand-border, #cfe4f7);
  color: var(--brand-primary, #015581);
  background: #f8fafc;
}

.schedule-calendar {
  display: grid;
  gap: .62rem;
  margin-top: .82rem;
}

.schedule-calendar-weekdays,
.schedule-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.schedule-calendar-weekdays {
  gap: .28rem;
}

.schedule-calendar-weekday {
  color: #94a3b8;
  font-size: .6rem;
  font-weight: 950;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
}

.schedule-calendar-grid {
  gap: .28rem;
}

.schedule-calendar-day {
  position: relative;
  display: grid;
  align-content: start;
  gap: .2rem;
  aspect-ratio: 1 / 1;
  min-width: 0;
  border: 1px solid #e2e8f0;
  border-radius: .64rem;
  background: #fff;
  padding: .3rem;
  color: #0f172a;
  overflow: hidden;
}

.schedule-calendar-day-muted {
  border-color: #edf2f7;
  background: #f8fafc;
  color: #cbd5e1;
}

.schedule-calendar-day-today {
  border-color: var(--brand-primary, #015581);
  box-shadow: inset 0 0 0 1px var(--brand-primary, #015581);
}

.schedule-calendar-day-tomorrow {
  border-color: #f59e0b;
  background: #fffbeb;
}

.schedule-calendar-day-has-items {
  background: #f8fbfd;
}

.schedule-calendar-day-has-error {
  border-color: var(--danger, #e5007f);
  background: var(--danger-soft, #fff0f7);
}

.schedule-calendar-day-number {
  font-size: .72rem;
  font-weight: 950;
  line-height: 1;
}

.schedule-calendar-bars {
  display: grid;
  gap: .13rem;
  min-width: 0;
}

.schedule-calendar-bar {
  display: block;
  min-width: 0;
  overflow: hidden;
  border-radius: .35rem;
  padding: .1rem .22rem;
  color: #0f172a;
  font-size: .52rem;
  font-weight: 900;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-calendar-bar-active {
  background: #e6f3f9;
  color: var(--brand-primary, #015581);
}

.schedule-calendar-bar-error {
  background: var(--danger, #e5007f);
  color: #fff;
}

.schedule-calendar-bar-muted {
  background: #f1f5f9;
  color: #64748b;
}

.schedule-calendar-more {
  color: #64748b;
  font-size: .5rem;
  font-weight: 950;
  line-height: 1;
}

.schedule-timeline {
  display: grid;
  gap: .7rem;
}

.schedule-timeline-item {
  display: grid;
  grid-template-columns: minmax(9rem, .35fr) 1fr;
  gap: .85rem;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: #fff;
  padding: .85rem;
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.schedule-timeline-item:hover {
  border-color: var(--brand-primary, #015581);
  box-shadow: 0 .5rem 1.4rem rgba(15, 23, 42, .07);
  transform: translateY(-1px);
}

.schedule-timeline-item:focus-visible {
  outline: 2px solid var(--brand-primary, #015581);
  outline-offset: 2px;
}

.schedule-timeline-time {
  display: grid;
  align-content: start;
  gap: .2rem;
  min-width: 0;
}

.schedule-timeline-time strong {
  color: #0f172a;
  font-size: .88rem;
  font-weight: 900;
}

.schedule-timeline-time span {
  color: #64748b;
  font-size: .76rem;
  font-weight: 800;
  line-height: 1.25;
}

.schedule-timeline-main {
  min-width: 0;
}

.schedule-timeline-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  color: #0f172a;
  font-size: .95rem;
  font-weight: 900;
  line-height: 1.2;
}

.schedule-timeline-title span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.schedule-timeline-title small {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  padding: .2rem .5rem;
  font-size: .68rem;
  font-weight: 900;
}

.schedule-timeline-line {
  margin-top: .3rem;
  color: #334155;
  font-size: .82rem;
  font-weight: 750;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.schedule-timeline-target {
  color: var(--brand-primary, #015581);
  font-weight: 900;
  text-decoration: underline;
  text-decoration-color: rgba(1, 85, 129, .32);
  text-decoration-thickness: .08em;
  text-underline-offset: .16em;
}

.schedule-timeline-target:hover {
  color: var(--brand-primary-dark, #014366);
  text-decoration-color: currentColor;
}

.schedule-timeline-target:focus-visible {
  border-radius: .2rem;
  outline: 2px solid var(--brand-primary, #015581);
  outline-offset: 2px;
}

.schedule-timeline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .55rem;
}

.schedule-timeline-meta span {
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #64748b;
  padding: .2rem .5rem;
  font-size: .72rem;
  font-weight: 800;
}

.schedule-timeline-error-text {
  margin-top: .55rem;
  color: var(--danger-text, #8f004e);
  font-size: .78rem;
  font-weight: 850;
  line-height: 1.35;
}

.schedule-timeline-actions {
  margin-top: .65rem;
  display: flex;
  justify-content: flex-end;
}

.schedule-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
}

.schedule-item-title {
  font-size: .95rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

.schedule-item-sub {
  margin-top: .2rem;
  font-size: .75rem;
  color: #64748b;
}

.schedule-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .25rem .55rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 800;
  white-space: nowrap;
}

.schedule-badge-on {
  background: #e8fff1;
  color: #0f6b2f;
  border: 1px solid #b7f0cc;
}

.schedule-badge-off {
  background: #f8fafc;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.schedule-enable-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: 2.1rem;
  border: 1px solid #dbe4ee;
  border-radius: 999px;
  background: #fff;
  color: #0f172a;
  padding: .25rem .65rem .25rem .3rem;
  font: inherit;
  font-size: .76rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.schedule-enable-toggle:hover {
  border-color: var(--brand-border, #cfe4f7);
  background: #f8fafc;
}

.schedule-enable-toggle:focus-visible {
  outline: 2px solid rgba(1, 85, 129, .35);
  outline-offset: 2px;
}

.schedule-enable-toggle-track {
  position: relative;
  width: 2.15rem;
  height: 1.2rem;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background .16s ease;
}

.schedule-enable-toggle-thumb {
  position: absolute;
  top: .16rem;
  left: .16rem;
  width: .88rem;
  height: .88rem;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .22);
  transition: transform .16s ease;
}

.schedule-enable-toggle.is-on {
  border-color: #b7f0cc;
  color: #0f6b2f;
}

.schedule-enable-toggle.is-on .schedule-enable-toggle-track {
  background: #16a34a;
}

.schedule-enable-toggle.is-on .schedule-enable-toggle-thumb {
  transform: translateX(.95rem);
}

.schedule-enable-toggle-compact {
  min-height: 1.9rem;
  padding-right: .55rem;
  font-size: .72rem;
}

.schedule-meta {
  margin-top: .7rem;
  display: grid;
  gap: .35rem;
  font-size: .8rem;
  color: #334155;
}

.schedule-meta-row {
  display: flex;
  gap: .45rem;
  flex-wrap: wrap;
}

.schedule-meta-label {
  font-weight: 700;
  color: #64748b;
}

.schedule-actions {
  margin-top: .8rem;
  display: flex;
  gap: .55rem;
  flex-wrap: wrap;
}

.schedule-empty {
  border: 1px dashed #cbd5e1;
  border-radius: 1rem;
  background: #f8fafc;
  padding: 1rem;
  font-size: .85rem;
  color: #64748b;
}

.device-health-layout {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
}

.device-control-panel {
  grid-column: 1 / -1;
}

.device-control-head,
.device-control-surface {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.device-control-surface {
  min-width: min(100%, 22rem);
  border: 1px solid #dbe2ea;
  border-radius: 1rem;
  background: #f8fafc;
  padding: .8rem 1rem;
  transition: border-color .16s ease, background .16s ease;
}

.device-control-copy {
  display: grid;
  gap: .15rem;
  min-width: 0;
}

.device-control-copy strong {
  color: #0f172a;
  font-size: .92rem;
  font-weight: 900;
}

.device-control-copy span {
  color: #64748b;
  font-size: .74rem;
  font-weight: 750;
  line-height: 1.35;
}

.device-control-switch {
  flex: 0 0 auto;
  cursor: pointer;
}

.device-control-switch.is-disabled {
  cursor: not-allowed;
}

.device-control-surface.is-offline {
  border-color: var(--danger-border, rgba(229, 0, 127, .3));
  background: var(--danger-soft, #fff0f7);
}

.device-control-surface.is-offline .device-control-copy strong,
.device-control-surface.is-offline .device-control-copy span {
  color: var(--danger-text, #8f004e);
}

.device-control-surface.is-busy {
  border-color: rgba(1, 85, 129, .3);
  background: var(--brand-primary-soft, #e6f3f9);
}

.device-health-log-panel {
  grid-column: 1 / -1;
}

.device-health-log-panel .log-list {
  display: grid;
  gap: 0;
}

.device-health-log-panel .log-item {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: .8rem 0;
}

.device-health-log-panel .log-item:first-child {
  padding-top: 0;
}

.device-health-log-panel .log-item + .log-item {
  border-top: 1px solid #e2e8f0;
}

.device-health-log-panel .log-item:last-child {
  padding-bottom: 0;
}

.device-log-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .75rem;
  margin-top: .9rem;
  color: #475569;
  font-size: .85rem;
}

.device-log-pager.hidden {
  display: none;
}

.device-log-page-label {
  min-width: 7rem;
  text-align: center;
}

.device-health-grid {
  display: grid;
  gap: .75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.device-health-metric {
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: #fff;
  padding: .85rem;
}

.device-health-label {
  font-size: .72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
  color: #64748b;
}

.device-health-value {
  margin-top: .35rem;
  font-size: .98rem;
  font-weight: 900;
  color: #0f172a;
  overflow-wrap: anywhere;
}

.device-health-sub {
  margin-top: .25rem;
  font-size: .76rem;
  color: #64748b;
  line-height: 1.35;
}

.device-relations-list {
  display: grid;
  gap: 1rem;
}

.device-relation-section {
  display: grid;
  gap: .55rem;
}

.device-relation-title {
  font-size: .76rem;
  font-weight: 900;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0;
}

.device-relation-pills {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
}

.device-relation-pill {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 2.35rem;
  border: 1px solid #cbd5e1;
  border-radius: .8rem;
  background: #fff;
  color: #0f172a;
  padding: .45rem .7rem;
  font-size: .82rem;
  font-weight: 900;
  text-decoration: none;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.device-relation-pill:hover {
  border-color: #015581;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
  transform: translateY(-1px);
}

.device-relation-pill small {
  color: #64748b;
  font-size: .7rem;
  font-weight: 800;
}

.device-relation-empty {
  border: 1px dashed #cbd5e1;
  border-radius: .8rem;
  background: #f8fafc;
  color: #64748b;
  padding: .65rem .75rem;
  font-size: .78rem;
  font-weight: 800;
}

.device-schedules-list {
  display: grid;
  gap: .65rem;
}

.device-schedule-item {
  display: grid;
  gap: .4rem;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: #fff;
  color: #0f172a;
  padding: .8rem;
  text-decoration: none;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.device-schedule-item:hover {
  border-color: var(--brand-primary, #015581);
  box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
  transform: translateY(-1px);
}

.device-schedule-item:focus-visible {
  outline: 2px solid var(--brand-primary, #015581);
  outline-offset: 2px;
}

.device-schedule-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
}

.device-schedule-head strong {
  min-width: 0;
  font-size: .88rem;
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.device-schedule-line {
  color: #334155;
  font-size: .78rem;
  font-weight: 750;
  line-height: 1.35;
}

.device-schedule-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}

.device-schedule-meta > span {
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #64748b;
  padding: .2rem .5rem;
  font-size: .68rem;
  font-weight: 800;
}

.device-schedules-empty {
  border: 1px dashed #cbd5e1;
  border-radius: .8rem;
  background: #f8fafc;
  color: #64748b;
  padding: .75rem;
  font-size: .78rem;
  font-weight: 800;
}

@media (max-width: 900px) {
  .device-health-layout,
  .device-health-grid {
    grid-template-columns: 1fr;
  }

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

  .device-control-surface {
    min-width: 0;
    width: 100%;
  }
}


.group-form-shell {
  border: 1px solid #e2e8f0;
  border-radius: 1.5rem;
  background: #fff;
  padding: 1rem;
  display: grid;
  gap: 1rem;
}

.group-grid {
  display: grid;
  gap: .75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.group-member-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem;
  max-height: 18rem;
  overflow-y: auto;
  padding-right: .25rem;
}

.group-member-option {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: #fff;
  padding: .75rem;
  cursor: pointer;
}

.group-member-option:hover {
  background: #f8fafc;
}

.group-member-name {
  font-size: .85rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

.group-member-device {
  margin-top: .15rem;
  font-size: .72rem;
  color: #64748b;
}

.group-list {
  display: grid;
  gap: .75rem;
}

.group-item {
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: #fff;
  padding: .9rem;
}

.group-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
}

.group-item-title {
  font-size: .95rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

.group-item-sub {
  margin-top: .2rem;
  font-size: .75rem;
  color: #64748b;
}

.group-members-preview {
  margin-top: .7rem;
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}

.group-member-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: .25rem .55rem;
  font-size: .72rem;
  font-weight: 700;
  color: #334155;
}

.group-actions {
  margin-top: .85rem;
  display: grid;
  gap: .65rem;
}

.group-action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem;
}

.group-inline-control {
  min-width: 10rem;
  flex: 1 1 10rem;
}

.group-color-control {
  width: 3rem;
  height: 2.35rem;
  cursor: pointer;
  border-radius: .75rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  padding: .2rem;
}

.group-empty {
  border: 1px dashed #cbd5e1;
  border-radius: 1rem;
  background: #f8fafc;
  padding: 1rem;
  font-size: .85rem;
  color: #64748b;
}


.group-dashboard-section {
  border-radius: 1.5rem;
  border: 1px solid var(--brand-primary-soft, #e6f3f9);
  background: #fff;
  box-shadow: none;
  overflow: hidden;
}

.group-dashboard-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--brand-border, #cfe4f7);
}

.group-dashboard-title-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-width: 0;
}

.group-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: 1rem;
}

@media (min-width: 1280px) {
  .group-dashboard-grid {
    grid-template-columns: repeat(auto-fill, minmax(20rem, 29rem));
    justify-content: start;
    align-items: start;
  }
}

.group-dashboard-card {
  border: 1px solid var(--brand-primary-soft, #e6f3f9);
  border-radius: 1.25rem;
  background: rgba(255,255,255,.92);
  padding: 1rem;
  box-shadow: none;
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.group-dashboard-card:hover {
  border-color: var(--brand-primary, #015581);
  box-shadow: 0 .5rem 1.5rem rgba(15, 23, 42, .08);
  transform: translateY(-1px);
}

.group-dashboard-card-head {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
}

.group-dashboard-head-actions {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
}

.group-dashboard-head-actions .btn {
  padding: .42rem .62rem;
  border-radius: .75rem;
  font-size: .78rem;
}

.group-dashboard-main {
  min-width: 0;
  flex: 1 1 auto;
}

.group-dashboard-title {
  font-size: 1rem;
  line-height: 1.2;
  font-weight: 900;
  color: #0f172a;
}

.group-dashboard-sub {
  margin-top: .2rem;
  font-size: .76rem;
  color: #64748b;
}

.group-count-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.2rem;
  height: 2.2rem;
  padding: 0 .55rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 900;
  color: var(--brand-primary, #015581);
  background: var(--brand-primary-soft, #e6f3f9);
  border: 1px solid var(--brand-border, #cfe4f7);
}

.group-dashboard-members {
  margin-top: .85rem;
  max-height: 4.5rem;
  overflow: hidden;
}

.group-dashboard-actions {
  margin-top: .95rem;
  display: grid;
  gap: .7rem;
}

.group-dashboard-row {
  display: flex;
  align-items: center;
  gap: .55rem;
  flex-wrap: wrap;
}

.group-dashboard-row-tight {
  display: grid;
  grid-template-columns: minmax(9rem, 1fr) auto;
  gap: .55rem;
  align-items: center;
}

.group-dashboard-control-label {
  font-size: .72rem;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.group-dashboard-range {
  width: 100%;
  min-width: 0;
}

.group-dashboard-color {
  width: 2.75rem;
  height: 2.35rem;
  cursor: pointer;
  border-radius: .8rem;
  border: 1px solid #cbd5e1;
  background: #fff;
  padding: .18rem;
}

.group-dashboard-empty {
  border: 1px dashed var(--brand-border, #cfe4f7);
  border-radius: 1.25rem;
  background: rgba(255,255,255,.72);
  padding: 1rem;
  color: #475569;
  font-size: .88rem;
}

.groups-page {
  display: grid;
  gap: 1rem;
}

.groups-page-head,
.group-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.group-detail-head {
  align-items: center;
}

.group-detail-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.groups-page-title,
.group-detail-title {
  margin-top: 0;
  font-size: clamp(1.7rem, 2.6vw, 2.35rem);
  font-weight: 900;
  line-height: 1.15;
  color: #0f172a;
}

.groups-page-sub,
.group-detail-sub {
  margin-top: .25rem;
  font-size: .85rem;
  font-weight: 600;
  color: #64748b;
}

.group-detail-pane.hidden {
  display: none;
}

.group-detail-summary {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  flex: 0 0 auto;
  justify-content: flex-end;
}

.group-detail-intro {
  min-width: 0;
}

.group-detail-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem;
}

.group-detail-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-top: .8rem;
}

.group-detail-metric {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #fff;
  padding: .3rem .65rem;
  font-size: .76rem;
  font-weight: 800;
  color: #334155;
}

.group-detail-member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 22rem));
  gap: 1rem;
  align-items: start;
}

.group-detail-empty {
  border: 1px dashed #cbd5e1;
  border-radius: 1rem;
  background: #f8fafc;
  padding: 1rem;
  color: #475569;
  font-size: .9rem;
}

@media (max-width: 640px) {
  .group-dashboard-headline {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .group-dashboard-row-tight {
    grid-template-columns: 1fr;
  }

  .groups-page-head {
    flex-direction: column;
  }

  .group-detail-head {
    gap: .5rem;
  }

  .group-detail-summary {
    gap: .35rem;
  }
}

@media (max-width: 768px) {
  .group-grid,
  .group-member-grid {
    grid-template-columns: 1fr;
  }
}

.feature-page {
  display: grid;
  gap: 1rem;
}

.dashboard-page-view[data-dashboard-page="update"],
.system-update-overlay {
  font-family: DINMittelschriftStd, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

.feature-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.feature-page-action {
  flex: 0 0 auto;
  align-self: flex-start;
  margin-top: 0;
}

.feature-page-title {
  margin-top: 0;
  font-size: clamp(1.7rem, 2.6vw, 2.35rem);
  font-weight: 900;
  line-height: 1.15;
  color: #0f172a;
}

.feature-page-sub {
  margin-top: .25rem;
  max-width: 48rem;
  color: #64748b;
  font-size: .86rem;
  font-weight: 650;
}

.feature-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(20rem, .95fr);
  gap: 1rem;
  align-items: start;
}

.feature-single-layout {
  display: grid;
  gap: 1rem;
}

.feature-panel {
  border: 1px solid #e2e8f0;
  border-radius: 1.25rem;
  background: #fff;
  padding: 1rem;
}

.feature-panel-wide {
  grid-column: 1 / -1;
}

#mqttSettingsPanel {
  scroll-margin-top: calc(var(--dashboard-topbar-height, 3.55rem) + 1rem);
}

.feature-panel-title {
  font-size: .95rem;
  font-weight: 900;
  color: #0f172a;
}

.feature-panel-sub {
  margin-top: .2rem;
  font-size: .78rem;
  color: #64748b;
  font-weight: 650;
}

.zigbee-embed-panel {
  display: grid;
  gap: .85rem;
  padding: .85rem;
}

.zigbee-status-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, .45fr);
  gap: 1rem;
  align-items: stretch;
  margin-top: 1rem;
}

.zigbee-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .8rem;
}

.zigbee-action-panel,
.zigbee-frame-placeholder {
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: #fff;
  padding: .9rem;
}

.zigbee-action-panel-ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.zigbee-action-panel-warn {
  border-color: #fed7aa;
  background: #fff7ed;
}

.zigbee-action-panel-error {
  border-color: var(--danger-border, rgba(229, 0, 127, .3));
  background: var(--danger-soft, #fff0f7);
}

.zigbee-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-top: .85rem;
}

.zigbee-embed-head {
  padding: .15rem .25rem 0;
}

.zigbee-embed-frame {
  width: 100%;
  min-height: min(72vh, 56rem);
  height: calc(100vh - 14rem);
  border: 1px solid #d7e0ea;
  border-radius: 1rem;
  background: #f8fafc;
}

.zigbee-embed-frame.hidden {
  display: none;
}

.zigbee-frame-placeholder {
  display: block;
}

.zigbee-frame-placeholder.hidden {
  display: none;
}

@media (max-width: 1180px) {
  .zigbee-status-shell {
    grid-template-columns: 1fr;
  }

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

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

.restore-preview {
  margin-top: .85rem;
  border: 1px solid #cfe4f7;
  border-radius: 1rem;
  background: #f4fbff;
  padding: .85rem;
}

.restore-preview-title {
  color: #0f172a;
  font-size: .88rem;
  font-weight: 950;
}

.restore-preview-meta {
  margin-top: .3rem;
  color: #64748b;
  font-size: .78rem;
  font-weight: 700;
  line-height: 1.45;
}

.restore-preview-list {
  display: grid;
  gap: .45rem;
  margin-top: .7rem;
}

.restore-preview-item {
  border: 1px solid #e2e8f0;
  border-radius: .8rem;
  background: #fff;
  padding: .65rem .7rem;
}

.restore-preview-item-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .45rem;
  color: #0f172a;
  font-size: .82rem;
  font-weight: 900;
}

.restore-preview-item-sub {
  margin-top: .25rem;
  color: #64748b;
  font-size: .74rem;
  font-weight: 700;
  line-height: 1.4;
}

.restore-preview-badge {
  border-radius: 9999px;
  background: var(--brand-primary-soft, #e6f3f9);
  color: var(--brand-primary, #015581);
  padding: .2rem .45rem;
  font-size: .68rem;
  font-weight: 950;
}

.restore-preview-warning {
  margin-top: .65rem;
  color: #b45309;
  font-size: .76rem;
  font-weight: 800;
  line-height: 1.4;
}

.backup-table-wrap {
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
}

.backup-table {
  width: 100%;
  min-width: 48rem;
  border-collapse: collapse;
  background: #fff;
}

.backup-table th,
.backup-table td {
  border-bottom: 1px solid #e2e8f0;
  padding: .85rem 1rem;
  text-align: left;
  vertical-align: top;
}

.backup-table th {
  color: #64748b;
  font-size: .72rem;
  font-weight: 900;
  text-transform: uppercase;
}

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

.backup-table-name {
  color: #0f172a;
  font-size: .9rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.backup-table-path {
  margin-top: .2rem;
  color: #64748b;
  font-size: .72rem;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.backup-table-kind {
  margin-top: .35rem;
  color: #475569;
  font-size: .72rem;
  font-weight: 850;
}

.backup-type-pill {
  display: inline-flex;
  align-items: center;
  min-height: 1.6rem;
  border: 1px solid #dbe4ee;
  border-radius: 999px;
  background: #f8fafc;
  color: #334155;
  padding: .2rem .55rem;
  font-size: .72rem;
  font-weight: 900;
}

.runtime-migration-fix {
  margin-top: .85rem;
  border: 1px solid #fed7aa;
  border-radius: 1rem;
  background: #fff7ed;
  padding: .85rem;
  color: #9a3412;
  font-size: .78rem;
  font-weight: 800;
  line-height: 1.45;
}

.runtime-migration-command {
  display: block;
  margin-top: .55rem;
  overflow-x: auto;
  border: 1px solid #fdba74;
  border-radius: .75rem;
  background: #fff;
  padding: .65rem .75rem;
  color: #0f172a;
  font-size: .76rem;
  white-space: nowrap;
}

.runtime-migration-actions-disabled {
  opacity: .55;
}

.update-plan {
  border: 1px solid #dbe4ee;
  border-radius: 1rem;
  background: #f8fafc;
  padding: 1rem;
}

.update-plan-title {
  font-size: .76rem;
  font-weight: 900;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0;
}

.update-plan-grid {
  margin-top: .75rem;
  display: grid;
  gap: .55rem;
}

.update-plan-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  border: 1px solid #e2e8f0;
  border-radius: .85rem;
  background: #fff;
  padding: .7rem .8rem;
  font-size: .8rem;
  color: #475569;
}

.update-plan-row span {
  font-weight: 800;
  color: #64748b;
}

.update-plan-row strong {
  color: #0f172a;
  font-weight: 900;
  text-align: right;
  overflow-wrap: anywhere;
}

.update-plan-row-ok {
  border-color: #bbf7d0;
}

.update-plan-row-warn {
  border-color: #fed7aa;
}

@media (max-width: 640px) {
  .update-plan-row {
    display: grid;
    gap: .25rem;
  }

  .update-plan-row strong {
    text-align: left;
  }
}

.reauth-backdrop {
  position: fixed;
  inset: 0;
  z-index: 6500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, .38);
  padding: 1rem;
}

.reauth-dialog {
  width: min(100%, 26rem);
  border: 1px solid #e2e8f0;
  border-radius: 1.25rem;
  background: #fff;
  padding: 1.15rem;
  box-shadow: 0 24px 58px rgba(15, 23, 42, .22);
}

.reauth-kicker {
  color: var(--brand-primary, #015581);
  font-size: .72rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.reauth-title {
  margin: .35rem 0 0;
  color: #0f172a;
  font-size: 1.35rem;
  font-weight: 950;
  line-height: 1.05;
}

.reauth-copy {
  margin-top: .55rem;
  color: #64748b;
  font-size: .88rem;
  font-weight: 700;
  line-height: 1.45;
}

.bulk-risk-summary {
  margin-top: .9rem;
  border: 1px solid #e2e8f0;
  border-radius: .95rem;
  background: #f8fafc;
  padding: .85rem .9rem;
}

.bulk-risk-label {
  color: #64748b;
  font-size: .72rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.bulk-risk-targets {
  margin-top: .25rem;
  color: #0f172a;
  font-size: .98rem;
  font-weight: 900;
  line-height: 1.25;
}

.reauth-input {
  width: 100%;
  min-height: 3rem;
  margin-top: .9rem;
  border: 1px solid #dbe2ea;
  border-radius: .95rem;
  background: #f8fafc;
  color: #0f172a;
  padding: 0 .9rem;
  font-size: .95rem;
  font-weight: 800;
  outline: none;
}

.reauth-input:focus {
  border-color: var(--brand-primary, #015581);
  box-shadow: 0 0 0 4px rgba(1, 85, 129, .14);
}

.reauth-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .65rem;
  margin-top: 1rem;
}

.diagnostics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .8rem;
}

.diagnostic-card {
  min-width: 0;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: #f8fafc;
  padding: .9rem;
}

.diagnostic-card-ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.diagnostic-card-warn {
  border-color: #fed7aa;
  background: #fff7ed;
}

.diagnostic-card-error {
  border-color: var(--danger-border, rgba(229, 0, 127, .3));
  background: var(--danger-soft, #fff0f7);
}

.diagnostic-label {
  color: #64748b;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.diagnostic-value {
  margin-top: .25rem;
  color: #0f172a;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.2;
}

.diagnostic-sub {
  margin-top: .35rem;
  color: #64748b;
  font-size: .78rem;
  font-weight: 650;
  line-height: 1.35;
}

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

.diagnostic-section-title {
  margin-bottom: .5rem;
  color: #0f172a;
  font-size: .85rem;
  font-weight: 900;
}

.diagnostic-list {
  display: grid;
  gap: .55rem;
}

.diagnostic-event {
  border: 1px solid #e2e8f0;
  border-radius: .9rem;
  background: #fff;
  padding: .75rem;
}

.diagnostic-event-title {
  color: #0f172a;
  font-size: .84rem;
  font-weight: 850;
}

.diagnostic-event-sub {
  margin-top: .25rem;
  color: #64748b;
  font-size: .76rem;
  font-weight: 650;
  line-height: 1.35;
}

.diagnostic-event-payload {
  margin-top: .45rem;
  max-height: 9rem;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  border-radius: .7rem;
  background: #f8fafc;
  padding: .55rem;
  color: #334155;
  font-size: .74rem;
  font-weight: 700;
  line-height: 1.35;
}

.activity-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .65rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}

.feature-form-control {
  display: block;
  width: 100%;
  height: 2.75rem;
  min-height: 2.75rem;
  box-sizing: border-box;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background-color: #fff;
  color: #0f172a;
  padding: .625rem .85rem;
  font: inherit;
  font-size: .875rem;
  font-weight: 700;
  line-height: 1.25rem;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}

.feature-form-control:focus {
  border-color: var(--brand-primary, #015581);
  box-shadow: 0 0 0 3px rgba(1, 85, 129, .12);
}

.feature-list {
  display: grid;
  gap: .75rem;
}

.feature-item {
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: #fff;
  padding: .9rem;
}

.feature-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
}

.feature-item-title {
  font-size: .98rem;
  font-weight: 900;
  color: #0f172a;
}

.feature-item-sub {
  margin-top: .2rem;
  font-size: .76rem;
  color: #64748b;
}

.feature-actions {
  margin-top: .85rem;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.inline-delete-form {
  display: inline-flex;
  margin: 0;
}

.quick-preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem;
  max-height: 17rem;
  overflow-y: auto;
  padding-right: .2rem;
}

.choice-card {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: #fff;
  padding: .75rem;
  cursor: pointer;
}

.choice-card:hover {
  background: #f8fafc;
}

.pair-detected-list {
  display: grid;
  gap: .55rem;
}

.pair-detected-item {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: #fff;
  padding: .85rem;
  text-align: left;
}

.pair-detected-item:hover {
  background: #f8fafc;
}

.pair-detected-item.active {
  border-color: var(--brand-primary, #015581);
  box-shadow: 0 0 0 1px var(--brand-primary, #015581);
}

.wizard-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .6rem;
}

.wizard-step {
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: #fff;
  padding: .85rem;
}

.wizard-step.active {
  border-color: var(--brand-border, #cfe4f7);
  background: var(--brand-primary-soft, #e6f3f9);
}

.wizard-step-index {
  width: 1.65rem;
  height: 1.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #0f172a;
  color: #fff;
  font-size: .72rem;
  font-weight: 900;
}

.wizard-step-title {
  margin-top: .5rem;
  font-weight: 900;
  color: #0f172a;
}

.wizard-step-sub {
  margin-top: .15rem;
  font-size: .76rem;
  color: #64748b;
  line-height: 1.35;
}

@media (max-width: 900px) {
  .feature-layout,
  .feature-grid,
  .choice-grid,
  .diagnostics-grid,
  .diagnostics-columns,
  .schedule-overview-grid,
  .activity-filter-grid,
  .wizard-steps {
    grid-template-columns: 1fr;
  }

  .schedule-timeline-item {
    grid-template-columns: 1fr;
  }

  .schedule-rule-main {
    flex-direction: column;
  }

  .schedule-rule-status,
  .schedule-timeline-actions {
    justify-content: flex-start;
  }

  .feature-page-head {
    flex-direction: column;
  }
}


.users-grid {
  display: grid;
  gap: .75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.users-form-shell {
  display: grid;
  gap: 1rem;
}

.users-list {
  display: grid;
  gap: .75rem;
}

.user-item {
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: #fff;
  padding: .9rem;
}

.user-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .75rem;
}

.user-item-title {
  font-size: .95rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

.user-item-sub {
  margin-top: .2rem;
  font-size: .75rem;
  color: #64748b;
}

.user-row-grid {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) auto;
  gap: .55rem;
  align-items: center;
}

.user-password-row {
  margin-top: .65rem;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  gap: .55rem;
  align-items: center;
}

.user-active-label {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: .82rem;
  font-weight: 800;
  color: #334155;
  white-space: nowrap;
}

.user-section-box {
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: #f8fafc;
  padding: .85rem;
}

.user-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .7rem;
}

.user-section-title {
  font-size: .82rem;
  font-weight: 900;
  color: #0f172a;
}

.user-section-title-small {
  margin-bottom: .45rem;
}

.user-section-sub {
  margin-top: .15rem;
  font-size: .74rem;
  font-weight: 650;
  color: #64748b;
  line-height: 1.35;
}

.user-permission-grid,
.user-radio-row,
.user-target-choices {
  display: grid;
  gap: .55rem;
}

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

.user-radio-row,
.user-target-choices {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.user-check-card,
.user-target-card {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: .5rem;
  border: 1px solid #e2e8f0;
  border-radius: .85rem;
  background: #fff;
  padding: .65rem .7rem;
  font-size: .78rem;
  font-weight: 800;
  color: #334155;
}

.user-target-list {
  display: grid;
  gap: .45rem;
  max-height: 11rem;
  overflow: auto;
}

.user-role-note {
  border: 1px solid var(--brand-border, #cfe4f7);
  border-radius: 1rem;
  background: var(--brand-primary-soft, #e6f3f9);
  padding: .85rem;
  font-size: .78rem;
  color: #334155;
  line-height: 1.45;
}

.user-empty {
  border: 1px dashed #cbd5e1;
  border-radius: 1rem;
  background: #f8fafc;
  padding: 1rem;
  font-size: .85rem;
  color: #64748b;
}

.user-empty-compact {
  padding: .7rem;
  font-size: .76rem;
}

@media (max-width: 768px) {
  .users-grid,
  .user-row-grid,
  .user-password-row,
  .user-permission-grid,
  .user-radio-row,
  .user-target-choices {
    grid-template-columns: 1fr;
  }
}

  .hidden {
    display: none;
  }

  .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

body.system-update-running,
body.connection-status-running {
  overflow: hidden;
}

.system-update-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(135deg, rgba(1, 85, 129, .08), rgba(255, 255, 255, 0) 34%),
    #ffffff;
  padding: clamp(1.25rem, 4vw, 4rem);
}

.system-update-overlay.hidden {
  display: none;
}

.system-update-screen {
  width: min(100%, 42rem);
}

.system-update-logo {
  display: block;
  width: clamp(9rem, 18vw, 15rem);
  height: auto;
  margin-bottom: clamp(2rem, 6vw, 5rem);
}

.system-update-kicker {
  margin-bottom: .75rem;
  color: var(--brand-primary, #015581);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.system-update-title {
  margin: 0;
  color: #0f172a;
  font-family: DINMittelschriftStd, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: clamp(2rem, 5vw, 4.25rem);
  font-weight: 800;
  line-height: .98;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}

.system-update-detail {
  width: min(100%, 35rem);
  margin: 1rem 0 1.5rem;
  color: #475569;
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  line-height: 1.5;
}

.system-update-progress {
  width: 100%;
  height: .7rem;
  overflow: hidden;
  border-radius: 9999px;
  background: #e2e8f0;
}

.system-update-progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--brand-primary, #015581);
  transition: width .28s ease;
}

.system-update-meta {
  margin-top: .85rem;
  color: #64748b;
  font-size: .9rem;
  font-weight: 700;
}

.system-update-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 1.25rem;
}

.connection-status-overlay .system-update-screen {
  width: min(100%, 50rem);
}

.connection-status-overlay .system-update-title {
  font-size: clamp(2.45rem, 6vw, 5.25rem);
}

.connection-status-progress-bar {
  width: 34%;
  min-width: 5rem;
  animation: connectionStatusPulse 1.2s ease-in-out infinite alternate;
}

.connection-status-restored .connection-status-progress-bar {
  width: 100%;
  animation: none;
}

@keyframes connectionStatusPulse {
  from {
    opacity: .76;
    width: 24%;
  }
  to {
    opacity: 1;
    width: 72%;
  }
}

.form-note {
  font-size: .75rem;
  color: #64748b;
}

.mqtt-connection-hint {
  border: 1px solid #dbe4ee;
  border-radius: 1rem;
  background: #f8fafc;
  color: #475569;
  padding: .85rem;
  font-size: .8rem;
  font-weight: 750;
  line-height: 1.45;
}

.mqtt-connection-hint-title {
  margin-bottom: .2rem;
  color: #0f172a;
  font-weight: 950;
}

.mqtt-connection-hint-ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.mqtt-connection-hint-warn {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.mqtt-connection-hint-info {
  border-color: #dbe4ee;
}

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

  .toolbar-select-all {
    grid-column: 1 / -1;
  }

  .toolbar-bulk-wrap {
    grid-column: 1 / -1;
    order: 10;
  }
}



@media (max-width: 640px) {
  .mobile-page-stack {
    gap: .85rem;
  }

  .mobile-hero {
    border-radius: 1.35rem;
  }

  .mobile-hero-head {
    padding: 1rem;
    gap: .85rem;
  }

  .mobile-brand-logo {
    height: 2.15rem;
  }

  .mobile-brand-title {
    font-size: 1.1rem;
    line-height: 1.15;
  }

  .mobile-brand-subtitle {
    font-size: .78rem;
  }

  .mobile-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .55rem;
    width: 100%;
  }

  .mobile-action-grid .btn {
    width: 100%;
    min-height: 2.75rem;
    padding: .55rem .65rem;
    border-radius: .85rem;
    font-size: .8rem;
  }

  .mobile-kpi-wrap {
    padding: .75rem 1rem 1rem;
  }

  .mobile-kpi-grid {
    display: flex !important;
    gap: .65rem;
    overflow-x: auto;
    padding-bottom: .15rem;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-kpi-grid > div {
    min-width: 7.2rem;
    flex: 0 0 auto;
    scroll-snap-align: start;
  }

  .mobile-section-card {
    border-radius: 1.35rem;
  }

  .mobile-section-head {
    padding: 1rem;
  }

  .mobile-section-body {
    padding: .85rem;
  }

  .toolbar-shell {
    grid-template-columns: 1fr;
    gap: .65rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: .75rem;
  }

  .toolbar-control {
    min-height: 2.9rem;
    font-size: .9rem;
  }

  .toolbar-bulk-wrap,
  .toolbar-search-wrap,
  .toolbar-state-wrap {
    width: 100%;
  }

  .toolbar-bulk-wrap.has-selection {
    display: block;
    grid-column: 1 / -1;
  }

  .toolbar-bulk-wrap .toolbar-bulk-btn {
    width: 100%;
  }

  #tanks-body {
    gap: .85rem;
  }

  .compact-card {
    border-radius: 1rem;
  }

  .compact-card .card-pad {
    padding: .85rem;
  }

  .action-main-row {
    align-items: stretch;
  }

  .switch-wrap {
    min-height: 2.75rem;
  }

  .action-tools {
    margin-left: 0;
  }

  .mini-icon-btn,
  .tank-menu-btn {
    min-width: 2.75rem;
    min-height: 2.75rem;
  }



  .modal-backdrop {
    inset: 0 0 0 auto;
    width: 100vw;
    height: 100vh;
    padding: 0;
  }

  .modal-card {
    width: 100%;
    height: 100%;
    max-height: none;
    border-radius: 0;
  }

  .modal-header,
  .modal-body {
    padding: 1rem;
  }
}

/* Energy rows rendered by dashboard.js */
.energy-device-row-head {
  border: 0;
  background: transparent;
  padding-block: .2rem;
  color: #94a3b8;
  font-size: .68rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .045em;
}

.energy-device-row-link {
  color: inherit;
  text-decoration: none;
  transition: border-color .16s ease, background-color .16s ease;
}

.energy-device-row-link:hover {
  border-color: var(--brand-border, #cfe4f7);
  background: #f8fafc;
}

.energy-device-row-link:focus-visible {
  outline: 3px solid rgba(1, 85, 129, .25);
  outline-offset: 2px;
}

.energy-device-primary {
  display: grid;
  gap: .25rem;
  min-width: 0;
}

.energy-device-value,
.energy-device-last {
  min-width: 0;
  color: #334155;
  font-size: .8rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.energy-device-last {
  color: #64748b;
  font-size: .74rem;
}

.energy-device-status i {
  width: .48rem;
  height: .48rem;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 3px #dcfce7;
}

.energy-device-status-stale i,
.energy-device-status-waiting i {
  background: #f59e0b;
  box-shadow: 0 0 0 3px #fef3c7;
}

.energy-device-status-offline i {
  background: var(--danger, #e5007f);
  box-shadow: 0 0 0 3px var(--danger-ring, rgba(229, 0, 127, .14));
}

.energy-chart-axis-label {
  fill: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.energy-chart-last-point {
  fill: #fff;
  stroke: var(--brand-primary, #015581);
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}

@media (max-width: 980px) {
  .energy-device-row-head {
    display: none;
  }

  .energy-device-value::before,
  .energy-device-last::before {
    content: attr(data-label);
    display: block;
    margin-bottom: .16rem;
    color: #94a3b8;
    font-size: .66rem;
    font-weight: 750;
  }

  .energy-device-primary {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .energy-device-primary {
    grid-column: auto;
  }
}
