/* NOC Wallboard — designed for video wall */

.noc {
  --noc-bg: oklch(0.13 0.012 240);
  --noc-bg-2: oklch(0.16 0.012 240);
  --noc-panel: oklch(0.19 0.012 240);
  --noc-panel-2: oklch(0.22 0.012 240);
  --noc-border: oklch(0.28 0.012 240);
  --noc-border-strong: oklch(0.36 0.012 240);
  --noc-text: oklch(0.98 0.005 240);
  --noc-dim: oklch(0.7 0.012 240);
  --noc-mute: oklch(0.5 0.012 240);
  --noc-ok: oklch(0.74 0.16 150);
  --noc-warn: oklch(0.82 0.16 75);
  --noc-crit: oklch(0.66 0.22 28);
  --noc-info: oklch(0.78 0.14 230);
  --noc-accent: #22d3a8;
  background: var(--noc-bg);
  color: var(--noc-text);
  height: 100vh;
  width: 100vw;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 14px;
  padding: 14px 18px;
  font-family: var(--font);
  overflow: hidden;
}
[data-theme="light"] .noc {
  --noc-bg: oklch(0.97 0.005 240);
  --noc-bg-2: oklch(0.94 0.006 240);
  --noc-panel: oklch(1 0 0);
  --noc-panel-2: oklch(0.97 0.005 240);
  --noc-border: oklch(0.88 0.005 240);
  --noc-border-strong: oklch(0.78 0.008 240);
  --noc-text: oklch(0.18 0.012 240);
  --noc-dim: oklch(0.45 0.012 240);
  --noc-mute: oklch(0.65 0.012 240);
}

/* Subtle scan-grid background */
.noc::before {
  content: "";
  position: fixed; inset: 0;
  background-image:
    linear-gradient(var(--noc-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--noc-border) 1px, transparent 1px);
  background-size: 80px 80px;
  opacity: 0.18;
  pointer-events: none;
  z-index: 0;
}

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

/* ---------- Header ---------- */
.noc-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 6px 4px;
}
.noc-brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.noc-mark {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: var(--noc-accent);
  color: oklch(0.13 0.01 240);
  border-radius: 8px;
  flex-shrink: 0;
}
.noc-site { line-height: 1.1; }
.noc-site-name { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.noc-site-sub { font-size: 12px; color: var(--noc-dim); font-family: var(--mono); margin-top: 4px; letter-spacing: .04em; }

.noc-status-master {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 22px;
  background: color-mix(in oklch, var(--noc-ok) 14%, var(--noc-panel));
  border: 1px solid color-mix(in oklch, var(--noc-ok) 40%, var(--noc-border));
  border-radius: 999px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.noc-status-master.warn {
  background: color-mix(in oklch, var(--noc-warn) 14%, var(--noc-panel));
  border-color: color-mix(in oklch, var(--noc-warn) 40%, var(--noc-border));
  color: var(--noc-warn);
}
.noc-status-master.crit {
  background: color-mix(in oklch, var(--noc-crit) 14%, var(--noc-panel));
  border-color: color-mix(in oklch, var(--noc-crit) 40%, var(--noc-border));
  color: var(--noc-crit);
}
.noc-status-master .pulse {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--noc-ok);
  box-shadow: 0 0 0 0 var(--noc-ok);
  animation: noc-pulse 2s infinite;
}
.noc-status-master.warn .pulse { background: var(--noc-warn); }
.noc-status-master.crit .pulse { background: var(--noc-crit); animation-duration: 1s; }
@keyframes noc-pulse {
  0% { box-shadow: 0 0 0 0 currentColor; opacity: 1; }
  70% { box-shadow: 0 0 0 12px transparent; opacity: 0.7; }
  100% { box-shadow: 0 0 0 0 transparent; opacity: 1; }
}

.noc-head-right {
  display: flex; align-items: center; gap: 22px;
  justify-content: flex-end;
  font-family: var(--mono);
}
.noc-clock {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1;
}
.noc-clock-sub {
  font-size: 11px;
  color: var(--noc-dim);
  margin-top: 4px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.noc-meta-block { line-height: 1.4; text-align: right; }
.noc-meta-block .k { font-size: 10px; color: var(--noc-dim); letter-spacing: .12em; text-transform: uppercase; }
.noc-meta-block .v { font-size: 14px; font-weight: 600; color: var(--noc-text); }
.noc-meta-block .v b { color: var(--noc-accent); }

.noc-weather {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px;
  background: var(--noc-panel);
  border: 1px solid var(--noc-border);
  border-radius: 8px;
}
.noc-weather .temp { font-size: 22px; font-weight: 700; font-family: var(--mono); }
.noc-weather .wm { line-height: 1.2; }
.noc-weather .wm .lbl { font-size: 9px; color: var(--noc-dim); letter-spacing: .12em; text-transform: uppercase; }
.noc-weather .wm .val { font-size: 11px; font-family: var(--mono); }

/* ---------- KPI XL row ---------- */
.noc-kpis {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}
.noc-kpi {
  background: var(--noc-panel);
  border: 1px solid var(--noc-border);
  border-radius: 12px;
  padding: 18px 22px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 130px;
}
.noc-kpi::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--noc-mute);
}
.noc-kpi.ok::before { background: var(--noc-ok); }
.noc-kpi.warn::before { background: var(--noc-warn); }
.noc-kpi.crit::before { background: var(--noc-crit); }
.noc-kpi.info::before { background: var(--noc-info); }
.noc-kpi.accent::before { background: var(--noc-accent); }

