:root {
  --bg: #0f1419;
  --surface: #1a222d;
  --border: #2d3848;
  --text: #e8edf4;
  --muted: #8b9cb3;
  --accent: #e8a838;
  --accent-dim: #c48a28;
  --danger: #e85d5d;
  --radius: 10px;
  --font: 'DM Sans', system-ui, sans-serif;
  --display: 'Fraunces', Georgia, serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

#app {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

h1 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.75rem;
  margin: 0 0 0.5rem;
}

h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}

h3 {
  margin: 0 0 1rem;
  font-size: 1.15rem;
}

.muted {
  color: var(--muted);
  font-size: 0.95rem;
}

.hidden {
  display: none !important;
}

.panel {
  max-width: 380px;
  margin: 4rem auto;
  padding: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.panel form label {
  display: block;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.panel input {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.6rem 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}

.panel button[type='submit'] {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.65rem;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: #1a1204;
  font-weight: 600;
  cursor: pointer;
}

.panel button[type='submit']:hover {
  background: var(--accent-dim);
}

.error {
  color: var(--danger);
  font-size: 0.85rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

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

.tab {
  padding: 0.45rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  background: var(--surface);
  color: var(--accent);
  border-color: var(--accent-dim);
}

.tab-panel {
  animation: fade 0.2s ease;
}

@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.toolbar button,
#btn-save-assign {
  padding: 0.5rem 1rem;
  border-radius: 6px;
  border: none;
  background: var(--accent);
  color: #1a1204;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.toolbar button:hover,
#btn-save-assign:hover {
  background: var(--accent-dim);
}

.ghost {
  background: transparent !important;
  color: var(--muted) !important;
  border: 1px solid var(--border) !important;
}

.ghost:hover {
  color: var(--text) !important;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

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

th,
td {
  text-align: left;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border);
}

.muted-cell {
  color: var(--muted);
  max-width: 14rem;
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

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

td.actions {
  white-space: nowrap;
}

td.actions button {
  margin-right: 0.35rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
}

td.actions button.danger {
  border-color: var(--danger);
  color: var(--danger);
}

.inline {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0;
}

.inline select {
  min-width: 200px;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
}

.checks {
  display: grid;
  gap: 0.5rem;
  margin: 1rem 0 1.25rem;
  padding: 1rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  max-height: 280px;
  overflow-y: auto;
}

.checks label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.msg {
  margin-top: 0.75rem;
  color: var(--accent);
}

.modal {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  background: var(--surface);
  color: var(--text);
  max-width: min(520px, 94vw);
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.65);
}

.modal form {
  padding: 1.5rem;
}

.modal label {
  display: block;
  margin-bottom: 0.85rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.modal input,
.modal textarea {
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.5rem 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
}

.hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin: -0.5rem 0 0.75rem;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}
