:root {
  --bg: #f3f5f1;
  --surface: #ffffff;
  --surface-2: #eef1ea;
  --line: #d9dfd4;
  --line-2: #c6cec2;
  --fg: #16211a;
  --muted: #536257;
  --faint: #7a877e;
  --accent: #1d7448;
  --on-accent: #ffffff;
  --accent-soft: #dcefe3;
  --rail: #143826;
  --rail-fg: #e4efe8;
  --rail-muted: #a9c3b4;
  --rail-sel: rgba(255, 255, 255, 0.11);
  --ok: #17794a;
  --ok-bg: #dcf0e3;
  --off-bg: #eceee8;
  --warn: #8f5400;
  --warn-bg: #fbeed2;
  --warn-line: #e0a640;
  --bad: #b3261e;
  --bad-bg: #fbe3e0;
  --c-temp: #16211a;
  --c-z1: #1d7448;
  --c-z2: #b86a00;
  --c-aquec: #d9573f;
  --c-vent: #2f80c4;
  --c-exaus: #7b62c9;
  --c-led: #d6a419;
  --c-valv: #1597a0;
  --ui:
    "Atkinson Hyperlegible Next", "Segoe UI", system-ui, -apple-system, Roboto,
    sans-serif;
  --r: 12px;
  --r-s: 8px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1411;
    --surface: #151d18;
    --surface-2: #1b251f;
    --line: #25322a;
    --line-2: #33443a;
    --fg: #e5ede8;
    --muted: #9db0a4;
    --faint: #7d8f84;
    --accent: #4cc98b;
    --on-accent: #062012;
    --accent-soft: #1d3a2b;
    --rail: #0a1a12;
    --rail-fg: #e4efe8;
    --rail-muted: #94b0a0;
    --rail-sel: rgba(255, 255, 255, 0.08);
    --ok: #5ad79a;
    --ok-bg: rgba(90, 215, 154, 0.14);
    --off-bg: rgba(157, 176, 164, 0.12);
    --warn: #f0b429;
    --warn-bg: rgba(240, 180, 41, 0.14);
    --warn-line: #f0b429;
    --bad: #f0806b;
    --bad-bg: rgba(240, 128, 107, 0.14);
    --c-temp: #e5ede8;
    --c-z1: #5ad79a;
    --c-z2: #f0b429;
    --c-aquec: #f0806b;
    --c-vent: #6cb6f0;
    --c-exaus: #a99af0;
    --c-led: #f0d35a;
    --c-valv: #4fd0d8;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1411;
  --surface: #151d18;
  --surface-2: #1b251f;
  --line: #25322a;
  --line-2: #33443a;
  --fg: #e5ede8;
  --muted: #9db0a4;
  --faint: #7d8f84;
  --accent: #4cc98b;
  --on-accent: #062012;
  --accent-soft: #1d3a2b;
  --rail: #0a1a12;
  --rail-fg: #e4efe8;
  --rail-muted: #94b0a0;
  --rail-sel: rgba(255, 255, 255, 0.08);
  --ok: #5ad79a;
  --ok-bg: rgba(90, 215, 154, 0.14);
  --off-bg: rgba(157, 176, 164, 0.12);
  --warn: #f0b429;
  --warn-bg: rgba(240, 180, 41, 0.14);
  --warn-line: #f0b429;
  --bad: #f0806b;
  --bad-bg: rgba(240, 128, 107, 0.14);
  --c-temp: #e5ede8;
  --c-z1: #5ad79a;
  --c-z2: #f0b429;
  --c-aquec: #f0806b;
  --c-vent: #6cb6f0;
  --c-exaus: #a99af0;
  --c-led: #f0d35a;
  --c-valv: #4fd0d8;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--ui);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
::selection {
  background: var(--accent-soft);
  color: var(--fg);
}
* {
  scrollbar-color: var(--line-2) transparent;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.ico {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.muted {
  color: var(--muted);
}
[hidden] {
  display: none !important;
}

/* Login */
#login {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 28px;
  width: 100%;
  max-width: 360px;
  display: grid;
  gap: 14px;
}
.login-card .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
}
.login-card .brand .ico {
  color: var(--accent);
  width: 24px;
  height: 24px;
}
.login-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.field {
  display: grid;
  gap: 6px;
}
.field label {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}
.field input,
.in input {
  width: 100%;
  padding: 9px 11px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-s);
  min-height: 40px;
}
.field input:focus,
.in input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 0;
  border-color: transparent;
}
.erro,
.login-card .erro {
  color: var(--bad);
  font-size: 0.88rem;
  min-height: 1.3em;
  margin: 0;
}
.login-card h2 {
  margin: 0;
  font-size: 1.05rem;
}
.login-card .aviso {
  color: var(--ok);
  font-size: 0.88rem;
  margin: 0;
}
.login-card .linkbtn {
  justify-self: center;
}