.noc-kpi-label {
  font-size: 11px;
  font-family: var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--noc-dim);
  font-weight: 700;
  display: flex; justify-content: space-between; align-items: center;
}
.noc-kpi-label .live {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 9px;
  color: var(--noc-ok);
}
.noc-kpi-label .live::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--noc-ok);
  animation: noc-pulse 2s infinite;
}
.noc-kpi-val {
  font-size: 56px;
  font-weight: 700;
  font-family: var(--mono);
  letter-spacing: -0.03em;
  line-height: 0.95;
}
.noc-kpi-val .unit { font-size: 18px; font-weight: 500; color: var(--noc-dim); margin-left: 6px; }
.noc-kpi-row {
  display: flex; justify-content: space-between; align-items: end; gap: 12px;
  margin-top: auto;
}
.noc-kpi-sub {
  font-size: 12px;
  color: var(--noc-dim);
  font-family: var(--mono);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.noc-kpi-sub b { color: var(--noc-text); }
.noc-kpi-trend {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
}
.noc-kpi-trend.up-bad { color: var(--noc-crit); }
.noc-kpi-trend.up-good { color: var(--noc-ok); }
.noc-kpi-trend.down-bad { color: var(--noc-crit); }
.noc-kpi-trend.down-good { color: var(--noc-ok); }
.noc-kpi-trend.stable { color: var(--noc-dim); }
.noc-kpi-spark { height: 36px; margin-top: 6px; }

/* ---------- Body grid ---------- */
.noc-body {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 14px;
  min-height: 0;
}
.noc-card {
  background: var(--noc-panel);
  border: 1px solid var(--noc-border);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.noc-card-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 12px;
  flex-shrink: 0;
}
.noc-card-title {
  font-size: 12px;
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--noc-dim);
}
.noc-card-meta {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--noc-mute);
  letter-spacing: .04em;
}
.noc-card-meta b { color: var(--noc-text); }

