.pc-viewport {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--bg-canvas);
}

.pc-stage {
  width: 960px;
  height: 472px;
  display: grid;
  grid-template-columns: 52px 209px 209px 233px 233px;
  grid-template-rows: 233px 233px;
  gap: 6px;
  transform-origin: center center;
  flex-shrink: 0;
}

/* ─── SIDEBAR ──────────────────────────────────────────────────────── */
.pc-sidebar {
  grid-column: 1 / 2;
  grid-row: 1 / 3;
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 14px;
  padding: 8px 4px;
}

.pc-nav-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: background 0.16s ease, color 0.16s ease, transform 0.12s ease;
}

.pc-nav-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.pc-nav-btn.is-active {
  color: var(--accent-cyan);
  background: rgba(56, 242, 233, 0.1);
}

.pc-nav-btn img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.pc-nav-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-alert);
}

/* ─── HERO AREA CARD (COLS 2-3, ROWS 1-2) ──────────────────────────── */
.pc-hero-card {
  grid-column: 2 / 4;
  grid-row: 1 / 3;
  border-radius: var(--radius-pc);
  overflow: hidden;
  position: relative;
  background-color: var(--bg-card);
  background-position: center bottom;
  background-size: cover;
  background-repeat: no-repeat;
  transition: background-image 0.35s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 22px 18px;
}

.pc-hero-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(13, 15, 16, 0.35) 0%, transparent 45%, rgba(13, 15, 16, 0.45) 100%);
  pointer-events: none;
}

.pc-hero-top {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.pc-clock {
  font-size: 48px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1;
  letter-spacing: -1px;
  text-shadow: 2px 2px 24px rgba(0, 0, 0, 0.85);
}

.pc-date {
  font-size: 13px;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.78);
  margin-top: 6px;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.8);
}

.pc-hero-badges {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}

.pc-status-chip {
  font-size: 10px;
  font-weight: 500;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(18, 18, 18, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(6px);
}

.pc-status-chip.is-away {
  color: var(--accent-warm);
  border-color: rgba(255, 191, 123, 0.35);
}

.pc-status-chip.is-holiday {
  color: var(--accent-cyan);
  border-color: rgba(56, 242, 233, 0.35);
}

.pc-status-chip.is-alarm {
  background: rgba(255, 112, 67, 0.25);
  color: #ffb89e;
  border-color: var(--accent-alert);
}

.pc-hero-actions {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  padding: 0 8px;
}

.pc-scene-btn {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-btn);
  background: var(--bg-btn);
  border: 1px solid rgba(255, 255, 255, 0.04);
  color: #d1d2d1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.pc-scene-btn:hover {
  background: #1b1c1e;
}

.pc-scene-btn:active {
  transform: scale(0.94);
}

.pc-scene-btn.is-active {
  color: var(--accent-cyan);
  border-color: rgba(56, 242, 233, 0.4);
  box-shadow: 0 0 14px rgba(56, 242, 233, 0.14);
}

.pc-scene-btn img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.pc-scene-code {
  font-size: 8px;
  letter-spacing: 0.04em;
  opacity: 0.65;
}

/* ─── SQUARE DASHBOARD TILES (233×233) ─────────────────────────────── */
.pc-tile {
  background: var(--bg-card);
  border-radius: var(--radius-pc);
  padding: 13px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  border: 1px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.pc-tile-kombi {
  grid-column: 4 / 5;
  grid-row: 1 / 2;
}

.pc-tile-security {
  grid-column: 5 / 6;
  grid-row: 1 / 2;
}

.pc-tile-rooms {
  grid-column: 4 / 5;
  grid-row: 2 / 3;
}

.pc-tile-all-lights {
  grid-column: 5 / 6;
  grid-row: 2 / 3;
  background-position: center bottom;
  background-size: cover;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.pc-tile-all-lights::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(18, 20, 22, 0.72) 0%, rgba(18, 20, 22, 0.25) 52%, transparent 100%);
  pointer-events: none;
}

.pc-tile-all-lights > * {
  position: relative;
  z-index: 1;
}

.pc-tile-all-lights .pc-tile-sub {
  color: rgba(255, 255, 255, 0.72);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
}

.pc-tile.is-alert-pulse {
  border-color: var(--accent-alert);
  box-shadow: 0 0 18px rgba(255, 112, 67, 0.35);
}

