* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f5f7fb;
  color: #1f2937;
}
.topbar {
  background: #1d4ed8;
  color: white;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}
.brand {
  font-size: 22px;
  font-weight: bold;
}
.brand a {
  color: inherit;
  text-decoration: none;
}

/* ── user menu ── */
.user-menu {
  position: relative;
}
.user-menu-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: background .15s ease, transform .2s ease;
}
.user-menu-btn:hover,
.user-menu--open .user-menu-btn {
  background: rgba(255,255,255,0.28);
  transform: scale(1.1);
}
.user-menu-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  padding: 6px;
  z-index: 999;
}
.user-menu:hover .user-menu-dropdown,
.user-menu--open .user-menu-dropdown {
  display: block;
}
.user-menu-dropdown a {
  display: block;
  padding: 10px 14px;
  text-decoration: none;
  color: #1f2937;
  border-radius: 8px;
  font-size: 14px;
}
.user-menu-dropdown a:hover {
  background: #eff6ff;
  color: #1d4ed8;
}
.user-menu-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 4px 6px;
}

/* ── layout ── */
.layout {
  min-height: calc(100vh - 64px);
}
.content {
  padding: 24px;
}
.hero {
  background: linear-gradient(135deg, #dbeafe, #eff6ff);
  padding: 24px;
  border-radius: 16px;
  margin-bottom: 20px;
  border: 1px solid #bfdbfe;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.card {
  background: white;
  border-radius: 16px;
  padding: 18px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 16px rgba(0,0,0,0.04);
}
.card h4 {
  margin: 0 0 10px 0;
}
.card p, .card li {
  color: #4b5563;
  font-size: 14px;
}
.pill {
  display: inline-block;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  margin-bottom: 10px;
}
.btn {
  display: inline-block;
  margin-top: 10px;
  text-decoration: none;
  background: #1d4ed8;
  color: white;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
}
table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}
th, td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}
th { background: #eff6ff; }
.danger { background: #dc2626; }
.warning { background: #f59e0b; }
.muted { color: #6b7280; }
.empty {
  padding: 30px;
  text-align: center;
  background: white;
  border: 1px dashed #cbd5e1;
  border-radius: 16px;
}
.banner { margin-bottom: 16px; }
.externals-table { table-layout: fixed; }
.externals-table th:nth-child(1), .externals-table td:nth-child(1) { width: 90px; }
.externals-table th:nth-child(2), .externals-table td:nth-child(2) { width: 30%; }
.externals-table th:nth-child(3), .externals-table td:nth-child(3) { width: 30%; }
.externals-table th:nth-child(4), .externals-table td:nth-child(4) { width: auto; }
.cell-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 0;
}
.cell-mono { font-family: monospace; font-size: 13px; }
.cell-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.btn-sm { padding: 6px 10px; font-size: 13px; }
.banner-ok { background: #dcfce7; border-color: #86efac; }
.banner-error { background: #fee2e2; border-color: #fca5a5; }
.build-footer {
  text-align: center;
  padding: 8px 16px;
  font-size: 11px;
  color: #9ca3af;
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
}
.build-footer code {
  font-size: 11px;
  background: #e5e7eb;
  padding: 1px 5px;
  border-radius: 4px;
}
@media (max-width: 860px) {
  .content { padding: 18px; }
}