/* Rooms card spans 2 rows on left */
.noc-rooms {
  grid-row: 1 / span 2;
}
.noc-rooms-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.noc-room {
  background: var(--noc-bg-2);
  border: 1px solid var(--noc-border);
  border-radius: 10px;
  padding: 12px 16px;
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 18px;
  align-items: center;
}
.noc-room.warn { border-color: color-mix(in oklch, var(--noc-warn) 50%, var(--noc-border)); }
.noc-room.crit { border-color: color-mix(in oklch, var(--noc-crit) 50%, var(--noc-border)); animation: room-crit 3s infinite; }
@keyframes room-crit {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in oklch, var(--noc-crit) 0%, transparent); }
  50% { box-shadow: 0 0 0 4px color-mix(in oklch, var(--noc-crit) 18%, transparent); }
}
.noc-room-id {
  display: flex; flex-direction: column; gap: 4px;
}
.noc-room-name {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.noc-room-sub {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--noc-dim);
  letter-spacing: .04em;
}
.noc-room-status {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 700;
  margin-top: 4px;
}
.noc-room-status .d { width: 8px; height: 8px; border-radius: 50%; }
.noc-room-status.ok { color: var(--noc-ok); }
.noc-room-status.ok .d { background: var(--noc-ok); }
.noc-room-status.warn { color: var(--noc-warn); }
.noc-room-status.warn .d { background: var(--noc-warn); box-shadow: 0 0 6px var(--noc-warn); }
.noc-room-status.crit { color: var(--noc-crit); }
.noc-room-status.crit .d { background: var(--noc-crit); box-shadow: 0 0 8px var(--noc-crit); animation: noc-pulse 1.2s infinite; }

.noc-gauges { display: flex; flex-direction: column; gap: 10px; }
.noc-gauge { display: flex; flex-direction: column; gap: 4px; }
.noc-gauge-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--mono);
}
.noc-gauge-head .lbl { font-size: 10px; color: var(--noc-dim); letter-spacing: .08em; text-transform: uppercase; }
.noc-gauge-head .val { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; }
.noc-gauge-head .val .u { font-size: 11px; color: var(--noc-dim); margin-left: 2px; }
.noc-gauge-bar {
  height: 10px;
  background: var(--noc-bg);
  border-radius: 5px;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--noc-border);
}
.noc-gauge-bar .fill {
  height: 100%;
  border-radius: 4px;
  transition: width .6s ease;
}
.noc-gauge-bar .threshold {
  position: absolute;
  top: -2px; bottom: -2px;
  width: 2px;
  background: var(--noc-warn);
  opacity: 0.8;
}
.noc-room-side {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.noc-room-stat {
  background: var(--noc-panel-2);
  border: 1px solid var(--noc-border);
  border-radius: 6px;
  padding: 8px 10px;
}
.noc-room-stat .k { font-size: 9px; font-family: var(--mono); color: var(--noc-dim); letter-spacing: .1em; text-transform: uppercase; }
.noc-room-stat .v { font-size: 18px; font-weight: 700; font-family: var(--mono); letter-spacing: -0.02em; }
.noc-room-stat .v .u { font-size: 10px; color: var(--noc-dim); margin-left: 2px; font-weight: 500; }
.noc-room-stat.crit { border-color: color-mix(in oklch, var(--noc-crit) 50%, var(--noc-border)); }
.noc-room-stat.crit .v { color: var(--noc-crit); }
.noc-room-stat.warn { border-color: color-mix(in oklch, var(--noc-warn) 50%, var(--noc-border)); }
.noc-room-stat.warn .v { color: var(--noc-warn); }

/* Sparkline area */
.noc-spark { height: 30px; margin-top: 4px; }
.noc-spark svg { display: block; width: 100%; height: 100%; }

/* ---------- Tickets card ---------- */
.noc-tickets {
  display: flex; flex-direction: column;
  min-height: 0;
}
.noc-tk-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.noc-tk-summary .item {
  background: var(--noc-bg-2);
  border: 1px solid var(--noc-border);
  border-radius: 6px;
  padding: 10px 12px;
}
.noc-tk-summary .item .k { font-size: 9px; font-family: var(--mono); color: var(--noc-dim); letter-spacing: .1em; text-transform: uppercase; }
.noc-tk-summary .item .v { font-size: 26px; font-weight: 700; font-family: var(--mono); letter-spacing: -0.02em; line-height: 1; margin-top: 4px; }
.noc-tk-summary .item.open .v { color: var(--noc-warn); }
.noc-tk-summary .item.done .v { color: var(--noc-ok); }
.noc-tk-summary .item.crit .v { color: var(--noc-crit); }

.noc-tk-bars {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  align-items: end;
  height: 90px;
  margin-bottom: 10px;
}
.noc-tk-bar {
  display: flex; flex-direction: column; gap: 1px; justify-content: end;
  height: 100%;
  position: relative;
}
.noc-tk-bar span {
  width: 100%;
  border-radius: 2px 2px 0 0;
  min-height: 2px;
}
.noc-tk-bar .opened { background: var(--noc-warn); opacity: 0.85; }
.noc-tk-bar .closed { background: var(--noc-ok); opacity: 0.7; }
.noc-tk-bar .day {
  position: absolute;
  bottom: -16px; left: 0; right: 0;
  text-align: center;
  font-size: 10px;
  font-family: var(--mono);
  color: var(--noc-dim);
}
.noc-tk-bar.today .day { color: var(--noc-accent); font-weight: 700; }

.noc-tk-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
  min-height: 0;
}
.noc-tk-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  background: var(--noc-bg-2);
  border: 1px solid var(--noc-border);
  border-radius: 6px;
  font-size: 12px;
}
.noc-tk-item .pri {
  width: 4px; height: 28px; border-radius: 2px;
  background: var(--noc-mute);
}
.noc-tk-item.high .pri { background: var(--noc-crit); }
.noc-tk-item.normal .pri { background: var(--noc-warn); }
.noc-tk-item-title {
  font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.noc-tk-item-meta {
  font-size: 10px;
  font-family: var(--mono);
  color: var(--noc-dim);
  margin-top: 2px;
  letter-spacing: .04em;
}
.noc-tk-item-id {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--noc-dim);
  font-weight: 600;
}
.noc-tk-item-progress {
  width: 60px;
  height: 4px;
  background: var(--noc-bg);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}
