/* Lagoo UI — design system compacto: tema escuro/claro, janela fixa, rolagem só dentro dos painéis */

:root {
  --bg: #0a0c10;
  --bg2: #0e1218;
  --panel: #11151c;
  --panel2: #161b24;
  --hover: #1a2029;
  --line: #222a36;
  --line2: #2d3746;
  --text: #e7ebf2;
  --text2: #a2adbe;
  --text3: #6c7889;
  --brand: #22c55e;
  --brand-soft: rgba(34, 197, 94, 0.14);
  --info: #38bdf8;
  --warn: #f59e0b;
  --err: #f43f5e;
  --violet: #a78bfa;
  --ok: #22c55e;
  --r: 10px;
  --rs: 7px;
  --rail: 52px;
  --bar: 46px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --shadow: 0 10px 32px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f3f5f9;
  --bg2: #ebeff5;
  --panel: #ffffff;
  --panel2: #f7f9fc;
  --hover: #eef2f8;
  --line: #e0e6ef;
  --line2: #cdd6e3;
  --text: #0f172a;
  --text2: #475569;
  --text3: #8090a5;
  --brand: #16a34a;
  --brand-soft: rgba(22, 163, 74, 0.12);
  --shadow: 0 10px 32px rgba(15, 23, 42, 0.14);
  color-scheme: light;
}

* {
  box-sizing: border-box;
  margin: 0;
}
html,
body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font: 13px/1.35 var(--font);
  -webkit-font-smoothing: antialiased;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  background: none;
  border: 0;
}
code,
.mono {
  font-family: var(--mono);
  font-size: 0.92em;
}
::selection {
  background: var(--brand-soft);
}
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-thumb {
  background: var(--line2);
  border-radius: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}

