:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #d1d5db;
  --brand: #1f4db8;
  --brand-dark: #163f96;
  --danger: #b91c1c;
}

* {
  box-sizing: border-box;
  font-family: "Archivo", "Segoe UI", sans-serif;
}

body {
  margin: 0;
  color: var(--text);
  background: linear-gradient(180deg, #f8fbff 0%, var(--bg) 60%);
}

.page {
  max-width: 1300px;
  margin: 0 auto;
  padding: 20px;
}

.view {
  display: block;
}

.hidden {
  display: none !important;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
}

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

.actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.actions h1 {
  margin: 0;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 8px;
}

.sub {
  margin: 4px 0 10px;
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 12px;
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 960px) {
  .grid.three {
    grid-template-columns: 1fr;
  }
}

.form {
  display: grid;
  gap: 10px;
}

.form.compact {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 14px;
}

input,
button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
}

button {
  cursor: pointer;
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

button:hover {
  background: var(--brand-dark);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.error {
  color: var(--danger);
  margin: 4px 0;
}

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

.section-header input {
  width: 280px;
  max-width: 100%;
}

.table-wrap {
  overflow: auto;
}

.view-panel {
  display: block;
}

table {
  width: 100%;
  border-collapse: collapse;
}

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

th {
  color: #374151;
  font-weight: 600;
  background: #f9fafb;
}

tr.selectable {
  cursor: pointer;
}

tr.selectable:hover {
  background: #f5f8ff;
}

.pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 12px;
}