.noc-tk-item-progress div {
  height: 100%;
  background: var(--noc-ok);
}

/* ---------- Alerts card ---------- */
.noc-alerts {
  display: flex; flex-direction: column;
  min-height: 0;
}
.noc-alerts-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  overflow: hidden;
}
.noc-alert {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 12px;
  padding: 10px 12px;
  background: var(--noc-bg-2);
  border: 1px solid var(--noc-border);
  border-radius: 6px;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.noc-alert.crit {
  border-color: color-mix(in oklch, var(--noc-crit) 50%, var(--noc-border));
  background: color-mix(in oklch, var(--noc-crit) 8%, var(--noc-bg-2));
}
.noc-alert.warn {
  border-color: color-mix(in oklch, var(--noc-warn) 35%, var(--noc-border));
}
.noc-alert.crit::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--noc-crit);
  animation: noc-pulse 1.5s infinite;
}
.noc-alert.warn::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--noc-warn);
}
.noc-alert-sev {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .12em;
  padding: 3px 8px;
  border-radius: 3px;
  text-align: center;
}
.noc-alert-sev.crit { background: color-mix(in oklch, var(--noc-crit) 25%, transparent); color: var(--noc-crit); }
.noc-alert-sev.warn { background: color-mix(in oklch, var(--noc-warn) 22%, transparent); color: var(--noc-warn); }
.noc-alert-sev.info { background: color-mix(in oklch, var(--noc-info) 22%, transparent); color: var(--noc-info); }
.noc-alert-msg { font-size: 13px; font-weight: 600; line-height: 1.3; }
.noc-alert-meta {
  font-size: 10px;
  font-family: var(--mono);
  color: var(--noc-dim);
  margin-top: 3px;
  letter-spacing: .04em;
}
.noc-alert-time {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--noc-dim);
  text-align: right;
}
.noc-alert-time .t { font-size: 13px; color: var(--noc-text); font-weight: 700; }

