*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f7f8fa;
  color: #1f2933;
  line-height: 1.5;
}

header {
  background: #111827;
  color: #fff;
  padding: 1.5rem 2rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

header h1 {
  margin: 0;
  font-size: 1.75rem;
}

header p {
  margin: 0.25rem 0 0;
  opacity: 0.8;
}

#notification {
  margin-top: 1rem;
  min-height: 1.2rem;
}

#notification.success {
  color: #10b981;
}

#notification.error {
  color: #ef4444;
}

main {
  padding: 2rem;
  display: grid;
  gap: 2rem;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.tab-button {
  border: none;
  padding: 0.55rem 1rem;
  border-radius: 9999px;
  background: #e5e7eb;
  color: #1f2937;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.tab-button:hover {
  background: #d1d5db;
}

.tab-button.active {
  background: #2563eb;
  color: #fff;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}


section {
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

section h2 {
  margin-top: 0;
  font-size: 1.3rem;
}

form {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.75rem;
}

.toolbar input[type="search"] {
  min-width: 260px;
  max-width: 380px;
}

label {
  display: flex;
  flex-direction: column;
  font-size: 0.9rem;
  color: #4b5563;
  gap: 0.3rem;
}

input,
textarea,
select,
button {
  font: inherit;
}

input,
textarea,
select {
  padding: 0.6rem 0.7rem;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #2563eb;
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
  background: #fff;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

button {
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  background: #2563eb;
  color: #fff;
  font-weight: 600;
  transition: background 0.2s ease, transform 0.2s ease;
}

button:hover {
  background: #1d4ed8;
}

.actions-col {
  text-align: right;
  white-space: nowrap;
}

button.small {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
}

.table-empty {
  text-align: center;
  color: #6b7280;
  font-style: italic;
}

button:disabled,
button[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.danger {
  background: #ef4444;
}

.danger:hover {
  background: #dc2626;
}

.grid {
  display: grid;
  gap: 1rem;
}

.grid.two {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.grid.three {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.grid label {
  min-width: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

table thead {
  background: #f3f4f6;
}

th,
td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

tr.selected {
  background: rgba(37, 99, 235, 0.1);
}

@media (max-width: 768px) {
  main {
    padding: 1.5rem 1rem;
  }

  section {
    padding: 1.2rem;
  }
}

#competition-refresh {
  max-height: 3rem;
  margin-top: 1rem;
}