.i {
  width: 16px;
  height: 16px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -3px;
}
.tnum {
  font-variant-numeric: tabular-nums;
}
.mut {
  color: var(--text3);
}
.sm {
  font-size: 12px;
}
.xs {
  font-size: 11px;
}
.grow {
  flex: 1;
}
.trunc {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.ok-t {
  color: var(--ok);
}
.warn-t {
  color: var(--warn);
}
.err-t {
  color: var(--err);
}
[hidden] {
  display: none !important;
}

/* ------------------------------------------------------------ tooltips (CSS puro) */
[data-tip] {
  position: relative;
}
[data-tip]:hover::after,
[data-tip]:focus-visible::after {
  content: attr(data-tip);
  position: absolute;
  z-index: 60;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  max-width: 280px;
  pointer-events: none;
  box-shadow: var(--shadow);
}
[data-tip][data-tip-pos="right"]:hover::after {
  bottom: auto;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
}
[data-tip][data-tip-pos="top"]:hover::after {
  bottom: calc(100% + 6px);
}

/* ------------------------------------------------------------ shell */
.app {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  height: 100dvh;
  overflow: hidden;
}
.rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 0;
  background: var(--bg2);
  border-right: 1px solid var(--line);
  z-index: 40;
}
.rail > a,
.rail > button {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--text2);
  transition: background 0.12s, color 0.12s;
}
.rail > a:hover,
.rail > button:hover {
  background: var(--hover);
  color: var(--text);
}
.rail > a.active {
  background: var(--brand-soft);
  color: var(--brand);
}
.rail .brand {
  color: var(--brand);
  margin-bottom: 6px;
}
.rail .brand .i {
  width: 22px;
  height: 22px;
  stroke-width: 2.2;
}
.rail .nb {
  position: absolute;
  top: 1px;
  right: 0;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--err);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.rail .nb.warn {
  background: var(--warn);
  color: #1c1300;
}
.main {
  display: grid;
  grid-template-rows: var(--bar) minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
}
.bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.bar::-webkit-scrollbar {
  display: none;
}
.bar .ttl {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-right: 4px;
  white-space: nowrap;
}
.view {
  min-height: 0;
  padding: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.boot {
  flex: 1;
  display: grid;
  place-items: center;
}
.spin {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2.5px solid var(--line2);
  border-top-color: var(--brand);
  animation: sp 0.7s linear infinite;
}
@keyframes sp {
  to {
    transform: rotate(360deg);
  }
}

/* ------------------------------------------------------------ controles */
.ib,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 30px;
  border-radius: var(--rs);
  color: var(--text2);
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  white-space: nowrap;
}
.ib {
  width: 30px;
  flex: none;
}
.ib:hover,
.btn:hover {
  background: var(--hover);
  color: var(--text);
}
.ib.on,
.btn.on {
  background: var(--brand-soft);
  color: var(--brand);
}
.ib:disabled,
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.ib.sm {
  width: 24px;
  height: 24px;
}
.ib.sm .i {
  width: 14px;
  height: 14px;
}
.btn {
  padding: 0 12px;
  border: 1px solid var(--line2);
  font-weight: 600;
  font-size: 12px;
}
.btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #04130a;
}
.btn.primary:hover {
  filter: brightness(1.1);
  color: #04130a;
  background: var(--brand);
}
.btn.danger {
  color: var(--err);
  border-color: rgba(244, 63, 94, 0.4);
}
.btn.danger:hover {
  background: rgba(244, 63, 94, 0.12);
  color: var(--err);
}
.btn.block {
  width: 100%;
  height: 38px;
}
.seg {
  display: inline-flex;
  padding: 2px;
  gap: 2px;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 9px;
  flex: none;
}
.seg button {
  height: 26px;
  min-width: 28px;
  padding: 0 8px;
  border-radius: 7px;
  color: var(--text2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.seg button:hover {
  color: var(--text);
}
.seg button.on {
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 0 0 1px var(--line2);
}
.seg button .n {
  font-size: 10px;
  color: var(--text3);
  font-weight: 700;
}
.search {
  position: relative;
  flex: 0 1 220px;
  min-width: 110px;
}
.search .i {
  position: absolute;
  left: 9px;
  top: 8px;
  color: var(--text3);
  width: 14px;
  height: 14px;
  pointer-events: none;
}
input[type="search"],
input[type="text"],
input[type="number"],
input[type="time"],
input[type="date"],
input[type="password"],
textarea,
.input {
  width: 100%;
  height: 30px;
  padding: 0 10px;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: var(--rs);
  outline: none;
  transition: border-color 0.12s;
}
.search input {
  padding-left: 28px;
}
input:focus,
textarea:focus {
  border-color: var(--brand);
}
textarea {
  height: auto;
  padding: 8px 10px;
  resize: vertical;
}
input[type="checkbox"] {
  accent-color: var(--brand);
}

/* toggle */
.tg {
  --w: 30px;
  position: relative;
  display: inline-block;
  width: var(--w);
  height: 18px;
  border-radius: 9px;
  background: var(--line2);
  vertical-align: middle;
  flex: none;
  transition: background 0.15s;
}
.tg::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s;
}
label.tgl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
label.tgl input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
label.tgl input:checked + .tg {
  background: var(--brand);
}
label.tgl input:checked + .tg::after {
  transform: translateX(12px);
}

/* chips / dots / meters */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  background: var(--panel2);
  border: 1px solid var(--line);
  color: var(--text2);
  white-space: nowrap;
}
.chip .i {
  width: 12px;
  height: 12px;
}
.chip.ok {
  color: var(--ok);
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.25);
}
.chip.warn {
  color: var(--warn);
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.28);
}
.chip.err {
  color: var(--err);
  background: rgba(244, 63, 94, 0.1);
  border-color: rgba(244, 63, 94, 0.28);
}
.chip.info {
  color: var(--info);
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.26);
}
.chip.brand {
  color: var(--brand);
  background: var(--brand-soft);
}
.chips {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text3);
  margin-right: 6px;
  flex: none;
  vertical-align: 1px;
}
.dot.ok {
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.16);
}
.dot.warn {
  background: var(--warn);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.16);
}
.dot.err {
  background: var(--err);
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.18);
}
.dot.info {
  background: var(--info);
}
.dot.pulse {
  animation: pl 1.6s ease-in-out infinite;
}
@keyframes pl {
  50% {
    opacity: 0.45;
  }
}
.meter {
  display: inline-block;
  width: 100%;
  min-width: 36px;
  height: 5px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
  vertical-align: middle;
}
.meter i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--ok);
}
.meter.warn i {
  background: var(--warn);
}
.meter.err i {
  background: var(--err);
}
.meter.mute i {
  background: var(--text3);
}

