* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', sans-serif;
  font-size: 14px;
  background: #f0f4f8;
  color: #333;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

header {
  background: #1a3a5c;
  color: white;
  padding: 14px 20px;
  font-size: 18px;
  font-weight: bold;
  flex-shrink: 0;
}

header h1 {
  font-size: 18px;
  font-weight: bold;
}

/* ── Toolbar ─────────────────────────────────────────────────────────────── */

.toolbar {
  background: #dde3ea;
  padding: 8px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.file-label {
  color: #555;
  font-size: 13px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.range-label {
  font-weight: bold;
  margin-left: 10px;
}

.range-input {
  width: 60px;
  padding: 4px 6px;
  border: 1px solid #bbb;
  border-radius: 4px;
  text-align: center;
  font-size: 13px;
}

.range-sep {
  color: #555;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.btn {
  padding: 6px 14px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  color: white;
  transition: opacity 0.15s;
}

.btn:hover { opacity: 0.88; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-blue   { background: #2d6fa3; }
.btn-purple { background: #7b5ea7; }
.btn-orange { background: #e67e22; }
.btn-green  { background: #27ae60; font-weight: bold; font-size: 14px; }

/* ── Status bar ──────────────────────────────────────────────────────────── */

.status-bar {
  padding: 5px 20px;
  background: #f0f4f8;
  font-size: 13px;
  color: #666;
  flex-shrink: 0;
}

/* ── Legend ──────────────────────────────────────────────────────────────── */

.legend {
  display: flex;
  gap: 8px;
  padding: 4px 20px;
  flex-shrink: 0;
}

.legend-item {
  padding: 2px 10px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 12px;
}

.legend-item.ok      { background: #e8f5e9; }
.legend-item.alerta  { background: #fff3e0; }
.legend-item.offline { background: #fce4ec; }
.legend-item.erro    { background: #ffebee; }

/* ── Table ───────────────────────────────────────────────────────────────── */

.table-wrapper {
  flex: 1;
  overflow: auto;
  padding: 6px 20px 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

thead tr {
  background: #1a3a5c;
  color: white;
}

th {
  padding: 10px 8px;
  text-align: center;
  font-size: 13px;
  font-weight: bold;
  white-space: nowrap;
}

td {
  padding: 8px;
  text-align: center;
  font-size: 13px;
  border-bottom: 1px solid #eee;
}

tbody tr:last-child td { border-bottom: none; }

tbody tr.ok      { background: #e8f5e9; }
tbody tr.alerta  { background: #fff3e0; }
tbody tr.offline { background: #fce4ec; }
tbody tr.erro    { background: #ffebee; }

tbody tr:hover { filter: brightness(0.96); }

/* ── Progress bar ────────────────────────────────────────────────────────── */

.progress-bar-wrap {
  height: 3px;
  background: #dde3ea;
  flex-shrink: 0;
}

.progress-bar {
  height: 100%;
  background: #27ae60;
  width: 0%;
  transition: width 0.2s;
}