.pc-tile-header {
  display: flex;
  align-items: center;
  gap: 9px;
}

.pc-tile-header.is-clickable {
  cursor: pointer;
}

.pc-icon-cell {
  width: 36px;
  height: 36px;
  border-radius: 16px;
  background: var(--bg-icon-cell);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
  flex-shrink: 0;
}

.pc-icon-cell.is-alert {
  color: var(--accent-alert);
}

.pc-icon-cell img {
  width: 24px;
  height: 24px;
}

.pc-tile-title {
  font-size: 17px;
  font-weight: 500;
  color: #ffffff;
  line-height: 1.15;
}

.pc-tile-sub {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.25;
}

.pc-kombi-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pc-kombi-metrics {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.pc-kombi-big {
  font-size: 28px;
  font-weight: 600;
  line-height: 1;
}

.pc-kombi-big span {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-subtle);
}

.pc-kombi-rh {
  font-size: 12px;
  color: var(--text-secondary);
}

.pc-kombi-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(18, 18, 18, 0.72);
  border-radius: 12px;
  padding: 6px 8px;
}

.pc-mini-btn {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 8px;
  background: #1e2022;
  color: #ffffff;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}

.pc-mini-btn:hover {
  background: #2b2e31;
}

.pc-target-inline {
  text-align: center;
}

.pc-target-inline strong {
  display: block;
  font-size: 14px;
  color: var(--accent-teal);
}

.pc-target-inline small {
  font-size: 9px;
  color: var(--text-subtle);
}

.pc-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  padding: 5px 8px;
  border-radius: 9px;
  background: rgba(18, 18, 18, 0.75);
  color: var(--text-secondary);
}

.pc-pill-badge.is-cyan {
  color: var(--accent-cyan);
}

.pc-pill-badge.is-alert {
  color: var(--accent-alert);
  background: rgba(255, 112, 67, 0.14);
}

.pc-security-body {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.pc-sec-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  background: rgba(18, 18, 18, 0.65);
  padding: 6px 8px;
  border-radius: 10px;
}

.pc-sec-row strong {
  font-weight: 500;
}

.pc-countdown-bar {
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-top: 2px;
}

.pc-countdown-fill {
  height: 100%;
  background: var(--accent-cyan);
  transition: width 0.35s linear;
}

.pc-btn-inline {
  border: none;
  border-radius: 9px;
  padding: 6px 9px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  background: var(--bg-btn);
  color: #ffffff;
  transition: background 0.15s ease;
}

.pc-btn-inline:hover {
  background: #242629;
}

.pc-btn-inline.is-alert {
  background: rgba(255, 112, 67, 0.25);
  color: #ffd3c4;
  border: 1px solid rgba(255, 112, 67, 0.45);
}

.pc-rooms-mini-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.pc-room-chip {
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(18, 18, 18, 0.72);
  color: var(--text-secondary);
  border-radius: 9px;
  padding: 6px 7px;
  font-size: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.pc-room-chip:hover {
  border-color: rgba(56, 242, 233, 0.35);
}

.pc-room-chip.is-lit {
  color: #ffffff;
  border-color: rgba(56, 242, 233, 0.28);
}

.pc-room-chip .count {
  font-weight: 600;
  color: var(--accent-cyan);
}

/* ─── SUB-VIEW PANEL (COLS 2-5, ROWS 1-2) ───────────────────────────── */
.pc-panel-area {
  grid-column: 2 / 6;
  grid-row: 1 / 3;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ─── 6 ROOMS GRID ─────────────────────────────────────────────────── */
.pc-rooms-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 233px);
  gap: 6px;
  height: 472px;
}

.pc-room-card {
  background: var(--bg-card);
  border-radius: var(--radius-pc);
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  border: 1px solid transparent;
  overflow: hidden;
}

.pc-room-card.is-focused {
  border-color: rgba(56, 242, 233, 0.45);
}

.pc-room-card.is-alarm-pulse {
  border-color: var(--accent-alert);
  box-shadow: inset 0 0 18px rgba(255, 112, 67, 0.22);
}

.pc-room-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.pc-room-name {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.1;
}

.pc-room-sensor-pill {
  font-size: 9px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--bg-btn);
  color: var(--text-subtle);
  white-space: nowrap;
}

.pc-room-sensor-pill.is-active {
  color: var(--accent-cyan);
}

