:root {
  --bg: #0f1115;
  --panel: #171a21;
  --border: #2a2e37;
  --text: #e6e8eb;
  --muted: #8a8f98;
  --accent: #4f8cff;
  --debug: #8a8f98;
  --info: #4f8cff;
  --warn: #e0a527;
  --error: #e5484d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

h1 {
  font-size: 22px;
  margin: 0;
}

.grafana-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
}

.grafana-link:hover {
  text-decoration: underline;
}

form {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-message {
  grid-column: 1 / -1;
}

label {
  font-size: 13px;
  color: var(--muted);
}

select,
input,
textarea {
  background: #0f1115;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
}

button {
  cursor: pointer;
  border: none;
  border-radius: 6px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  background: var(--accent);
  color: white;
  width: fit-content;
}

button:hover {
  opacity: 0.9;
}

#status {
  align-self: center;
  font-size: 13px;
  color: var(--muted);
}

.upload-section {
  margin-top: 32px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
}

.upload-section h2 {
  font-size: 16px;
  margin: 0 0 4px;
}

.hint {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 14px;
}

.upload-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.upload-actions button {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.drop-zone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 30px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  transition: border-color 0.15s, color 0.15s;
}

.drop-zone.dragover {
  border-color: var(--accent);
  color: var(--accent);
}

.upload-status {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
}

.upload-results {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.upload-item {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 6px;
  background: #0f1115;
  border: 1px solid var(--border);
}

.upload-item.status-ok { color: var(--info); }
.upload-item.status-binary-skipped { color: var(--muted); }
.upload-item.status-error { color: var(--error); }

.logs-section {
  margin-top: 32px;
}

.logs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.logs-header h2 {
  font-size: 16px;
  margin: 0;
}

#refresh-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 400;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

th,
td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
}

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

.level-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.level-debug { background: rgba(138,143,152,0.15); color: var(--debug); }
.level-info { background: rgba(79,140,255,0.15); color: var(--info); }
.level-warn { background: rgba(224,165,39,0.15); color: var(--warn); }
.level-error { background: rgba(229,72,77,0.15); color: var(--error); }