/* ---------- Power & cooling ---------- */
.noc-power {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.noc-power-flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
}
.noc-power-node {
  background: var(--noc-bg-2);
  border: 1px solid var(--noc-border);
  border-radius: 8px;
  padding: 12px 10px;
  text-align: center;
}
.noc-power-node.ok { border-color: color-mix(in oklch, var(--noc-ok) 35%, var(--noc-border)); }
.noc-power-node .ico {
  font-size: 22px;
  font-family: var(--mono);
  margin-bottom: 4px;
  color: var(--noc-accent);
}
.noc-power-node .lbl { font-size: 10px; font-family: var(--mono); color: var(--noc-dim); letter-spacing: .08em; text-transform: uppercase; }
.noc-power-node .val { font-size: 16px; font-weight: 700; font-family: var(--mono); margin-top: 4px; letter-spacing: -0.02em; }
.noc-power-node .val .u { font-size: 10px; color: var(--noc-dim); margin-left: 2px; }
.noc-power-node .state {
  font-size: 9px;
  font-family: var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-top: 4px;
  font-weight: 700;
}
.noc-power-node .state.ok { color: var(--noc-ok); }
.noc-power-node .state.standby { color: var(--noc-info); }

.noc-flow-arrow {
  width: 26px; height: 2px;
  background: linear-gradient(90deg, var(--noc-accent), transparent 70%, var(--noc-accent));
  background-size: 200% 100%;
  animation: flow-anim 1.4s linear infinite;
  position: relative;
}
.noc-flow-arrow::after {
  content: "▶";
  position: absolute;
  right: -2px; top: -7px;
  color: var(--noc-accent);
  font-size: 10px;
}
@keyframes flow-anim {
  0% { background-position: 200% 0; }
  100% { background-position: 0% 0; }
}

.noc-power-bars {
  display: flex; flex-direction: column; gap: 10px;
  flex: 1;
  min-height: 0;
}
.noc-power-bar {
  display: grid;
  grid-template-columns: 70px 1fr 70px;
  gap: 10px;
  align-items: center;
}
.noc-power-bar .lbl {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--noc-dim);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.noc-power-bar .pb {
  height: 16px;
  background: var(--noc-bg);
  border-radius: 4px;
  border: 1px solid var(--noc-border);
  overflow: hidden;
  position: relative;
}
.noc-power-bar .pb .fill { height: 100%; transition: width .8s; }
.noc-power-bar .pb .marker {
  position: absolute; top: 0; bottom: 0;
  width: 2px;
  background: var(--noc-warn);
}
.noc-power-bar .v { font-family: var(--mono); font-size: 13px; font-weight: 700; text-align: right; }

/* ---------- Ticker ---------- */
.noc-ticker {
  background: var(--noc-panel);
  border: 1px solid var(--noc-border);
  border-radius: 8px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 18px;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 13px;
}
.noc-ticker .tag {
  background: var(--noc-accent);
  color: oklch(0.13 0.01 240);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .14em;
  padding: 4px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}
.noc-ticker-track {
  display: flex;
  gap: 36px;
  white-space: nowrap;
  animation: ticker-roll 80s linear infinite;
  flex-shrink: 0;
}
.noc-ticker-track span {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}
.noc-ticker-track .ti-time { color: var(--noc-dim); font-size: 11px; }
.noc-ticker-track .ti-sev { font-weight: 700; }
.noc-ticker-track .ti-sev.crit { color: var(--noc-crit); }
.noc-ticker-track .ti-sev.warn { color: var(--noc-warn); }
.noc-ticker-track .ti-sev.ok { color: var(--noc-ok); }
.noc-ticker-track .ti-sev.info { color: var(--noc-info); }
@keyframes ticker-roll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* ---------- Donut ---------- */
.noc-donut { display: grid; place-items: center; }

/* ---------- Responsive ---------- */
@media (max-width: 1500px) {
  .noc-kpis { grid-template-columns: repeat(5, 1fr); }
  .noc-kpi-val { font-size: 44px; }
}
@media (max-width: 1200px) {
  .noc-body { grid-template-columns: 1fr 1fr; grid-template-rows: auto auto auto; }
  .noc-rooms { grid-row: auto; grid-column: 1 / -1; }
}
