* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #f5f6fa;
  color: #1f2937;
}

.topbar {
  background: #111827;
  color: white;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.topbar h1 {
  margin: 0;
  font-size: 24px;
}

.topbar p {
  margin: 4px 0 0;
  color: #d1d5db;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 22px;
}

.card {
  background: white;
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 18px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.card.small {
  padding: 14px;
}

h2 {
  margin-top: 0;
  font-size: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
}

label {
  display: flex;
  flex-direction: column;
  font-weight: 600;
  font-size: 14px;
  gap: 6px;
}

input, textarea {
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 11px;
  font-size: 15px;
}

textarea {
  min-height: 80px;
  resize: vertical;
}

.full {
  grid-column: 1 / -1;
}

.actions {
  display: flex;
  gap: 10px;
}

button {
  border: 0;
  background: #2563eb;
  color: white;
  padding: 11px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 15px;
}

button:hover {
  background: #1d4ed8;
}

button.secondary {
  background: #374151;
}

button.secondary:hover {
  background: #1f2937;
}

.message {
  margin-top: 12px;
  font-weight: bold;
}

.message.ok {
  color: #16a34a;
}

.message.error {
  color: #dc2626;
}

.list-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.list-header input {
  max-width: 320px;
  width: 100%;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 850px;
}

th, td {
  padding: 12px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  font-size: 14px;
}

th {
  background: #f3f4f6;
}

.status {
  color: #16a34a;
  font-weight: bold;
}

pre {
  background: #111827;
  color: #d1d5db;
  padding: 12px;
  border-radius: 10px;
  overflow: auto;
}

@media (max-width: 800px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .list-header {
    flex-direction: column;
    align-items: stretch;
  }

  .list-header input {
    max-width: none;
  }
}
