@font-face { font-family: Inter; src: url(/fonts/inter-400.woff) format("woff"); font-weight: 400; }
@font-face { font-family: Inter; src: url(/fonts/inter-500.woff) format("woff"); font-weight: 500; }
@font-face { font-family: Inter; src: url(/fonts/inter-600.woff) format("woff"); font-weight: 600; }

:root {
  --bg: #f4f6f8; --card: #fff; --line: #dde2e8; --text: #1b2430; --muted: #66727f;
  --pri: #1f6feb; --pri-h: #1858c4; --ok: #1a7f37; --bad: #c62828; --radius: 8px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.45 Inter, system-ui, sans-serif; background: var(--bg); color: var(--text); }
[hidden] { display: none !important; }
h1 { margin: 0 0 4px; font-size: 22px; }
h2 { margin: 0; font-size: 18px; }
h3 { margin: 18px 0 8px; font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.muted { color: var(--muted); }
.err { color: var(--bad); min-height: 1em; margin: 8px 0; }
.ok { color: var(--ok); }
.pad { padding: 16px; margin: 0; }
.spacer { flex: 1; }

.center { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card.flush { padding: 0; overflow-x: auto; }
.narrow { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 10px; }

.top { display: flex; align-items: center; gap: 12px; padding: 10px 20px; background: #0f1a2a; color: #fff; }
.top .muted { color: #a9b4c2; }
.top .ghost { color: #dfe6ee; border-color: #3a4a60; }
main { max-width: 1600px; margin: 0 auto; padding: 20px; }
.bar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.bar button, td button { white-space: nowrap; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 16px; }
.stack { display: flex; flex-direction: column; gap: 10px; min-width: 300px; }

label { display: flex; flex-direction: column; gap: 4px; font-weight: 500; margin-bottom: 6px; }
label.check { flex-direction: row; align-items: center; gap: 6px; font-weight: 400; margin: 0; }
input, select { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: inherit; }
input:focus, select:focus { outline: 2px solid #9cc0f7; border-color: var(--pri); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset:disabled { opacity: .5; }

button { font: inherit; font-weight: 500; padding: 8px 14px; border-radius: 6px; border: 1px solid var(--line); background: #fff; color: var(--text); cursor: pointer; }
button:hover { border-color: #b9c2cc; }
button:disabled { opacity: .6; cursor: default; }
button.primary { background: var(--pri); border-color: var(--pri); color: #fff; }
button.primary:hover { background: var(--pri-h); }
button.danger { color: var(--bad); border-color: #f0c4c4; }
button.ghost { background: transparent; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 12px; text-transform: uppercase; color: var(--muted); font-weight: 600; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: #f7f9fb; }
tbody tr:last-child td { border-bottom: 0; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.pill.on { background: #dcf3e2; color: var(--ok); }
.pill.off { background: #eceff2; color: var(--muted); }

dialog { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
dialog::backdrop { background: rgba(15, 26, 42, .45); }

@media (max-width: 640px) {
  .top { flex-wrap: wrap; }
  main { padding: 12px; }
}

.filters { margin: 0 0 12px; }
.filters input[type=search] { min-width: 260px; }
.wide { min-width: min(560px, 90vw); }
.warn { background: #fff4d6; border: 1px solid #f0d58a; color: #6b5200; padding: 8px 10px; border-radius: 6px; margin: 0; }
textarea { font: 13px/1.5 ui-monospace, Consolas, monospace; padding: 10px; border: 1px solid var(--line); border-radius: 6px; resize: vertical; width: 100%; }
small { font-weight: 400; }
.pill.online { background: #dcf3e2; color: var(--ok); }
.pill.bad { background: #fde2e2; color: var(--bad); }
.pill.warn2 { background: #fff1cc; color: #8a6400; }
td .act { padding: 4px 10px; font-size: 13px; }
td.num { font-variant-numeric: tabular-nums; }
tr.dim td { color: var(--muted); }
.warnt { color: #8a6400; font-weight: 500; }

label.inline { flex-direction: row; align-items: center; gap: 6px; margin: 0; }
.detail { margin-top: 16px; padding: 16px 0 0; }
.detail .bar { padding: 0 16px; }
.flat { margin: 0; text-transform: none; letter-spacing: 0; color: var(--text); font-size: 16px; }
.legend { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-left: 8px; }
.sw.act, .seg.act { background: #2da44e; }
.sw.idl, .seg.idl { background: #f2c14e; }
.sw.off { background: #e6e9ed; }
.tl, .daybar { position: relative; height: 14px; background: #e6e9ed; border-radius: 4px; overflow: hidden; min-width: 220px; }
.daybar { height: 22px; margin: 4px 16px 2px; }
.seg { position: absolute; top: 0; bottom: 0; }
.hours { display: flex; justify-content: space-between; margin: 0 16px 12px; font-size: 11px; color: var(--muted); }
.tlcol { width: 35%; }
tr.sel td { background: #eef4ff; }
.pct { font-weight: 600; }
td .pill { margin-left: 6px; }
td .pill:first-child { margin-left: 0; }

#t-peers td { padding: 8px 12px; }
#t-peers td.name { white-space: normal; min-width: 160px; max-width: 280px; }
#t-peers td.acts { text-align: right; }
#v-peers th { padding: 10px 12px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tab { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; padding: 8px 14px; color: var(--muted); }
.tab.on { color: var(--pri); border-bottom-color: var(--pri); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.chip b { font-size: 18px; }
.chip.sel { outline: 2px solid var(--pri); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.b-now { background: #1a7f37; } .b-today { background: #2da44e; } .b-week { background: #d4a72c; }
.b-month { background: #e8730c; } .b-old { background: #cf222e; } .b-none { background: #8c959f; }
.idle { display: inline-block; padding: 2px 10px; border-radius: 99px; font-weight: 600; font-size: 13px; color: #fff; }
.small { font-size: 12px; margin-top: 8px; }
.pill.enabled { background: #e7f3ff; color: #0b5cad; }

.print-sub { display: none; }
.pspace { display: none; }
@media print {
  /* margem 0: o Chrome não tem onde imprimir data/título/URL/nº de página */
  @page { size: A4 landscape; margin: 0; }
  html, body { margin: 0; }
  #v-app { padding: 10mm 12mm 0; }
  .pspace { display: table-row; }
  .pspace td { height: 8mm; padding: 0; border: 0 !important; background: #fff; }
  .card.flush { border: 0; }
  .card.flush table { border: 0; }
  thead tr:not(.pspace) th { border-top: 1px solid #ccc; border-bottom: 1px solid #ccc; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { background: #fff; font-size: 11px; }
  .top, .noprint, #v-report .filters, #rep-period .row, button, dialog { display: none !important; }
  main { max-width: none; padding: 0; }
  .print-sub { display: block; margin-top: 2px; }
  .card { border: 1px solid #ccc; }
  .chips { gap: 6px; }
  .chip { padding: 4px 8px; }
  .chip.sel { outline: 2px solid #333; }
  th, td { padding: 5px 8px; }
  tr { break-inside: avoid; }
  thead { display: table-header-group; }
  tbody tr { cursor: default; }
  tr.sel td { background: none; }
}

#nav { display: flex; gap: 4px; margin-left: 12px; }
#nav a { color: #c9d3df; text-decoration: none; padding: 6px 10px; border-radius: 6px; }
#nav a.on, #nav a:hover { background: #1f2d42; color: #fff; }
td .sub { display: block; font-size: 12px; color: var(--muted); }
#t-aud td { white-space: normal; vertical-align: top; }
#t-aud td.when { white-space: nowrap; }
.kv { font-size: 12px; color: var(--muted); }
.kv b { color: var(--text); font-weight: 500; }

legend { font-weight: 500; margin-bottom: 6px; padding: 0; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 14px; max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; padding: 10px; }
.checks label { flex-direction: row; align-items: center; gap: 6px; font-weight: 400; margin: 0; }
#t-users td { white-space: normal; }
