:root {
  --ink: #16283a;
  --muted: #5b7184;
  --line: #d7e3ea;
  --bg: #eef4f7;
  --accent: #0a7ea4;
  --accent-soft: #e3f2f6;
  --accent-ink: #ffffff;
  --card: #ffffff;
  --danger: #c0392b;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  border-top: 4px solid var(--accent);
}

.brand {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.01em;
}

.brand::before {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
}



.nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.nav-link {
  margin-right: 0;
}

.user-menu {
  position: relative;
}

.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 6px;
  border-radius: 999px;
  cursor: pointer;
  list-style: none;
}

.user-menu-trigger::-webkit-details-marker {
  display: none;
}

.user-menu-trigger:hover {
  background: var(--bg);
}

.user-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.8rem;
  font-weight: 700;
}

.user-menu-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(22, 40, 58, 0.1);
  background: var(--card);
  padding: 6px;
  min-width: 140px;
  z-index: 10;
}

.logout-form {
  margin: 0;
}

.logout-btn {
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 6px;
}

.logout-btn:hover {
  background: var(--accent-soft);
  color: var(--ink);
}

.main {
  max-width: 980px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.page-title {
  font-size: 1.6rem;
  margin-bottom: 4px;
}

.section-title {
  font-size: 1.2rem;
}

.subtitle {
  color: var(--muted);
  margin-top: 0;
}

.breadcrumb {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 12px;
}

.breadcrumb a {
  color: var(--muted);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 18px;
  text-decoration: none;
  color: var(--ink);
  display: block;
  transition: box-shadow 0.15s, transform 0.15s, border-left-color 0.15s;
}

.card:hover {
  box-shadow: 0 4px 14px rgba(10, 126, 164, 0.1);
  transform: translateY(-1px);
}

.card-count {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 10px;
  border-radius: 999px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}

.data-table th {
  background: var(--accent-soft);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

.data-table .row-link:hover {
  background: var(--accent-soft);
  cursor: pointer;
}

.table-link {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}

.table-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.empty-state {
  color: var(--muted);
  padding: 24px 0;
}

.search-box {
  margin-top: 14px;
}

.search-input {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  width: 260px;
  font-size: 0.9rem;
}

.search-btn {
  padding: 8px 14px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
  margin-left: 6px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 10px 18px;
  margin-top: 18px;
  max-width: 640px;
}

.detail-grid dt {
  color: var(--muted);
  font-size: 0.85rem;
}

.detail-grid dd {
  margin: 0;
}

.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--line);
  font-size: 0.8rem;
  font-weight: 500;
  margin: 2px 4px 2px 0;
  text-decoration: none;
  color: var(--accent);
}

.login-wrap {
  max-width: 360px;
  margin: 90px auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 8px 24px rgba(22, 40, 58, 0.06);
}

.login-subtitle {
  margin-bottom: 20px;
}

.login-input {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 12px;
}

.login-btn {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  cursor: pointer;
}

.errorlist {
  color: var(--danger);
  font-size: 0.85rem;
  list-style: none;
  padding: 0;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

.btn-secondary {
  background: var(--card);
  color: var(--ink);
}

.btn-danger {
  background: var(--card);
  color: var(--danger);
  border-color: var(--danger);
}

.detail-form {
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-form label {
  font-weight: 600;
  margin-top: 8px;
}

.detail-form input[type="text"] {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1rem;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.messages {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}

.messages li {
  padding: 10px 14px;
  border-radius: var(--radius);
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.messages .success {
  background: #e3f6e9;
  color: #1e7a3d;
}

.messages .error {
  background: #fbeaea;
  color: var(--danger);
}

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

.checkbox-list {
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checkbox-list label {
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  margin-right: 18px;
}

.nav-divider {
  width: 1px;
  height: 18px;
  background: var(--line);
}

.nav-link:hover {
  color: var(--accent);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.8rem;
}

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

.inline-form {
  display: inline;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.badge-approved {
  background: #e3f6e9;
  color: #1e7a3d;
}

.badge-pending {
  background: #fbeee0;
  color: #a05a12;
}

.field-help {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 4px 0 0;
}

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

.filter-tabs {
  display: flex;
  gap: 4px;
}

.filter-tab {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
}

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

.filter-tab.active {
  background: var(--accent-soft);
  color: var(--accent);
}

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

.text-pending {
  color: #a05a12;
  font-weight: 600;
}

.pill-role-viewer {
  background: var(--accent-soft);
  color: var(--accent);
}

.pill-role-editor {
  background: #eef0fb;
  color: #4a4fc4;
}

.pill-role-admin {
  background: #f6e9f7;
  color: #8a3a92;
}

.pending-state {
  max-width: 480px;
  margin: 60px auto;
  text-align: center;
}

.pending-state .subtitle {
  margin-bottom: 24px;
}

.text-soft {
  color: var(--muted);
  font-size: 0.85rem;
}

.text-input {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.95rem;
  width: 100%;
}

.notes-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
}

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

.note-meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.note-content {
  margin: 8px 0 10px;
  white-space: pre-wrap;
  line-height: 1.5;
}

.note-actions {
  display: flex;
  gap: 10px;
  font-size: 0.85rem;
}

.note-actions a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.note-actions a:hover {
  text-decoration: underline;
}

.note-form {
  margin-bottom: 20px;
}

.note-form-field {
  margin-bottom: 10px;
}

.note-form-field label {
  font-weight: 600;
  display: block;
  margin-bottom: 6px;
}

.note-textarea {
  max-width: 600px;
  resize: vertical;
}