/* ------------------------------------------------------------ painéis */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}
.panel > .hd {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  height: 36px;
  flex: none;
  border-bottom: 1px solid var(--line);
  color: var(--text2);
}
.panel > .hd b {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.01em;
}
.panel > .hd .i {
  color: var(--text3);
}
.panel > .bd {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.row:last-child {
  border-bottom: 0;
}
a.row:hover,
.row.hover:hover {
  background: var(--hover);
}
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text3);
  padding: 24px 12px;
  text-align: center;
  height: 100%;
  min-height: 90px;
}
.empty .i {
  width: 22px;
  height: 22px;
}
.empty.ok {
  color: var(--ok);
}
.skel {
  height: 14px;
  margin: 10px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--line) 25%, var(--hover) 50%, var(--line) 75%);
  background-size: 200% 100%;
  animation: sh 1.2s infinite;
}
.skel.w60 {
  width: 60%;
  margin: 2px 0;
  display: inline-block;
}
.skel.w80 {
  width: 80%;
  margin: 2px 0;
  display: inline-block;
}
@keyframes sh {
  to {
    background-position: -200% 0;
  }
}

/* ------------------------------------------------------------ painel (home) */
.dash {
  flex: 1;
  min-height: 0;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: auto minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas:
    "k k k k k k k k k k k k"
    "a a a a d d d d d j j j"
    "a a a a d d d d d h h h";
}
.kpis {
  grid-area: k;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}
.d-att {
  grid-area: a;
  display: flex;
  min-height: 0;
}
.d-ads {
  grid-area: d;
  display: flex;
  min-height: 0;
}
.d-jobs {
  grid-area: j;
  display: flex;
  min-height: 0;
}
.d-host {
  grid-area: h;
  display: flex;
  min-height: 0;
}
.d-att .panel,
.d-ads .panel,
.d-jobs .panel,
.d-host .panel {
  flex: 1;
}
.kpi {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 12px 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  min-width: 0;
  transition: border-color 0.12s, transform 0.12s;
}
.kpi:hover {
  border-color: var(--line2);
  transform: translateY(-1px);
}
.kpi .kl {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
}
.kpi .kv {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.kpi .kv small {
  font-size: 12px;
  font-weight: 600;
  color: var(--text3);
}
.kpi .ks {
  font-size: 11px;
  color: var(--text3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kpi .meter {
  margin-top: 4px;
}
.kpi.err {
  border-color: rgba(244, 63, 94, 0.45);
}
.kpi.err .kv {
  color: var(--err);
}
.kpi.warn .kv {
  color: var(--warn);
}
.kpi.ok .kv {
  color: var(--ok);
}
.kpi.info .kv {
  color: var(--info);
}
.att {
  gap: 9px;
}
.att .ai {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--panel2);
  color: var(--text2);
  flex: none;
}
.att.err .ai,
.ai.err {
  background: rgba(244, 63, 94, 0.14);
  color: var(--err);
}
.att.warn .ai {
  background: rgba(245, 158, 11, 0.14);
  color: var(--warn);
}
.att .tx {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.att .tx small {
  color: var(--text3);
  font-size: 11px;
}
.ads-mini {
  padding: 8px 10px 4px;
  display: grid;
  gap: 6px;
}
.ads-mini .chart svg {
  width: 100%;
  height: 60px;
  display: block;
}
.axis {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text3);
  margin-top: 2px;
}
.bars .b {
  fill: var(--brand);
  opacity: 0.85;
}
.bars .b.now {
  fill: var(--info);
}
.bars .b.err {
  fill: var(--err);
}
.bars .b.warn {
  fill: var(--warn);
}
.bars .b.mute {
  fill: var(--line2);
}
.lines {
  width: 100%;
  height: 60px;
  display: block;
}
.lines .ln {
  fill: none;
  stroke-width: 1.8;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.lines .ln.real {
  stroke: var(--brand);
}
.lines .ln.exp {
  stroke: var(--text3);
  stroke-dasharray: 4 4;
  stroke-width: 1.4;
}
.lines .mk {
  stroke: var(--info);
  stroke-width: 1;
  stroke-dasharray: 2 3;
  vector-effect: non-scaling-stroke;
}
.spark polyline {
  fill: none;
  stroke: var(--brand);
  stroke-width: 1.6;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.cmp,
.cmp-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px 64px 56px;
  gap: 8px;
  align-items: center;
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
}
.cmp-head {
  padding-top: 3px;
  padding-bottom: 3px;
  background: var(--panel2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 10px;
}
.cmp > span:nth-child(n + 3),
.cmp-head > span:nth-child(n + 3) {
  text-align: right;
}
.metrics {
  padding: 8px 10px 4px;
  display: grid;
  gap: 7px;
}
.mrow {
  display: grid;
  grid-template-columns: 44px 1fr 46px;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--text2);
}
.mrow .tnum {
  text-align: right;
}
.svc-line {
  padding: 6px 10px 8px;
  font-size: 12px;
  color: var(--text2);
}
.run {
  padding: 5px 10px;
}
.run .trunc {
  flex: 1;
  font-size: 12px;
}

/* ------------------------------------------------------------ drawer / modal / toast */
.scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 70;
  animation: fd 0.15s;
}
@keyframes fd {
  from {
    opacity: 0;
  }
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(460px, 100vw);
  z-index: 80;
  background: var(--panel);
  border-left: 1px solid var(--line2);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.18s ease-out;
}
.drawer.open {
  transform: none;
}
.drawer > header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.drawer > header b {
  font-size: 14px;
}
.drawer > .db {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.sec {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sec > .st {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text3);
  display: flex;
  align-items: center;
  gap: 6px;
}
.kv2 {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  font-size: 12px;
}
.kv2 > span:nth-child(odd) {
  color: var(--text3);
}
.kv2 .mono {
  overflow-wrap: anywhere;
}
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.5);
  display: grid;
  place-items: center;
  padding: 16px;
}
.modal {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line2);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.modal header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.modal .mb {
  padding: 14px 12px;
  color: var(--text2);
}
.modal footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
}
.toasts {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--text);
  color: var(--bg);
  padding: 8px 14px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 12px;
  box-shadow: var(--shadow);
  animation: up 0.2s;
}
.toast.err {
  background: var(--err);
  color: #fff;
}
.toast button {
  color: var(--brand);
  font-weight: 800;
  font-size: 12px;
}
.toast.err button {
  color: #fff;
  text-decoration: underline;
}
@keyframes up {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
}

