/* Hub-only styles: login screen + project picker. Layered on top of
 * styles.css (same tokens, same topbar/icon-btn/landing-mark vocabulary as
 * the viewer shell) rather than a parallel design system - this is the
 * front door to the same app, not a different product. */

.hub-center {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.hub-card {
  width: 100%;
  max-width: 360px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2rem;
}

.hub-card .landing-mark {
  width: 40px;
  height: 40px;
  margin-bottom: 0.9rem;
}

.hub-card h1 {
  margin: 0 0 0.2rem;
  font-size: 1.3rem;
}

.hub-card .muted {
  margin: 0 0 1.5rem;
  font-size: 0.85rem;
}

.hub-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 550;
  color: var(--text-muted);
  margin: 1rem 0 0.35rem;
}

.hub-field input {
  width: 100%;
  padding: 0.55rem 0.7rem;
  font: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}

.hub-field input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.hub-btn-primary {
  width: 100%;
  margin-top: 1.35rem;
  padding: 0.6rem 1rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 650;
  color: var(--accent-contrast);
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.hub-btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.hub-btn-primary:disabled {
  opacity: 0.6;
  cursor: default;
}

.hub-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 550;
  color: var(--text);
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.hub-btn-secondary:hover {
  background: var(--bg-hover);
}

.hub-btn-secondary svg {
  width: 15px;
  height: 15px;
}

.hub-error {
  margin-top: 0.9rem;
  padding: 0.5rem 0.65rem;
  font-size: 0.82rem;
  color: var(--danger);
  background: var(--danger-soft);
  border-radius: var(--radius-sm);
}

/* ---------- Hub topbar ---------- */

/* Reuses .topbar from styles.css (height/border/background/padding) but the
 * hub has no sidebar/search to size around, so the grid is just
 * brand | spacer | identity cluster instead of matching --sidebar-w. */
.topbar.hub-topbar {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.hub-topbar-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  justify-self: end;
}

.hub-whoami {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.hub-whoami .admin-tag {
  color: var(--accent);
  font-weight: 600;
}

/* ---------- Project picker ---------- */

.hub-page {
  max-width: 1040px;
  margin: 0 auto;
  padding: 2.25rem 3rem 6rem;
}

.hub-page-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.hub-page-header h1 {
  margin: 0;
  font-size: 1.4rem;
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem;
}

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 138px;
  padding: 1rem 1.1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition:
    border-color 0.12s ease-out,
    box-shadow 0.12s ease-out;
}

.tile:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.tile .tile-name {
  font-weight: 650;
  font-size: 0.92rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tile .tile-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.76rem;
  color: var(--text-faint);
}

.tile .tile-owner {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.tile-badge {
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0.1rem 0.45rem;
  border: 1px solid var(--warn-border);
  border-radius: var(--radius-sm);
  background: var(--warn-bg);
  color: var(--warn);
  font-size: 0.68rem;
  font-weight: 600;
}

.tile-reactivate {
  flex: none;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--success);
  border-radius: var(--radius-sm);
  background: var(--success-soft);
  color: var(--success);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

.tile-reactivate:hover {
  background: var(--success);
  color: var(--accent-contrast);
}

.tile-delete {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 1.85rem;
  height: 1.85rem;
  display: none;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
}

.tile-delete svg {
  width: 14px;
  height: 14px;
}

.tile:hover .tile-delete {
  display: inline-flex;
}

.tile-delete:hover {
  color: var(--danger);
  border-color: var(--danger);
  background: var(--danger-soft);
}

.tile-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  height: 138px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.tile-add svg {
  width: 17px;
  height: 17px;
}

.tile-add:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.hub-empty {
  max-width: 480px;
  padding-top: 1.5rem;
}

.hub-empty .landing-mark {
  width: 44px;
  height: 44px;
}

/* ---------- Admin users panel ---------- */

.hub-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-top: 0.5rem;
  font-size: 0.85rem;
}

.hub-user-row .email {
  font-weight: 550;
}

.hub-user-row .meta {
  color: var(--text-faint);
  font-size: 0.78rem;
}
