:root {
  --bg: #0b0e14;
  --panel: #131824;
  --panel-2: #1a2131;
  --line: #263046;
  --text: #e8ecf4;
  --muted: #8b95a9;
  --accent: #e5383b;
  --accent-soft: rgba(229, 56, 59, .14);
  --ok: #22c55e;
  --ok-soft: rgba(34, 197, 94, .14);
  --warn: #f59e0b;
  --warn-soft: rgba(245, 158, 11, .14);
  --bad: #ef4444;
  --bad-soft: rgba(239, 68, 68, .14);
  --info: #3b82f6;
  --info-soft: rgba(59, 130, 246, .14);
  --radius: 10px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-size: 15px; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.boot { padding: 40px; color: var(--muted); }

/* Layout */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; font-weight: 600; font-size: 17px; }
.brand .dot { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; font-size: 14px; color: #fff; }
.side .sec { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 14px 10px 6px; }
.nav { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; text-decoration: none; color: var(--muted); }
.nav:hover { background: var(--panel-2); color: var(--text); }
.nav.on { background: var(--accent-soft); color: var(--text); }
.nav .count { margin-left: auto; background: var(--accent); color: #fff; font-size: 12px; border-radius: 99px; padding: 1px 8px; }
.side .grow { flex: 1; }
.side .who { font-size: 13px; color: var(--muted); padding: 8px 10px; word-break: break-all; }
.main { padding: 26px 30px 60px; min-width: 0; }
.top { display: none; }
h1 { font-size: 22px; margin: 0 0 4px; font-weight: 600; }
.sub { color: var(--muted); margin: 0 0 20px; font-size: 14px; }
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.head .sub { margin: 0; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card .lbl { color: var(--muted); font-size: 13px; }
.card .num { font-size: 28px; font-weight: 600; margin-top: 6px; }
.card.link { cursor: pointer; }
.card.link:hover { border-color: #3a4766; }
.box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.box h2 { font-size: 16px; margin: 0 0 12px; font-weight: 600; }

/* Gráfico por hora */
.bars { display: flex; align-items: flex-end; gap: 4px; height: 140px; padding-top: 8px; }
.bars .b { flex: 1; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .85; position: relative; }
.bars .b:hover { opacity: 1; }
.hours { display: flex; gap: 4px; margin-top: 6px; }
.hours span { flex: 1; text-align: center; font-size: 10px; color: var(--muted); }

/* Tabelas */
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
th { font-size: 12px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .05em; background: var(--panel-2); }
tr:last-child td { border-bottom: 0; }
td.wrap { white-space: normal; }
td .row { flex-wrap: nowrap; }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.code { font-family: ui-monospace, Consolas, monospace; letter-spacing: .06em; background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* Etiquetas */
.tag { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 99px; }
.tag.ok { background: var(--ok-soft); color: #86efac; }
.tag.warn { background: var(--warn-soft); color: #fcd34d; }
.tag.bad { background: var(--bad-soft); color: #fca5a5; }
.tag.info { background: var(--info-soft); color: #93c5fd; }
.tag.off { background: var(--panel-2); color: var(--muted); }
.dot-st { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--muted); }
.dot-st.ok { background: var(--ok); } .dot-st.bad { background: var(--bad); }

/* Botões e campos */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel-2); border-radius: 8px; padding: 8px 14px; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: #3a4766; }
.btn.pri { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.pri:hover { filter: brightness(1.1); }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn.danger { color: #fca5a5; }
.btn:disabled { opacity: .5; cursor: default; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: transparent; border-radius: 99px; padding: 6px 13px; cursor: pointer; color: var(--muted); font-size: 13px; }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }
input, select, textarea { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; width: 100%; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input[type=checkbox] { width: auto; }
input[type=color] { padding: 2px; height: 40px; width: 70px; }
.search { max-width: 360px; }
label.f { display: block; margin-bottom: 12px; }
label.f > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 14px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.err { color: #fca5a5; font-size: 13px; min-height: 18px; margin: 6px 0; }
.pl { border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-bottom: 10px; background: var(--bg); }

/* Janela (modal) */
.modal-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; z-index: 50; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; width: 100%; max-width: 640px; padding: 22px; }
.modal h2 { margin: 0 0 16px; font-size: 18px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* Login */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth .modal { max-width: 400px; }

/* Servidores */
.srv { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.srv .t { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; }
.srv .name { font-weight: 600; font-size: 16px; }
.srv .dns { margin-top: 10px; display: grid; gap: 4px; }
.srv .dns div { font-family: ui-monospace, Consolas, monospace; font-size: 13px; color: var(--muted); word-break: break-all; }

.preview { display: flex; align-items: center; gap: 12px; background: #000; border-radius: 10px; padding: 18px; }
.preview img { height: 40px; }

#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--panel-2); border: 1px solid var(--line); padding: 10px 18px; border-radius: 10px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 60; }
#toast.show { opacity: 1; }
#toast.bad { border-color: var(--bad); }

@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; position: fixed; inset: 0 30% 0 0; z-index: 40; height: 100%; }
  .side.open { display: flex; }
  .top { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
  .main { padding: 18px 16px 60px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
}