/* Botões e controles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  min-height: 40px;
  border-radius: var(--r-s);
  border: 1px solid transparent;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  transition: filter 0.15s;
}
.btn:hover {
  filter: brightness(1.07);
}
.btn:disabled {
  opacity: 0.55;
  cursor: default;
  filter: none;
}
.btn.ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--line-2);
  font-weight: 600;
}
.btn-s {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  min-height: 32px;
  border-radius: var(--r-s);
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--fg);
  font-size: 0.82rem;
  font-weight: 600;
  transition: background 0.15s;
}
.btn-s:hover {
  background: var(--surface-2);
}
.btn-s.primary {
  background: var(--accent);
  border-color: transparent;
  color: var(--on-accent);
}
.seg {
  display: inline-flex;
  border: 1px solid var(--line-2);
  border-radius: var(--r-s);
  overflow: hidden;
  background: var(--surface);
}
.seg button {
  background: transparent;
  border: 0;
  color: var(--muted);
  padding: 4px 12px;
  min-height: 32px;
  font-size: 0.82rem;
  font-weight: 600;
  transition:
    background 0.15s,
    color 0.15s;
}
.seg button + button {
  border-left: 1px solid var(--line-2);
}
.seg button:hover {
  color: var(--fg);
}
.seg button[aria-pressed="true"] {
  background: var(--accent-soft);
  color: var(--fg);
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.chip::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.chip.on {
  color: var(--ok);
  background: var(--ok-bg);
}
.chip.off {
  color: var(--muted);
  background: var(--off-bg);
}
.chip.warn {
  color: var(--warn);
  background: var(--warn-bg);
}

/* Menu lateral e área principal */
.shell {
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  min-height: 100%;
  background: linear-gradient(90deg, var(--rail) 0 216px, var(--bg) 216px);
}
.rail {
  background: var(--rail);
  color: var(--rail-fg);
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.rail .brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  padding: 4px 10px 18px;
}
.rail .brand .env {
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rail-muted);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  padding: 1px 6px;
}
.rail nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rail nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: 0;
  color: var(--rail-muted);
  padding: 9px 10px;
  border-radius: var(--r-s);
  text-align: left;
  font-weight: 600;
  min-height: 40px;
  transition:
    background 0.15s,
    color 0.15s;
}
.rail nav button:hover {
  color: var(--rail-fg);
  background: var(--rail-sel);
}
.rail nav button[aria-current="page"] {
  color: #fff;
  background: var(--rail-sel);
}
.rail nav button .badge {
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--rail);
  background: var(--warn-line);
  border-radius: 999px;
  padding: 0 7px;
}
.rail .foot {
  margin-top: auto;
  display: grid;
  gap: 10px;
  padding: 10px;
}
.status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--rail-muted);
}
.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #e2735d;
  flex: none;
}
.dot.on {
  background: #6fe0a6;
  box-shadow: 0 0 0 0 rgba(111, 224, 166, 0.5);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(111, 224, 166, 0.45);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(111, 224, 166, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(111, 224, 166, 0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .dot.on {
    animation: none;
  }
}
.rail .foot .btn-s {
  background: transparent;
  color: var(--rail-muted);
  border-color: rgba(255, 255, 255, 0.18);
  justify-content: center;
}
.rail .foot .btn-s:hover {
  color: var(--rail-fg);
  background: var(--rail-sel);
}

main {
  padding: 22px 28px 56px;
  min-width: 0;
}
.top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.top h1 {
  margin: 0;
  font-size: 1.45rem;
  letter-spacing: -0.01em;
}
.top .meta {
  font-size: 0.86rem;
  color: var(--muted);
}
.banner {
  display: flex;
  gap: 10px;
  align-items: center;
  background: var(--bad-bg);
  color: var(--bad);
  border-radius: var(--r-s);
  padding: 10px 14px;
  margin-bottom: 16px;
  font-weight: 600;
  font-size: 0.9rem;
}
.banner.warn {
  background: var(--warn-bg);
  color: var(--warn);
  align-items: flex-start;
}
.banner.warn ul {
  margin: 0;
  padding: 0;
  list-style: none;
  flex: 1;
  display: grid;
  gap: 4px;
}
.banner.warn .btn-s {
  background: transparent;
  color: inherit;
  border-color: currentColor;
  min-height: 28px;
}

@media (max-width: 820px) {
  .shell {
    grid-template-columns: 1fr;
    background: var(--bg);
  }
  .rail nav button .badge {
    font-size: 0;
    width: 8px;
    height: 8px;
    padding: 0;
  }
  .rail {
    position: sticky;
    top: 0;
    height: auto;
    flex-direction: row;
    align-items: center;
    padding: 8px 10px;
    z-index: 5;
    overflow-x: auto;
  }
  .rail .brand {
    padding: 0 8px 0 4px;
  }
  .rail .brand .env {
    display: none;
  }
  .rail nav {
    flex-direction: row;
  }
  .rail nav button {
    white-space: nowrap;
    padding: 8px 10px;
  }
  .rail nav button span.lbl {
    display: none;
  }
  .rail .foot {
    margin: 0 0 0 auto;
    padding: 0;
    display: flex;
    align-items: center;
  }
  .rail .foot .status span:last-child {
    display: none;
  }
  .rail .foot .btn-s span {
    display: none;
  }
  main {
    padding: 18px 16px 48px;
  }
}
@media (max-width: 400px) {
  .rail .brand .nome {
    display: none;
  }
}

/* Cartões */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px 18px;
  min-width: 0;
}
.card-h {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.card-h h2,
.card-h h3 {
  margin: 0;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-h .ico {
  color: var(--muted);
}
.linkbtn {
  background: none;
  border: 0;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 4px 2px;
  min-height: 32px;
}
.linkbtn:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.sys {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}
@media (max-width: 1100px) {
  .sys {
    grid-template-columns: 1fr 1fr;
  }
  .sys .card:first-child {
    grid-column: 1/-1;
  }
}
@media (max-width: 700px) {
  .sys {
    grid-template-columns: 1fr;
  }
}
.sys .card {
  display: grid;
  gap: 12px;
  align-content: start;
}
.val {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}
.val small {
  font-size: 0.95rem;
  color: var(--muted);
  font-weight: 500;
  margin-left: 4px;
  letter-spacing: 0;
}
.sub {
  font-size: 0.84rem;
  color: var(--muted);
}
.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.zl {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}
.zv {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.15;
}
.zv small {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
  margin-left: 3px;
}

.scale {
  margin-top: 8px;
}
.scale .bar {
  position: relative;
  height: 8px;
  border-radius: 4px;
  background: var(--off-bg);
}
.scale .rng {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 4px;
  background: var(--accent-soft);
}
.scale .band {
  position: absolute;
  top: 0;
  bottom: 0;
  background: var(--ok-bg);
  border-left: 1px dashed var(--ok);
  border-right: 1px dashed var(--ok);
}
.scale .pt {
  position: absolute;
  top: -4px;
  width: 4px;
  height: 16px;
  border-radius: 2px;
  background: var(--fg);
  transform: translateX(-2px);
}
.scale .lbl {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 6px;
}

/* Linhas de atuador */
.acts {
  display: grid;
  border-top: 1px solid var(--line);
}
.act {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.act .nm {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.92rem;
}
.act .sw {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex: none;
}
.act .why {
  grid-column: 1/-1;
  font-size: 0.82rem;
  color: var(--muted);
}
.act .why b {
  color: var(--fg);
  font-weight: 600;
}
.act .ctl {
  grid-column: 1/-1;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.act.manual {
  background: linear-gradient(90deg, var(--warn-bg), transparent 70%);
  margin: 0 -10px;
  padding-inline: 10px;
  border-radius: var(--r-s);
}
.confirm {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--warn);
  font-weight: 600;
}

/* Gráficos */
.chartcard {
  margin-bottom: 14px;
}
.legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--muted);
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend i {
  width: 14px;
  height: 3px;
  border-radius: 2px;
  background: currentColor;
}
.legend i.dash {
  background: repeating-linear-gradient(
    90deg,
    currentColor 0 5px,
    transparent 5px 8px
  );
}
.legend i.box {
  height: 10px;
  width: 10px;
  border-radius: 3px;
}
.chartwrap {
  position: relative;
}
svg.ch {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}
svg.ch text {
  fill: var(--muted);
  font-size: 12px;
  font-family: var(--ui);
}
.tip {
  position: absolute;
  pointer-events: none;
  background: var(--fg);
  color: var(--bg);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 8px;
  border-radius: 6px;
  white-space: nowrap;
  transform: translate(-50%, -115%);
  box-shadow: 0 4px 14px -6px rgba(0, 0, 0, 0.4);
}
.empty {
  padding: 28px 10px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}
.skel {
  height: 180px;
  border-radius: var(--r-s);
  background: linear-gradient(
    90deg,
    var(--surface-2),
    var(--off-bg),
    var(--surface-2)
  );
  background-size: 200% 100%;
  animation: sk 1.4s infinite linear;
}
@keyframes sk {
  to {
    background-position: -200% 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .skel {
    animation: none;
  }
}

/* Páginas de clima, irrigação e iluminação */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 14px;
  align-items: start;
}
@media (max-width: 1100px) {
  .split {
    grid-template-columns: 1fr;
  }
}
.stack {
  display: grid;
  gap: 14px;
  align-content: start;
}
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
legend {
  font-weight: 700;
  font-size: 0.92rem;
  padding: 0;
  margin-bottom: 8px;
}
.form {
  display: grid;
  gap: 18px;
}
.rowf {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.rowf.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 560px) {
  .rowf.four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.in {
  display: grid;
  gap: 4px;
}
.in label {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
}
.in .u {
  position: relative;
}
.in .u input {
  padding-right: 46px;
}
.in .u span {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.78rem;
  color: var(--faint);
  pointer-events: none;
}
.hint {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 2px 0 0;
}
.check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 0.88rem;
  line-height: 1.4;
  cursor: pointer;
}
.check input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--accent);
  flex: none;
}
.savebar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.savebar .msg {
  font-size: 0.85rem;
  color: var(--muted);
}
.savebar .msg.ok {
  color: var(--ok);
}
.savebar .msg.err {
  color: var(--bad);
}
.cfgmeta {
  font-size: 0.78rem;
  color: var(--muted);
}

/* Registro de eventos */
.evtools {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.evcount {
  font-size: 0.82rem;
  color: var(--muted);
}
.tblwrap {
  overflow: auto;
  max-height: 560px;
  margin: 4px -18px -16px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 var(--r) var(--r);
}
.tbl {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9rem;
  table-layout: fixed;
  min-width: 640px;
}
.tbl col.c-h {
  width: 118px;
}
.tbl col.c-a {
  width: 190px;
}
.tbl col.c-d {
  width: 110px;
}
.tbl col.c-o {
  width: 132px;
}
.tbl thead th {
  text-align: left;
  font-size: 0.76rem;
  letter-spacing: 0.03em;
  color: var(--muted);
  font-weight: 700;
  padding: 9px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line-2);
  position: sticky;
  top: 0;
  z-index: 2;
}
.tbl thead th.r,
.tbl td.r {
  text-align: right;
}
.tbl tr.day th {
  position: sticky;
  top: 37px;
  z-index: 1;
  text-align: left;
  background: var(--surface);
  padding: 14px 12px 6px 18px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--fg);
  border-bottom: 1px solid var(--line);
}
.tbl tr.day th span {
  color: var(--muted);
  font-weight: 500;
  margin-left: 6px;
}
.tbl td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tbl td:first-child,
.tbl tr.day th:first-child,
.tbl thead th:first-child {
  padding-left: 18px;
}
.tbl thead th:last-child {
  padding-right: 18px;
}
.tbl td:last-child {
  padding-right: 18px;
}
.tbl tbody tr:not(.day):hover td {
  background: var(--surface-2);
}
.tbl td.h {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.tbl td.a .nm {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}
.tbl td.a .sw {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex: none;
}
.tbl td.d {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.tbl td.w {
  white-space: normal;
}
.tbl tr.alert td {
  background: var(--bad-bg);
}
.tbl tr.alert td.a .nm {
  color: var(--bad);
}
.tbl tr.sub td {
  background: var(--surface-2);
  font-size: 0.85rem;
  padding-block: 6px;
}
.tbl tr.sub td.a {
  padding-left: 36px;
  color: var(--muted);
}
.tbl tr.sub:hover td {
  background: var(--off-bg);
}
.expand {
  background: none;
  border: 0;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 2px 4px;
  margin-left: 6px;
  min-height: 28px;
}
.expand:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.tag {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--off-bg);
  color: var(--muted);
}
.tag.manual {
  background: var(--warn-bg);
  color: var(--warn);
}
.tag.seg {
  background: var(--bad-bg);
  color: var(--bad);
}
.tag.cfg {
  background: var(--accent-soft);
  color: var(--fg);
}
.live-run {
  color: var(--ok);
  font-weight: 700;
}
.evlist {
  display: grid;
}
.evlist .e {
  display: grid;
  grid-template-columns: 7em 10px minmax(0, 1fr) auto;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
  align-items: center;
}
.evlist .e:last-child {
  border-bottom: 0;
}
.evlist .e .t {
  color: var(--muted);
  white-space: nowrap;
}
.evlist .e .sw {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}
.evlist .e .x {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.evlist .e .x span {
  color: var(--muted);
}
select {
  padding: 5px 10px;
  min-height: 32px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-s);
  font-size: 0.85rem;
}

/* Conta */
.conta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
  max-width: 1040px;
}
@media (max-width: 900px) {
  .conta {
    grid-template-columns: 1fr;
  }
}