.pc-room-sensor-pill.is-alert {
  color: #ffd3c4;
  background: rgba(255, 112, 67, 0.26);
}

.pc-device-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.pc-sw-btn {
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  background: var(--bg-btn);
  color: rgba(255, 255, 255, 0.72);
  padding: 6px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  cursor: pointer;
  font-size: 10px;
  text-align: left;
  transition: border-color 0.14s ease, background 0.14s ease, color 0.14s ease;
}

.pc-sw-btn.is-on {
  background: rgba(56, 242, 233, 0.13);
  border-color: rgba(56, 242, 233, 0.38);
  color: #ffffff;
}

.pc-sw-btn.is-pulse-warn {
  background: rgba(255, 112, 67, 0.28);
  border-color: var(--accent-alert);
  color: #ffffff;
}

.pc-sw-btn small {
  display: block;
  font-size: 8px;
  color: var(--text-subtle);
}

.pc-sw-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.pc-sw-btn.is-on .pc-sw-dot {
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
}

.pc-dimmer-row {
  background: var(--bg-btn);
  border-radius: 10px;
  padding: 6px 9px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pc-dimmer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
}

.pc-dimmer-toggle {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 500;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
}

.pc-dimmer-toggle.is-on {
  color: var(--accent-cyan);
}

.pc-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
  outline: none;
  cursor: pointer;
}

.pc-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent-cyan);
  cursor: pointer;
}

.pc-l2-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.pc-l2-trigger {
  flex: 1;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  background: var(--bg-btn);
  color: #ffffff;
  font-size: 10px;
  padding: 5px 8px;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pc-l2-trigger:hover {
  border-color: rgba(56, 242, 233, 0.35);
}

.pc-l2-select {
  background: #141618;
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  font-size: 9px;
  padding: 4px 5px;
  max-width: 104px;
  cursor: pointer;
}

/* ─── KOMBI FULL TAB ───────────────────────────────────────────────── */
.pc-climate-split {
  display: grid;
  grid-template-columns: 1fr 225px;
  gap: 6px;
  height: 472px;
  align-items: center;
}

.pc-climate-info-card {
  height: 472px;
  background: var(--bg-card);
  border-radius: var(--radius-pc);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.pc-hyst-box {
  background: var(--bg-btn);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pc-hyst-bar {
  position: relative;
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
  overflow: hidden;
}

.pc-hyst-deadband {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(56, 242, 233, 0.25);
  border-left: 1px solid var(--accent-cyan);
  border-right: 1px solid var(--accent-cyan);
}

.pc-hyst-marker {
  position: absolute;
  top: -2px;
  width: 4px;
  height: 14px;
  border-radius: 2px;
  background: var(--accent-warm);
  transform: translateX(-50%);
}

.pc-control-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pc-sim-box {
  background: var(--bg-btn);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
}

.pc-sim-box-head {
  display: flex;
  justify-content: space-between;
  color: var(--text-secondary);
}

/* ─── FLOWS & LOG TAB ──────────────────────────────────────────────── */
.pc-flows-split {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 6px;
  height: 472px;
}

.pc-flows-card {
  background: var(--bg-card);
  border-radius: var(--radius-pc);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}

.pc-flow-rules-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  overflow-y: auto;
}

.pc-flow-rule {
  background: var(--bg-btn);
  border-radius: 11px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.pc-flow-rule.is-active {
  border-color: rgba(56, 242, 233, 0.35);
}

.pc-flow-rule.is-alert {
  border-color: rgba(255, 112, 67, 0.6);
}

.pc-flow-rule-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
}

.pc-flow-rule-desc {
  font-size: 10px;
  color: var(--text-subtle);
  line-height: 1.3;
}

.pc-log-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 4px;
}

.pc-log-item {
  background: var(--bg-btn);
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 11px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  border-left: 2px solid var(--accent-cyan);
}

.pc-log-item.is-warn {
  border-left-color: var(--accent-warm);
}

.pc-log-item.is-critical {
  border-left-color: var(--accent-alert);
  background: rgba(255, 112, 67, 0.1);
}

.pc-log-time {
  font-size: 10px;
  color: var(--text-subtle);
  flex-shrink: 0;
}

.pc-log-tag {
  font-size: 9px;
  font-weight: 600;
  color: var(--accent-cyan);
  flex-shrink: 0;
}

.pc-log-item.is-critical .pc-log-tag {
  color: var(--accent-alert);
}
