* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  margin: 0;
  background: #f5f7fa;
  color: #2c3e50;
}

header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 24px;
  text-align: center;
}
header h1 { margin: 0; font-size: 22px; }
.subtitle { font-size: 13px; opacity: 0.9; margin-top: 4px; }

main {
  max-width: 1100px;
  margin: 20px auto;
  padding: 0 16px;
}

.panel {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

label { font-size: 14px; }
select, input[type="password"] {
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
}
button {
  padding: 7px 16px;
  border: none;
  border-radius: 6px;
  background: #667eea;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}
button:hover { background: #5568d3; }
button.danger { background: #e74c3c; }
button.danger:hover { background: #c0392b; }

.status {
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 8px;
  background: #eef1f5;
}
.status.ok { background: #d4edda; color: #155724; }
.status.error { background: #f8d7da; color: #721c24; }
.status.loading { background: #fff3cd; color: #856404; }

.meta {
  font-family: monospace;
  font-size: 12px;
  color: #666;
  background: #f8f9fa;
  padding: 8px;
  border-radius: 6px;
  max-height: 120px;
  overflow: auto;
  white-space: pre-wrap;
  margin-bottom: 16px;
}
.meta:empty { display: none; }

.table-wrap {
  overflow-x: auto;
  max-height: 500px;
  overflow-y: auto;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th, td {
  padding: 8px 10px;
  text-align: center;
  border-bottom: 1px solid #eaeaea;
  white-space: nowrap;
}
thead th {
  background: #f0f4ff;
  position: sticky;
  top: 0;
  z-index: 1;
  font-weight: 600;
}
tbody tr:hover { background: #f8f9ff; }

.admin h2 { margin-top: 0; font-size: 16px; }
pre#adminOutput {
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 12px;
  border-radius: 6px;
  font-size: 12px;
  overflow: auto;
  max-height: 400px;
  white-space: pre-wrap;
}

footer {
  text-align: center;
  font-size: 12px;
  color: #999;
  padding: 20px;
}