/* ------------------------------------------------------------ tabelas */
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.tbl th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel2);
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text3);
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.tbl th.sort {
  cursor: pointer;
}
.tbl th.sort:hover {
  color: var(--text);
}
.tbl td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.tbl tr:last-child td {
  border-bottom: 0;
}
.tbl tbody tr.hover:hover {
  background: var(--hover);
  cursor: pointer;
}
.tbl td.r,
.tbl th.r {
  text-align: right;
  white-space: nowrap;
}
.tbl td.nw {
  white-space: nowrap;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tbl td.acts {
  white-space: nowrap;
  text-align: right;
}
.tbl td.acts .ib {
  opacity: 0.55;
}
.tbl tr:hover td.acts .ib {
  opacity: 1;
}

/* ------------------------------------------------------------ kanban / projetos */
.split {
  flex: 1;
  min-height: 0;
  display: grid;
  gap: 10px;
}
.kb {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(232px, 1fr);
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
}
.kcol {
  --c: var(--text3);
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-top: 3px solid var(--c);
  border-radius: 12px;
  transition: border-color 0.12s, background 0.12s;
}
.kcol.over {
  background: var(--brand-soft);
  border-color: var(--brand);
}
.kcol > .kh {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  flex: none;
}
.kcol > .kh .i {
  color: var(--c);
}
.kcol > .kh b {
  font-size: 12px;
}
.kcol > .kc {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pc {
  --c: var(--text3);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px 10px 8px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--c);
  border-radius: 10px;
  cursor: grab;
  transition: border-color 0.12s, box-shadow 0.12s, transform 0.12s;
}
.pc:hover {
  border-color: var(--line2);
  border-left-color: var(--c);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}
.pc.drag {
  opacity: 0.4;
  transform: scale(0.98);
}
.pc.off {
  opacity: 0.6;
}
.pc-top {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.pc-top b {
  font-size: 13px;
  flex: 1;
}
.pc-sum {
  font-size: 11.5px;
  color: var(--text3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pc-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--text3);
  font-size: 11px;
}
.pc-meta .i {
  width: 13px;
  height: 13px;
}
.pc-meta .m {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 600;
}
.pc-acts {
  position: absolute;
  top: 4px;
  right: 4px;
  display: none;
  gap: 2px;
  background: var(--panel);
  border-radius: 8px;
  padding: 1px;
}
.pc:hover .pc-acts {
  display: flex;
}
.pc-top .dot {
  margin-right: 0;
}
.pc.sel {
  border-color: var(--brand);
  border-left-color: var(--c);
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.tags .chip {
  cursor: default;
}
.tags .chip button {
  display: inline-grid;
  place-items: center;
  color: var(--text3);
}
.tags .chip button:hover {
  color: var(--err);
}
.pick {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.pick button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 9px;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--text2);
  font-size: 12px;
  font-weight: 600;
}
.pick button:hover {
  background: var(--hover);
  color: var(--text);
}
.pick button.on {
  border-color: var(--c, var(--brand));
  color: var(--c, var(--brand));
  background: var(--brand-soft);
}
.mapwrap {
  flex: 1;
  min-height: 0;
  position: relative;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.mapwrap #graph {
  position: absolute;
  inset: 0;
}
.mapwrap .tools {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 3;
}
.mapwrap .tools .ib {
  background: var(--panel);
  border: 1px solid var(--line);
}
.mapwrap .legend {
  position: absolute;
  left: 8px;
  bottom: 8px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  z-index: 3;
}
.mapwrap .over {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--text3);
  z-index: 2;
}

/* ------------------------------------------------------------ rotinas / alertas / ads */
.two {
  flex: 1;
  min-height: 0;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) 340px;
}
.two.eq {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.ticks {
  display: inline-flex;
  gap: 2px;
  align-items: flex-end;
  height: 14px;
}
.ticks i {
  width: 4px;
  height: 100%;
  border-radius: 1px;
  background: var(--line2);
}
.ticks i.ok {
  background: var(--ok);
}
.ticks i.err {
  background: var(--err);
}
.ticks i.skip {
  background: var(--text3);
  height: 50%;
}
.cat {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: var(--panel2);
  color: var(--text2);
  flex: none;
}
.cat.ads {
  color: var(--warn);
}
.cat.shield {
  color: var(--info);
}
.cat.backup {
  color: var(--violet);
}
.nrow {
  display: flex;
  gap: 10px;
  padding: 9px 10px 9px 12px;
  border-bottom: 1px solid var(--line);
  border-left: 3px solid transparent;
  cursor: pointer;
  min-width: 0;
}
.nrow:hover {
  background: var(--hover);
}
.nrow.unread {
  border-left-color: var(--info);
  background: rgba(56, 189, 248, 0.05);
}
.nrow.sel {
  background: var(--hover);
}
.nrow .sv {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: none;
  background: var(--panel2);
  color: var(--text2);
}
.nrow .sv.err {
  background: rgba(244, 63, 94, 0.14);
  color: var(--err);
}
.nrow .sv.warn {
  background: rgba(245, 158, 11, 0.14);
  color: var(--warn);
}
.nrow .sv.success {
  background: rgba(34, 197, 94, 0.14);
  color: var(--ok);
}
.nrow .tx {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.nrow .tx b {
  font-size: 12.5px;
}
.nrow.unread .tx b {
  color: var(--text);
}
.nrow:not(.unread) .tx b {
  font-weight: 600;
  color: var(--text2);
}
.nrow .tx small {
  color: var(--text3);
  font-size: 11.5px;
}
.nrow .ra {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex: none;
}
.nrow .acts {
  display: none;
  gap: 0;
}
.nrow:hover .acts {
  display: flex;
}
.nrow:hover .ra .mut {
  display: none;
}
.prose {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text2);
}
.prose h2,
.prose h3,
.prose h4 {
  color: var(--text);
  margin: 12px 0 4px;
  font-size: 13px;
}
.prose h2 {
  font-size: 14px;
}
.prose p,
.prose ul {
  margin: 4px 0;
}
.prose ul {
  padding-left: 18px;
}
.prose code {
  background: var(--panel2);
  padding: 1px 4px;
  border-radius: 4px;
}
.prose table {
  margin: 6px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.prose hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 10px 0;
}
pre.log {
  font: 11.5px/1.45 var(--mono);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  overflow: auto;
  max-height: 46vh;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text2);
}
.cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  font-size: 12px;
}
.cal .dw {
  text-align: center;
  color: var(--text3);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 0;
}
.cal button {
  height: 28px;
  border-radius: 7px;
  color: var(--text2);
  font-weight: 600;
}
.cal button:hover {
  background: var(--hover);
}
.cal button.pad {
  visibility: hidden;
}
.cal button.today {
  box-shadow: inset 0 0 0 1px var(--line2);
}
.cal button.in {
  background: var(--brand-soft);
  color: var(--brand);
  border-radius: 0;
}
.cal button.edge {
  background: var(--brand);
  color: #04130a;
  border-radius: 7px;
}
.cal button.past {
  opacity: 0.35;
  cursor: not-allowed;
}
.camps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.camps button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--text3);
  font-weight: 600;
  font-size: 12px;
}
.camps button.on {
  color: var(--text);
  border-color: var(--brand);
  background: var(--brand-soft);
}
.form-grid {
  display: grid;
  gap: 12px;
  padding: 12px;
}
.g2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.acc {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  min-width: 0;
}
.acc-h {
  display: flex;
  align-items: center;
  gap: 8px;
}
.acc-h b {
  flex: 1;
}
.acc .nums {
  display: flex;
  gap: 14px;
  font-size: 11px;
  color: var(--text3);
}
.acc .nums b {
  display: block;
  font-size: 15px;
  color: var(--text);
}
.grid-cards {
  display: grid;
  gap: 10px;
  padding: 10px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  align-content: start;
}
.svc {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  min-width: 0;
}
.svc .trunc {
  flex: 1;
  font-weight: 600;
}
.svc.down {
  border-color: rgba(244, 63, 94, 0.5);
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  min-width: 0;
}
.stack > .panel {
  flex: none;
}
.stack > .panel.fill {
  flex: 1;
}
.chart-lg svg {
  width: 100%;
  height: 92px;
  display: block;
}
.chart-md svg {
  width: 100%;
  height: 60px;
  display: block;
}
.hint {
  padding: 8px 10px;
  color: var(--text3);
  font-size: 11.5px;
}

