:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --border: #e2e4e9;
  --text: #1c1e21;
  --muted: #6b7280;
  --accent: #2f6fed;
  --accent-hover: #2559c2;
  --danger: #d9483a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.top-bar h1 {
  font-size: 18px;
  margin: 0;
}

.nav-links {
  display: flex;
  gap: 20px;
  flex: 1;
  margin-left: 28px;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}

.nav-links a:hover { color: var(--text); }

.nav-links a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.toolbar select {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  background: white;
}

th.checkbox-col, td.checkbox-col { width: 28px; }

button {
  cursor: pointer;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  padding: 8px 14px;
  font-weight: 500;
}

.btn-primary {
  background: var(--accent);
  color: white;
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: #f0f1f3; }

.btn-danger {
  background: transparent;
  color: var(--danger);
}
.btn-danger:hover { text-decoration: underline; }

main {
  max-width: 1000px;
  margin: 24px auto;
  padding: 0 24px;
}

.toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.toolbar input[type="search"] {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

th, td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: #fafbfc;
}

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

td.actions { white-space: nowrap; text-align: right; }
td.notes { color: var(--muted); max-width: 280px; }

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.modal {
  background: var(--card);
  border-radius: 10px;
  padding: 24px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal h2 {
  margin: 0 0 16px;
  font-size: 16px;
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 4px;
}

.field input, .field textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}

.field textarea { resize: vertical; min-height: 60px; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

.hidden { display: none !important; }

.error-text {
  color: var(--danger);
  font-size: 13px;
  margin-top: 8px;
  min-height: 16px;
}

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 32px;
  width: 100%;
  max-width: 340px;
}

.login-card h1 {
  font-size: 18px;
  margin: 0 0 20px;
  text-align: center;
}