/* ------------------------------------------------------------ login */
body.auth {
  display: grid;
  place-items: center;
  height: 100dvh;
}
.auth-card {
  width: min(320px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 26px 22px 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.auth-card h1 {
  font-size: 17px;
  letter-spacing: -0.01em;
}
.auth-card form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.auth-logo {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
}
.auth-logo .i {
  width: 24px;
  height: 24px;
}
#code {
  height: 46px;
  text-align: center;
  font-size: 22px;
  letter-spacing: 0.35em;
  font-family: var(--mono);
  font-weight: 700;
}
.trust {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text2);
  cursor: pointer;
  position: relative;
}
.trust input {
  position: absolute;
  opacity: 0;
}
.trust input:checked + .tg {
  background: var(--brand);
}
.trust input:checked + .tg::after {
  transform: translateX(12px);
}
.auth .err {
  color: var(--err);
  font-size: 12px;
  text-align: center;
  min-height: 16px;
}
.qr {
  padding: 8px;
  background: #fff;
  border-radius: 10px;
}

/* ------------------------------------------------------------ responsivo */
@media (max-width: 1100px) {
  .dash {
    grid-template-areas:
      "k k k k k k k k k k k k"
      "a a a a a a d d d d d d"
      "j j j j j j h h h h h h";
    grid-template-rows: auto minmax(0, 1fr) minmax(0, 1fr);
  }
  .kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .two {
    grid-template-columns: minmax(0, 1fr) !important;
    overflow: auto;
    grid-auto-rows: minmax(260px, auto);
  }
}
@media (max-width: 720px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
  }
  .rail {
    grid-row: 2;
    flex-direction: row;
    justify-content: space-around;
    padding: 4px 6px calc(4px + env(safe-area-inset-bottom));
    border-right: 0;
    border-top: 1px solid var(--line);
  }
  .rail .brand,
  .rail .grow,
  #theme-btn {
    display: none;
  }
  .main {
    grid-row: 1;
  }
  .view {
    overflow: auto;
  }
  .dash {
    display: flex;
    flex-direction: column;
    flex: none;
  }
  .dash > div {
    min-height: 220px;
  }
  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .split,
  .two {
    display: flex;
    flex-direction: column;
    flex: none;
  }
  .kb {
    grid-auto-columns: 82vw;
    min-height: 60vh;
  }
  .drawer {
    width: 100vw;
  }
  [data-tip]:hover::after {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
